From ff2c1b2c25e1cf5f4e142ff34cd0970282de251d Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 12:08:21 -0800 Subject: [PATCH 1/4] test(obs-output): mirror service registry lookup against Rust stub (Refs #5273) --- rust/obs-output/src/lib.rs | 1 + rust/obs-output/src/service_find.rs | 7 +++ rust/obs-output/tests/output/main.rs | 1 + rust/obs-output/tests/output/service_find.rs | 55 ++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 rust/obs-output/src/service_find.rs create mode 100644 rust/obs-output/tests/output/service_find.rs diff --git a/rust/obs-output/src/lib.rs b/rust/obs-output/src/lib.rs index 097c962dc9..8ccb734a03 100644 --- a/rust/obs-output/src/lib.rs +++ b/rust/obs-output/src/lib.rs @@ -223,6 +223,7 @@ pub mod raw_audio; pub mod raw_audio_trim; pub mod service; pub mod service_context_getters; +pub mod service_find; pub mod service_module_lookup; pub mod service_state; pub mod service_weak_acquire; diff --git a/rust/obs-output/src/service_find.rs b/rust/obs-output/src/service_find.rs new file mode 100644 index 0000000000..898c89c83c --- /dev/null +++ b/rust/obs-output/src/service_find.rs @@ -0,0 +1,7 @@ +//! Borrowed, byte-exact lookup in the C-owned service registry. + +/// Walk IDs lazily and return the first matching entry without copying it. +pub fn find<'a, T>(id: &[u8], entries: impl IntoIterator) -> Option { + let _ = (id, entries); + todo!("port find_service") +} diff --git a/rust/obs-output/tests/output/main.rs b/rust/obs-output/tests/output/main.rs index 6050bbafd3..ea6dce890f 100644 --- a/rust/obs-output/tests/output/main.rs +++ b/rust/obs-output/tests/output/main.rs @@ -157,6 +157,7 @@ mod raw_audio_trim_parity; mod service; mod service_context_getters; mod service_context_getters_parity; +mod service_find; mod service_lifecycle; mod service_lifecycle_parity; mod service_module_lookup; diff --git a/rust/obs-output/tests/output/service_find.rs b/rust/obs-output/tests/output/service_find.rs new file mode 100644 index 0000000000..0386d7dc55 --- /dev/null +++ b/rust/obs-output/tests/output/service_find.rs @@ -0,0 +1,55 @@ +//! Tier 1 mirrors test_service_find.c::registry_lookup without FFI. +use obs_output::service_find::find; + +#[derive(Clone, Debug, PartialEq)] +struct Entry { + id: Vec, + owner: usize, +} + +fn lookup<'a>(entries: &'a [Entry], count: usize, query: &[u8]) -> Option<&'a Entry> { + find(query, entries[..count].iter().map(|entry| (entry.id.as_slice(), entry))) +} + +#[test] +fn registry_lookup() { + for query in [b"".as_slice(), b"missing"] { + assert!(lookup(&[], 0, query).is_none()); + } + let ids: &[&[u8]] = &[b"svc", b"svc.suffix", b"SVC", b"", b"\xff\x80x", b"svc", b"last", b"outside"]; + let mut entries: Vec<_> = ids.iter().enumerate().map(|(owner, id)| Entry { id: id.to_vec(), owner }).collect(); + assert!(lookup(&entries, 0, b"svc").is_none()); + let queries: &[(&[u8], Option)] = &[ + (b"svc", Some(0)), (b"sv", None), (b"svc.suffix", Some(1)), + (b"svc.suffix.more", None), (b"SVC", Some(2)), (b"Svc", None), + (b"", Some(3)), (b"\xff\x80x", Some(4)), (b"\xff\x81x", None), + (b"last", Some(6)), (b"outside", None), (b"missing", None), + ]; + let before = entries.clone(); + for &(query, expected) in queries { + let actual = lookup(&entries, 7, query); + assert_eq!(actual.map(|entry| entry.owner), expected); + if let Some(index) = expected { + assert!(std::ptr::eq(actual.unwrap(), &entries[index])); + } + assert_eq!(entries, before); + } + entries.swap(0, 5); + assert!(std::ptr::eq(lookup(&entries, 7, b"svc").unwrap(), &entries[0])); + entries[0].id = b"replaced".to_vec(); + assert!(std::ptr::eq(lookup(&entries, 7, b"svc").unwrap(), &entries[5])); + assert_eq!(entries[5].id, b"svc"); + assert_eq!(entries[0].owner, 5); +} + +#[test] +fn stops_before_reading_later_entries() { + let mut reads = 0; + let entries = [b"svc".as_slice(), b"svc", b"other"]; + let found = find(b"svc", entries.iter().enumerate().map(|(index, id)| { + reads += 1; + (*id, index) + })); + assert_eq!(found, Some(0)); + assert_eq!(reads, 1); +} From 9a777becd4f207a60a1428a698949997fe6bde25 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 12:28:29 -0800 Subject: [PATCH 2/4] obs-output: port borrowed service registry lookup to Rust (Refs #5273) --- libobs/build/libobs.core-output+.h.c | 2 +- libobs/build/libobs.ported-service-find+.h.c | 4 + .../ported-source-sets/service-find.json | 5 + .../rust-hidden.d/obs-output-service_find.txt | 1 + libobs/obs-service-find-fields.c.h | 19 ++++ rust/README.md | 1 + ...anonical_video_info_query_is_registered.rs | 4 +- .../private-steps/test_service_find.json | 35 +++++++ rust/obs-c-oracle/oracle.d/service-find.list | 1 + rust/obs-c-oracle/oracle/service_find.c | 94 +++++++++++++++++++ rust/obs-c-oracle/oracle/service_getters.c | 32 ++----- rust/obs-output/src/ffi/mod.rs | 1 + rust/obs-output/src/ffi/service_find.rs | 27 ++++++ rust/obs-output/src/service_find.rs | 5 +- rust/obs-output/tests/output/main.rs | 1 + rust/obs-output/tests/output/service_find.rs | 64 ++++++++++--- .../tests/output/service_find_parity.rs | 88 +++++++++++++++++ test/cmocka/build/test-graph.json | 28 ++++++ test/cmocka/service-find-link-support.c | 4 +- test/cmocka/service-find-registry-adapter.c | 6 ++ .../tests.d/test_service_find_rust.cmake | 1 + 21 files changed, 378 insertions(+), 45 deletions(-) create mode 100644 libobs/build/libobs.ported-service-find+.h.c create mode 100644 libobs/build/ported-source-sets/service-find.json create mode 100644 libobs/cmake/rust-hidden.d/obs-output-service_find.txt create mode 100644 libobs/obs-service-find-fields.c.h create mode 100644 rust/obs-build/tests/native/registration/rust-static/cases/private-steps/test_service_find.json create mode 100644 rust/obs-c-oracle/oracle.d/service-find.list create mode 100644 rust/obs-c-oracle/oracle/service_find.c create mode 100644 rust/obs-output/src/ffi/service_find.rs create mode 100644 rust/obs-output/tests/output/service_find_parity.rs create mode 100644 test/cmocka/service-find-registry-adapter.c create mode 100644 test/cmocka/tests.d/test_service_find_rust.cmake diff --git a/libobs/build/libobs.core-output+.h.c b/libobs/build/libobs.core-output+.h.c index a5fef627e4..e1741a75c2 100644 --- a/libobs/build/libobs.core-output+.h.c +++ b/libobs/build/libobs.core-output+.h.c @@ -82,7 +82,7 @@ #include "libobs/obs-output-video-encoder-getter-fields.c.h" #include "libobs/obs-output.c.h" #include "libobs/obs-service-context-getter-fields.c.h" -#include "libobs/obs-service-find.c.h" +#include "libobs/obs-service-find-fields.c.h" #include "libobs/obs-service-handler-getters-fields.c.h" #include "libobs/obs-service-info-accessors-fields.c.h" #include "libobs/obs-service-state-adapter.c.h" diff --git a/libobs/build/libobs.ported-service-find+.h.c b/libobs/build/libobs.ported-service-find+.h.c new file mode 100644 index 0000000000..16dd62958f --- /dev/null +++ b/libobs/build/libobs.ported-service-find+.h.c @@ -0,0 +1,4 @@ +/* Original C service registry lookup, retained for the C reference. */ +#include "libobs/build/libobs.pch.h" + +#include "libobs/obs-service-find.c.h" diff --git a/libobs/build/ported-source-sets/service-find.json b/libobs/build/ported-source-sets/service-find.json new file mode 100644 index 0000000000..0d95f17b6c --- /dev/null +++ b/libobs/build/ported-source-sets/service-find.json @@ -0,0 +1,5 @@ +{ + "LIBOBS_PORTED_SOURCES": [ + "build/libobs.ported-service-find+.h.c" + ] +} diff --git a/libobs/cmake/rust-hidden.d/obs-output-service_find.txt b/libobs/cmake/rust-hidden.d/obs-output-service_find.txt new file mode 100644 index 0000000000..4fbf39cd46 --- /dev/null +++ b/libobs/cmake/rust-hidden.d/obs-output-service_find.txt @@ -0,0 +1 @@ +find_service diff --git a/libobs/obs-service-find-fields.c.h b/libobs/obs-service-find-fields.c.h new file mode 100644 index 0000000000..955dd44a3a --- /dev/null +++ b/libobs/obs-service-find-fields.c.h @@ -0,0 +1,19 @@ +#include "libobs/build/libobs.pch.h" + +size_t obs_service_find_count(void); +size_t obs_service_find_count(void) +{ + return obs->service_types.num; +} + +const struct obs_service_info *obs_service_find_entry(size_t index); +const struct obs_service_info *obs_service_find_entry(size_t index) +{ + return obs->service_types.array + index; +} + +const char *obs_service_find_id(const struct obs_service_info *entry); +const char *obs_service_find_id(const struct obs_service_info *entry) +{ + return entry->id; +} diff --git a/rust/README.md b/rust/README.md index 201a2a2fe5..c95c111104 100644 --- a/rust/README.md +++ b/rust/README.md @@ -359,6 +359,7 @@ The private output starting/encoder-demand queries use lazy safe Rust decisions | `libobs/obs-output-update.c.h` | `obs-output::output_update` | Swapped in hybrid `libobs` (group `libobs.ported-output-update`). `obs_output_update()` merges the incoming settings into the stored ones through `obs_data_apply()`, then calls the type's `update` with the plugin data and the stored settings when it has one; a NULL output logs and does nothing else. The live adapter `obs-output-update-fields.c.h` gives the stored settings, whether the type has an update, and the call. No lock, as in C, and nothing of the output is held across the plugin's callback. Tier 1 mirrors of the unchanged Tier 2 characterization and original-C differential coverage of the merged settings and the callback. No intentional differences; Tier 4 does not apply. | | `libobs/obs-service-weak-acquire.c.h` | `obs-output::service_weak_acquire` | Swapped in hybrid libobs (#3837): the hidden `obs_weak_service_weak_get_ref` and `obs_weak_service_target` read the unchanged C weak-control layout, using the platform C-long-width SeqCst atomic count. Tier 2 keeps the existing service lifecycle tests; Tier 3 checks both private layouts against the real C header and compares return values, target and both counts. No intended behavior differences for defined C inputs. Acquisition at `LONG_MAX` (signed overflow in C) and NULL controls (invalid in C) are outside the parity domain. Release/free are ported in #3838, module lookup is #3839, and context/state/handlers are #3840. | | `libobs/obs-service-context-getters.c.h` | `obs-output::service_context_getters` | Hidden borrowed name/settings getters (#4483), using real private C field addresses. No allocation, reference acquisition or mutation. Original C retained in its reference-only group; Tier 3 checks nullable field values, exact pointer identity, field addresses and unchanged service bytes. NULL services remain outside the original caller contract. | +| `libobs/obs-service-find.c.h` | `obs-output::service_find` | Hidden first byte-exact match in the C-owned service registry (#5273). Real private projections retain native layouts and borrowed pointer identity; lookup is lazy safe Rust, with unchanged external C characterization and original-C differential coverage. | | `libobs/obs-service-getters.c.h` | `obs-output::service` | Swapped in hybrid `libobs` (group `libobs.ported-service-getters`), #1899. The nine exported service getters (`obs_service_get_protocol`, `_get_connect_info`, `_can_try_to_connect`, `_get_preferred_output_type`, `_get_max_fps`, `_get_max_bitrate`, `_get_supported_resolutions` and the two codec lists), moved out of `obs-service.c.h`. `struct obs_service` stays C: the shims reach the plugin's `obs_service_info` table and data through the hidden `obs_service_get_info_table()` and `obs_service_get_plugin_data()` kept beside it, and mirror `struct obs_service_info` (the public plugin ABI) with its layout checked against the C. #1913 moved the settings, properties and identity functions the same way: `obs_service_get_display_name`, `obs_service_defaults` and `obs_get_service_properties` (by id, through `find_service()`), and `obs_service_get_name`, `_get_type`, `_get_id`, `_get_type_data`, `_update`, `_get_settings`, `_properties` and `_apply_encoder_settings`; the context name and settings come through the hidden `obs_service_get_context_name()` and `_get_context_settings()`, and the `obs_data_t` / `obs_properties_t` calls go to libobs. `obs_service_get_signal_handler` and `_get_proc_handler` are now ported separately (see below); neither has a public header declaration. #1920 moved the rest the same way: `obs_service_create`, `_create_private`, `_destroy` (deferred while active), `_release`, the strong and weak reference functions, `obs_service_get_module` and `_load_state`, and the output-side `obs_service_activate`, `_deactivate` and `_initialize` (hidden). `struct obs_service`, its context (`obs_context_data_*`) and its reference counts (`obs_ref_*`, `obs_weak_ref_*`) stay C behind hidden `obs_service_*()` / `obs_weak_service_*()` steps in `obs-service.c.h`; the port keeps their order, the release order (destroy, then the control's weak ref) and the log lines. The C's check-and-zero order is kept, including what `test_service_getters` marks "characterized, not endorsed": `get_max_bitrate` zeroes its out-parameters before checking the service, and the codec getters do not check for NULL. Tier 2 runs `test_service_getters`, `test_service_settings` and `test_service_lifecycle` through the hybrid libobs; for #1913 Tier 3 runs every function on both sides over the 32 tables of its four optional callbacks and type data, comparing returns, settings contents and the plugin call trace; for #1920 Tier 3 runs create, refs, activation and the deferred destroy on both sides over every table of its three optional callbacks, a failing `create()` and both `initialize()` results, comparing results and the trace of every step and plugin call, plus the module lookups over the same module lists; Tier 3 runs every getter on the Rust and the C with the same service over all 256 optional-callback tables, NULL and sentinel out-parameters, comparing returns, out-parameters and the plugin call trace. | | `libobs/obs-service-handler-getters.c.h` | `obs-output::service_handler_getters` | Hidden borrowed signal/procedure handlers swapped in hybrid libobs (#5002; parent #3840). Preserves exact NULL diagnostics, independent nullable handlers, pointer identity and unchanged service bytes. Guarded real field adapter, real-header layout, Tier 1, C-oracle differential/mutation and unchanged C characterization via declaration-only Rust-static mode. No intentional differences; Tier 4 does not apply. | | `libobs/obs-service-info-accessors.c.h` | `obs-output::service_info_accessors` | Swapped in hybrid `libobs` (#3840; group `libobs.ported-service-info-accessors` keeps the original for the C reference). The hidden `obs_service_set_info`, `obs_service_get_info_table`, `obs_service_set_plugin_data` and `obs_service_get_plugin_data` (`obs-internal.h`, listed in `rust-hidden.d`), which the service lifecycle and getters call. Rust copies the whole table by value into the service (reading the source first, so a table copied onto itself is unchanged), returns the borrowed address of the service's own copy, and stores and returns the plugin data as it is, NULL included; nothing else in the service changes and nothing is logged. A private field adapter (`obs-service-info-accessors-fields.c.h`) keeps `struct obs_service` in C; the Rust-static support member now supplies that adapter instead of the original, and the service oracle's own copies of the four names are gone. The unchanged `test_service_info_accessors` keeps testing the C source; its twin `test_service_info_accessors_rust` runs the same assertions on the Rust shims. Tier 1 mirrors every assertion; Tier 3 runs the original and the shims on byte-pattern services (characterized and random set/get sequences, self-copy included), comparing results, whole services and source tables, with real-header layout checks and mutants. No intentional differences; Tier 4 does not apply. | diff --git a/rust/obs-build/tests/native/registration/canonical_video_info_query_is_registered.rs b/rust/obs-build/tests/native/registration/canonical_video_info_query_is_registered.rs index d2a45581f0..58e49c88a7 100644 --- a/rust/obs-build/tests/native/registration/canonical_video_info_query_is_registered.rs +++ b/rust/obs-build/tests/native/registration/canonical_video_info_query_is_registered.rs @@ -76,8 +76,8 @@ target_link_libraries(reference PRIVATE OBS::libobs) include("{root}/test/cmocka/tests.d/video_info_query_link_support.cmake") function(check_support) get_target_property(adapter_sources video_info_query_link_support SOURCES) - foreach(adapter IN ITEMS encoder-video-tex-active-fields encoder-video-tex-active-mix encoder-get-name - output-interleave-name source-audio-capture-callback) + foreach(adapter IN ITEMS encoder-get-name encoder-video-tex-active-fields encoder-video-tex-active-mix + output-interleave-name service-find source-audio-capture-callback) if(NOT "{root}/test/cmocka/${{adapter}}-link-support.c" IN_LIST adapter_sources) message(FATAL_ERROR "missing real private adapter source: ${{adapter}}") endif() diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/private-steps/test_service_find.json b/rust/obs-build/tests/native/registration/rust-static/cases/private-steps/test_service_find.json new file mode 100644 index 0000000000..6c42ce50de --- /dev/null +++ b/rust/obs-build/tests/native/registration/rust-static/cases/private-steps/test_service_find.json @@ -0,0 +1,35 @@ +{ + "schema": 1, + "targets": { + "test_service_find_rust": { + "sources": [ + "test/cmocka/test_service_find.c", + "test/cmocka/service-find-registry-adapter.c" + ], + "libraries": [ + "libobs_rust-static", + "OBS::libobs", + "OBS::caption", + "Uthash::Uthash", + "OBS::native-test-cmocka", + { + "name": "OBS::w32-pthreads", + "requires": "OS_WINDOWS" + } + ], + "definitions": [ + "SERVICE_FIND_EXTERNAL" + ], + "requires": "HAVE_LIBOBS_RUST_STATIC" + } + }, + "tests": { + "test_service_find_rust": { + "target": "test_service_find_rust", + "command": [ + "${target}" + ], + "requires": "HAVE_LIBOBS_RUST_STATIC" + } + } +} diff --git a/rust/obs-c-oracle/oracle.d/service-find.list b/rust/obs-c-oracle/oracle.d/service-find.list new file mode 100644 index 0000000000..a25d29ab41 --- /dev/null +++ b/rust/obs-c-oracle/oracle.d/service-find.list @@ -0,0 +1 @@ +service-find.inc|libobs/obs-service-find.c.h|auto diff --git a/rust/obs-c-oracle/oracle/service_find.c b/rust/obs-c-oracle/oracle/service_find.c new file mode 100644 index 0000000000..fe482fd2ab --- /dev/null +++ b/rust/obs-c-oracle/oracle/service_find.c @@ -0,0 +1,94 @@ +/* Original lookup and real field projections, with a controlled C-owned core. */ +#include "obs-internal.h" +#include + +static struct obs_core service_find_oracle_storage; +static struct obs_core *service_find_oracle_core = &service_find_oracle_storage; +#define obs service_find_oracle_core +#define find_service oracle_find_service +const struct obs_service_info *oracle_find_service(const char *id); +#include "service-find.inc" +#undef find_service +#include "service_find_fields.inc" +#undef obs + +void oracle_service_set_types(const struct obs_service_info *types, size_t num); +void oracle_service_set_types(const struct obs_service_info *types, size_t num) +{ + /* The lookup only borrows this table; it never writes through the C field. */ + memcpy(&service_find_oracle_storage.service_types.array, &types, sizeof(types)); + service_find_oracle_storage.service_types.num = num; + service_find_oracle_storage.service_types.capacity = num; +} + +static unsigned service_find_calls; +static const char *service_find_name(void *data) +{ + (void)data; + service_find_calls++; + return "unused"; +} +static void *service_find_create(obs_data_t *settings, obs_service_t *service) +{ + (void)settings; + (void)service; + service_find_calls++; + return NULL; +} +static void service_find_destroy(void *data) +{ + (void)data; + service_find_calls++; +} + +typedef const struct obs_service_info *(*service_find_fn)(const char *); +bool oracle_service_find_check(const char *const *ids, size_t num, size_t capacity, const char *query, + service_find_fn rust_find); +bool oracle_service_find_check(const char *const *ids, size_t num, size_t capacity, const char *query, + service_find_fn rust_find) +{ + if (num > capacity || capacity > 8) + return false; + struct obs_service_info entries[8] = {0}; + struct obs_service_info before[8]; + int owners[8] = {0}; + unsigned char saved[sizeof(service_find_oracle_storage)]; + memcpy(saved, &service_find_oracle_storage, sizeof(saved)); + for (size_t i = 0; i < capacity; i++) { + entries[i].id = ids[i]; + entries[i].get_name = service_find_name; + entries[i].create = service_find_create; + entries[i].destroy = service_find_destroy; + entries[i].free_type_data = service_find_destroy; + entries[i].type_data = &owners[i]; + } + oracle_service_set_types(entries, num); + service_find_oracle_storage.service_types.capacity = capacity; + bool ok = true; + /* Repeat after replacing and moving entries: no stale cached result. */ + for (unsigned step = 0; step < 3; step++) { + memcpy(before, entries, sizeof(entries)); + unsigned char core_before[sizeof(service_find_oracle_storage)]; + memcpy(core_before, &service_find_oracle_storage, sizeof(core_before)); + service_find_calls = 0; + const struct obs_service_info *expected = oracle_find_service(query); + const struct obs_service_info *actual = rust_find(query); + ok = ok && actual == expected && service_find_calls == 0 && + memcmp(entries, before, sizeof(entries)) == 0 && + memcmp(core_before, &service_find_oracle_storage, sizeof(core_before)) == 0 && + memcmp(owners, (int[8]){0}, sizeof(owners)) == 0; + if (actual && expected) + ok = ok && actual->id == expected->id && actual->type_data == expected->type_data; + if (num) { + if (step == 0) { + struct obs_service_info swap = entries[0]; + entries[0] = entries[num - 1]; + entries[num - 1] = swap; + } else { + entries[0].id = "replaced"; + } + } + } + memcpy(&service_find_oracle_storage, saved, sizeof(saved)); + return ok; +} diff --git a/rust/obs-c-oracle/oracle/service_getters.c b/rust/obs-c-oracle/oracle/service_getters.c index 114683a59a..716349cd86 100644 --- a/rust/obs-c-oracle/oracle/service_getters.c +++ b/rust/obs-c-oracle/oracle/service_getters.c @@ -1,11 +1,11 @@ /* Test-only oracle: the original libobs/obs-service-getters.c.h, unmodified, * with its exports renamed to oracle_* so it can link next to the Rust - * shims (#1899, #1913, #1920). find_service() and the context accessors are - * test doubles that both sides call. The info-table and plugin-data - * accessors are the Rust port's (#3840), through the real field adapter in - * oracle/service_info_accessors.c, and oracle_service_new() builds the - * struct obs_service both sides read, so the parity tests drive the C and - * the Rust with the same service. */ + * shims (#1899, #1913, #1920). The context accessors are + * test doubles that both sides call; registry lookup uses its real seam. + * The info-table and plugin-data accessors are the Rust port's (#3840), + * through the real field adapter in oracle/service_info_accessors.c. + * oracle_service_new() builds the struct obs_service both sides read, + * so the parity tests drive the C and the Rust with the same service. */ #ifndef _WIN32 #define _GNU_SOURCE #endif @@ -231,25 +231,7 @@ void *oracle_service_control(const obs_service_t *service) return service->context.control; } -/* obs-service.c's find_service() over obs->service_types, here over one - * table the test sets (NULL: no types). */ -static const struct obs_service_info *oracle_types; -static size_t oracle_types_num; - -void oracle_service_set_types(const struct obs_service_info *types, size_t num); -void oracle_service_set_types(const struct obs_service_info *types, size_t num) -{ - oracle_types = types; - oracle_types_num = num; -} - -const struct obs_service_info *find_service(const char *id) -{ - for (size_t i = 0; i < oracle_types_num; i++) - if (strcmp(oracle_types[i].id, id) == 0) - return oracle_types + i; - return NULL; -} +/* Registry setup and lookup now use the real service-find C seam. */ /* The context fields #1913 reads; the plugin data and table are set by * oracle_service_new(). */ diff --git a/rust/obs-output/src/ffi/mod.rs b/rust/obs-output/src/ffi/mod.rs index 64546abaef..d8d6d9d822 100644 --- a/rust/obs-output/src/ffi/mod.rs +++ b/rust/obs-output/src/ffi/mod.rs @@ -82,6 +82,7 @@ mod output_type_lookup; pub mod output_video_checks; pub mod service; pub mod service_context_getters; +pub mod service_find; pub mod service_module_lookup; pub mod service_state; pub mod service_weak_acquire; diff --git a/rust/obs-output/src/ffi/service_find.rs b/rust/obs-output/src/ffi/service_find.rs new file mode 100644 index 0000000000..2feb55c3d6 --- /dev/null +++ b/rust/obs-output/src/ffi/service_find.rs @@ -0,0 +1,27 @@ +//! Private ABI for the service registry lookup. C retains layouts and storage. +use core::ffi::{CStr, c_char, c_void}; + +unsafe extern "C" { + fn obs_service_find_count() -> usize; + fn obs_service_find_entry(index: usize) -> *const c_void; + fn obs_service_find_id(entry: *const c_void) -> *const c_char; +} + +/// Return the first byte-exact match as a borrowed pointer into the live registry. +/// +/// # Safety +/// The core must be initialized. `id` and registered IDs must be valid C strings; +/// the C-owned registry must remain live and unmodified throughout the call. +#[unsafe(no_mangle)] +pub unsafe extern "C" fn find_service(id: *const c_char) -> *const c_void { + // SAFETY: the caller preserves the original C lookup preconditions. Each + // index is below the logical count, and C projects its own native layout. + unsafe { + let entries = (0..obs_service_find_count()).map(|index| { + let entry = obs_service_find_entry(index); + (CStr::from_ptr(obs_service_find_id(entry)).to_bytes(), entry) + }); + crate::service_find::find(CStr::from_ptr(id).to_bytes(), entries) + .unwrap_or(core::ptr::null()) + } +} diff --git a/rust/obs-output/src/service_find.rs b/rust/obs-output/src/service_find.rs index 898c89c83c..fae027a341 100644 --- a/rust/obs-output/src/service_find.rs +++ b/rust/obs-output/src/service_find.rs @@ -2,6 +2,7 @@ /// Walk IDs lazily and return the first matching entry without copying it. pub fn find<'a, T>(id: &[u8], entries: impl IntoIterator) -> Option { - let _ = (id, entries); - todo!("port find_service") + entries + .into_iter() + .find_map(|(entry_id, entry)| (entry_id == id).then_some(entry)) } diff --git a/rust/obs-output/tests/output/main.rs b/rust/obs-output/tests/output/main.rs index ea6dce890f..7c1bd95a0b 100644 --- a/rust/obs-output/tests/output/main.rs +++ b/rust/obs-output/tests/output/main.rs @@ -158,6 +158,7 @@ mod service; mod service_context_getters; mod service_context_getters_parity; mod service_find; +mod service_find_parity; mod service_lifecycle; mod service_lifecycle_parity; mod service_module_lookup; diff --git a/rust/obs-output/tests/output/service_find.rs b/rust/obs-output/tests/output/service_find.rs index 0386d7dc55..e57d467d5e 100644 --- a/rust/obs-output/tests/output/service_find.rs +++ b/rust/obs-output/tests/output/service_find.rs @@ -8,7 +8,12 @@ struct Entry { } fn lookup<'a>(entries: &'a [Entry], count: usize, query: &[u8]) -> Option<&'a Entry> { - find(query, entries[..count].iter().map(|entry| (entry.id.as_slice(), entry))) + find( + query, + entries[..count] + .iter() + .map(|entry| (entry.id.as_slice(), entry)), + ) } #[test] @@ -16,14 +21,38 @@ fn registry_lookup() { for query in [b"".as_slice(), b"missing"] { assert!(lookup(&[], 0, query).is_none()); } - let ids: &[&[u8]] = &[b"svc", b"svc.suffix", b"SVC", b"", b"\xff\x80x", b"svc", b"last", b"outside"]; - let mut entries: Vec<_> = ids.iter().enumerate().map(|(owner, id)| Entry { id: id.to_vec(), owner }).collect(); + let ids: &[&[u8]] = &[ + b"svc", + b"svc.suffix", + b"SVC", + b"", + b"\xff\x80x", + b"svc", + b"last", + b"outside", + ]; + let mut entries: Vec<_> = ids + .iter() + .enumerate() + .map(|(owner, id)| Entry { + id: id.to_vec(), + owner, + }) + .collect(); assert!(lookup(&entries, 0, b"svc").is_none()); let queries: &[(&[u8], Option)] = &[ - (b"svc", Some(0)), (b"sv", None), (b"svc.suffix", Some(1)), - (b"svc.suffix.more", None), (b"SVC", Some(2)), (b"Svc", None), - (b"", Some(3)), (b"\xff\x80x", Some(4)), (b"\xff\x81x", None), - (b"last", Some(6)), (b"outside", None), (b"missing", None), + (b"svc", Some(0)), + (b"sv", None), + (b"svc.suffix", Some(1)), + (b"svc.suffix.more", None), + (b"SVC", Some(2)), + (b"Svc", None), + (b"", Some(3)), + (b"\xff\x80x", Some(4)), + (b"\xff\x81x", None), + (b"last", Some(6)), + (b"outside", None), + (b"missing", None), ]; let before = entries.clone(); for &(query, expected) in queries { @@ -35,9 +64,15 @@ fn registry_lookup() { assert_eq!(entries, before); } entries.swap(0, 5); - assert!(std::ptr::eq(lookup(&entries, 7, b"svc").unwrap(), &entries[0])); + assert!(std::ptr::eq( + lookup(&entries, 7, b"svc").unwrap(), + &entries[0] + )); entries[0].id = b"replaced".to_vec(); - assert!(std::ptr::eq(lookup(&entries, 7, b"svc").unwrap(), &entries[5])); + assert!(std::ptr::eq( + lookup(&entries, 7, b"svc").unwrap(), + &entries[5] + )); assert_eq!(entries[5].id, b"svc"); assert_eq!(entries[0].owner, 5); } @@ -46,10 +81,13 @@ fn registry_lookup() { fn stops_before_reading_later_entries() { let mut reads = 0; let entries = [b"svc".as_slice(), b"svc", b"other"]; - let found = find(b"svc", entries.iter().enumerate().map(|(index, id)| { - reads += 1; - (*id, index) - })); + let found = find( + b"svc", + entries.iter().enumerate().map(|(index, id)| { + reads += 1; + (*id, index) + }), + ); assert_eq!(found, Some(0)); assert_eq!(reads, 1); } diff --git a/rust/obs-output/tests/output/service_find_parity.rs b/rust/obs-output/tests/output/service_find_parity.rs new file mode 100644 index 0000000000..c4615a00ec --- /dev/null +++ b/rust/obs-output/tests/output/service_find_parity.rs @@ -0,0 +1,88 @@ +//! Tier 3: original whole C lookup versus Rust through real private projections. +//! Original initialized-core / valid-C-string domain; no intentional differences. +use core::ffi::{c_char, c_void}; +use obs_output::ffi::service_find::find_service; +use proptest::prelude::*; + +unsafe extern "C" { + fn oracle_service_find_check( + ids: *const *const c_char, + count: usize, + capacity: usize, + query: *const c_char, + rust_find: unsafe extern "C" fn(*const c_char) -> *const c_void, + ) -> bool; +} + +fn check(ids: &[Vec], count: usize, query: &[u8]) { + let ids: Vec<_> = ids + .iter() + .map(|id| std::ffi::CString::new(id.as_slice()).unwrap()) + .collect(); + let pointers: Vec<_> = ids.iter().map(|id| id.as_ptr()).collect(); + let query = std::ffi::CString::new(query).unwrap(); + // SAFETY: bounded arrays and valid C strings live through the call. The C + // fixture owns the real registry layouts; SERVICE_GLOBALS excludes other users. + assert!(unsafe { + oracle_service_find_check( + pointers.as_ptr(), + count, + ids.len(), + query.as_ptr(), + find_service, + ) + }); +} + +#[test] +fn characterized_registry_edges() { + let _lock = super::SERVICE_GLOBALS.lock().unwrap(); + let ids: Vec<_> = [ + b"svc".as_slice(), + b"svc.suffix", + b"SVC", + b"", + b"\xff\x80x", + b"svc", + b"last", + b"outside", + ] + .iter() + .map(|id| id.to_vec()) + .collect(); + for query in [b"".as_slice(), b"missing"] { + check(&[], 0, query); + check(&ids, 0, query); + } + for query in [ + b"svc".as_slice(), + b"sv", + b"svc.suffix", + b"svc.suffix.more", + b"SVC", + b"Svc", + b"", + b"\xff\x80x", + b"\xff\x81x", + b"last", + b"outside", + b"missing", + ] { + check(&ids, 7, query); + } +} + +proptest! { + #![proptest_config(ProptestConfig::with_cases(obs_c_oracle::parity::cases(128)))] + #[test] + fn arbitrary_byte_ids_match_original( + ids in prop::collection::vec(prop::collection::vec(1u8..=255, 0..24), 0..=8), + query in prop::collection::vec(1u8..=255, 0..24), + count_seed in any::(), + ) { + let _lock = super::SERVICE_GLOBALS.lock().unwrap(); + let count = count_seed % (ids.len() + 1); + check(&ids, count, &query); + for id in &ids { check(&ids, count, id); } + } +} diff --git a/test/cmocka/build/test-graph.json b/test/cmocka/build/test-graph.json index e33f14fc50..5d51088832 100644 --- a/test/cmocka/build/test-graph.json +++ b/test/cmocka/build/test-graph.json @@ -16358,6 +16358,27 @@ } ] }, + "test_service_find_rust": { + "sources": [ + "test/cmocka/test_service_find.c", + "test/cmocka/service-find-registry-adapter.c" + ], + "libraries": [ + "libobs_rust-static", + "OBS::libobs", + "OBS::caption", + "Uthash::Uthash", + "OBS::native-test-cmocka", + { + "name": "OBS::w32-pthreads", + "requires": "OS_WINDOWS" + } + ], + "definitions": [ + "SERVICE_FIND_EXTERNAL" + ], + "requires": "HAVE_LIBOBS_RUST_STATIC" + }, "test_service_getters": { "sources": [ "test/cmocka/test_service_getters.c" @@ -29096,6 +29117,13 @@ "${target}" ] }, + "test_service_find_rust": { + "target": "test_service_find_rust", + "command": [ + "${target}" + ], + "requires": "HAVE_LIBOBS_RUST_STATIC" + }, "test_service_getters": { "target": "test_service_getters", "command": [ diff --git a/test/cmocka/service-find-link-support.c b/test/cmocka/service-find-link-support.c index 856030db5d..340096d3f8 100644 --- a/test/cmocka/service-find-link-support.c +++ b/test/cmocka/service-find-link-support.c @@ -1,2 +1,2 @@ -/* The production service registry lookup called by the Rust service implementation. */ -#include "libobs/obs-service-find.c.h" +#include "libobs/build/libobs.pch.h" +#include "libobs/obs-service-find-fields.c.h" diff --git a/test/cmocka/service-find-registry-adapter.c b/test/cmocka/service-find-registry-adapter.c new file mode 100644 index 0000000000..35150fab3d --- /dev/null +++ b/test/cmocka/service-find-registry-adapter.c @@ -0,0 +1,6 @@ +/* Fixture-owned registry, using the actual production field projections. */ +#include "obs-internal.h" +extern struct obs_core *service_find_test_core; +#define obs service_find_test_core +#include "libobs/obs-service-find-fields.c.h" +#undef obs diff --git a/test/cmocka/tests.d/test_service_find_rust.cmake b/test/cmocka/tests.d/test_service_find_rust.cmake new file mode 100644 index 0000000000..d85a840326 --- /dev/null +++ b/test/cmocka/tests.d/test_service_find_rust.cmake @@ -0,0 +1 @@ +# Registered in the canonical native test graph (test/cmocka/build/test-graph.json). From 2130674ee2ed6bf10a45acc6f654c8ac14f332b1 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Fri, 20 Nov 2026 22:31:35 -0800 Subject: [PATCH 3/4] obs-output: guard registry entry before private field projection (Refs #5273) Ci-Attestation: {"at":1795256714,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":311,"stamp":"a91d810bb8fe5ed3b42c10eafcd5c31b","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256714,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":311,"stamp":"fcb2970d6e5ac19e8fec6111b0db6f89","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256714,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":311,"stamp":"52a0e1717e17413d7832cda19213e11e","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256714,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":311,"stamp":"39bf99d29c9897769da84ab39eb8d8e2","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256397,"gate":"general/all/client-lint","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"f9c6724c4e5ce5892e6c619fe526eb7b","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256714,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":311,"stamp":"408a27f08fdb11d811f1485eb111f05a","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256400,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"55f264e31e60adb55d0eba90a5395bfd","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256400,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"d9c45f4d10797285ba3c5cc6d0740885","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256399,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"f8787498fbf7ecf89d8a217e48c82e49","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256399,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"fc0aac68c1960a4d09396ffcc250dcf5","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256398,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"31df44a7a2b8b18a1b32f37a631012d1","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256398,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"b2ad770d3655137c8678f057709eaf9b","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256399,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"a55a4d2fe27f4056445bc58755269760","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256400,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"020c366fe436ce94ac6c6a3e1d5ed10a","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256398,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"d7b74b0b4d05eaaa49fdae61a6041d6a","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256398,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"a9eae19875cb787dc5e8a5cc6b3783c3","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256397,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"8ba0314818678e89d6c77cd388e709b8","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} Ci-Attestation: {"at":1795256397,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"ca98f71368c7d46490a7e59851f05421a805aa809664bdc117086ce30abd45c9","lane":"client-lint","parents":["5183a83dff0c6d6c7bb0572c9226e9e40bd4172c"],"secs":976,"stamp":"2bdd5ba465a3e2933e7ff093cb01cf36","tree":"9d32f56686bacf11dceb6eb3b8f3da25c5eeae0c","v":1,"via":"run"} --- rust/obs-output/src/ffi/service_find.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust/obs-output/src/ffi/service_find.rs b/rust/obs-output/src/ffi/service_find.rs index 2feb55c3d6..e58ca18f09 100644 --- a/rust/obs-output/src/ffi/service_find.rs +++ b/rust/obs-output/src/ffi/service_find.rs @@ -17,9 +17,12 @@ pub unsafe extern "C" fn find_service(id: *const c_char) -> *const c_void { // SAFETY: the caller preserves the original C lookup preconditions. Each // index is below the logical count, and C projects its own native layout. unsafe { - let entries = (0..obs_service_find_count()).map(|index| { + let entries = (0..obs_service_find_count()).filter_map(|index| { let entry = obs_service_find_entry(index); - (CStr::from_ptr(obs_service_find_id(entry)).to_bytes(), entry) + if entry.is_null() { + return None; + } + Some((CStr::from_ptr(obs_service_find_id(entry)).to_bytes(), entry)) }); crate::service_find::find(CStr::from_ptr(id).to_bytes(), entries) .unwrap_or(core::ptr::null()) From f208b51626331069a49e636aad1cf1fec9289f73 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Sat, 21 Nov 2026 02:43:38 -0800 Subject: [PATCH 4/4] test(build): count service-find in private steps fixtures Ci-Attestation: {"at":1795258546,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["32256d8af4f8ac622676c5ad24c415b6e5251351"],"secs":268,"stamp":"4ce2697b028ea6a7d3f373a2a4ad4b98","tree":"fec610e752c68d9cb7049e7a55389f1a26a0e408","v":1,"via":"run"} Ci-Attestation: {"at":1795258546,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["32256d8af4f8ac622676c5ad24c415b6e5251351"],"secs":268,"stamp":"65fa4894ca8d458befe0d3f1664e3c4e","tree":"fec610e752c68d9cb7049e7a55389f1a26a0e408","v":1,"via":"run"} Ci-Attestation: {"at":1795258546,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["32256d8af4f8ac622676c5ad24c415b6e5251351"],"secs":268,"stamp":"add43cc5466e3242b8e0e79e0fc11dfb","tree":"fec610e752c68d9cb7049e7a55389f1a26a0e408","v":1,"via":"run"} Ci-Attestation: {"at":1795258546,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["32256d8af4f8ac622676c5ad24c415b6e5251351"],"secs":268,"stamp":"97cf85cac8d9672cca7d4fd3c27fd7de","tree":"fec610e752c68d9cb7049e7a55389f1a26a0e408","v":1,"via":"run"} Ci-Attestation: {"at":1795601079,"gate":"general/all/client-lint","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"3353813a2f1be1f82680a1c18841eb0b","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795258546,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["32256d8af4f8ac622676c5ad24c415b6e5251351"],"secs":268,"stamp":"da7a42975896a5646855b094335e5044","tree":"fec610e752c68d9cb7049e7a55389f1a26a0e408","v":1,"via":"run"} Ci-Attestation: {"at":1795601080,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"468ebdf780bff6a38c63bf33ce6ed849","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601080,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"a8494b6514358e35050a436db619af21","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601079,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"467c69740232b051ba6caaf1165b8a00","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601080,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"ccbe07e6071dc8c0b3ab7894dcb50a44","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601079,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"9d6de65888bf5eaf7720905dcde86035","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601079,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"cdf166517ade8bc68774c17648b982a4","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601080,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"388f4c9a846b836a14d10d6b419e319e","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601080,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"209c42eb5ea17669e2131a3e7656bf20","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601079,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"499b48f834679c27910a1cec7421ecfe","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601079,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"30c9084b8dbc5dd2d33ec9c488f5b095","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601079,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"278391a13bf6655cdcab6c02fe4e1f0c","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} Ci-Attestation: {"at":1795601079,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"ecd8ec9a07a52bebbb394b03e982865295e49c8ec6440d0a4f1cc07b049a632a","lane":"client-lint","parents":["2130674ee2ed6bf10a45acc6f654c8ac14f332b1"],"secs":357,"stamp":"748e95b0e1696d6fd92fa94bc2f2bf75","tree":"3783ab6d05469f48bf1b644c0c5d341c995d100b","v":1,"via":"run"} --- .../canonical_rust_static_private_steps_are_registered.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/obs-build/tests/native/registration/canonical_rust_static_private_steps_are_registered.rs b/rust/obs-build/tests/native/registration/canonical_rust_static_private_steps_are_registered.rs index 40c835ed82..9afedb51fb 100644 --- a/rust/obs-build/tests/native/registration/canonical_rust_static_private_steps_are_registered.rs +++ b/rust/obs-build/tests/native/registration/canonical_rust_static_private_steps_are_registered.rs @@ -8,7 +8,7 @@ static CASES: std::sync::LazyLock> = #[test] fn canonical_rust_static_private_steps_are_registered() { let graph = rust_static_entries::assert_family(FAMILY); - assert_eq!(CASES.len(), 8); + assert_eq!(CASES.len(), 9); for windows in [false, true] { for msvc in [false, true] { for available in [false, true] { @@ -19,8 +19,8 @@ fn canonical_rust_static_private_steps_are_registered() { ] .into(); let selected = graph.select(&facts).unwrap(); - assert_eq!(selected.targets.len(), if available { 8 } else { 0 }); - assert_eq!(selected.tests.len(), if available { 8 } else { 0 }); + assert_eq!(selected.targets.len(), if available { 9 } else { 0 }); + assert_eq!(selected.tests.len(), if available { 9 } else { 0 }); } } }