Repository navigation
build: Generate the port_comparison unit list from the directory (#1997) - #2554
Merged
Merged
Conversation
…1997) RED: the ci test demanded the hand-kept `#[path] mod` lines and the `modules![...]` call in `port_comparison.rs` stay sorted. It now fails if either list exists and requires the two generated includes instead. `uv run -m unittest discover -s ci -p test_sorted_shared_lists.py`: test_port_comparison_units_are_discovered FAILs, assertNotRegex matched `#[path = "port_comparison/audio.rs"]`.
GREEN: build.rs enumerates benches/port_comparison/*.rs and writes the #[path] module lines and the run_units() call list into OUT_DIR, so a port adds its own file and edits nothing shared. That was the last hand-kept list every port appended to; two ports on one file collided in the merge queue (#1922 vs #1928, #1929 vs #1922). The file stem is the module name, so core.rs becomes core_units.rs (a `mod core` at the crate root would make the units' `use core::ffi` paths ambiguous). Absolute #[path] rather than `mod x { include!() }` because the units open with //! inner docs, which include! cannot carry. Verified: `soldr cargo check -p obs-c-oracle --benches` is clean, and a throwaway zzz_probe.rs appeared in the generated run_units() and compiled with no edit to a shared file. ci/test_sorted_shared_lists.py passes.
Member
Author
|
Handed off to the coordinator. Green now that the macOS/Windows lanes finished: 11 checks pass, the rest skip by path scope, base |
5 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1997 (part 2, after #2552).
rust/obs-c-oracle/benches/port_comparison.rscarried the last two hand-kept lists every port appended to: the#[path] modlines and themodules![...]call. #1922 vs #1928 and #1929 vs #1922 collided on them.build.rsnow enumeratesbenches/port_comparison/*.rsand writes the module lines and arun_units()call list intoOUT_DIR, so a port adds one file and edits nothing shared.RED
e62e9115creplaces the sortedness assertions for that file inci/test_sorted_shared_lists.pywith the discovery contract: no#[path] modlist, nomodules![, both generated includes present,build.rsenumerates the directory, and every file in the directory definesbenchmarks().GREEN
d6031c188:build.rsgeneratesport_comparison_modules.rsandport_comparison_units.rs, and reruns when the directory changes.core.rsbecomescore_units.rs: amod coreat the crate root would make the units'use core::ffi::...paths ambiguous.#[path]rather thanmod x { include!(..) }, because the units open with//!inner docs, whichinclude!cannot carry.Verified
soldr cargo check -p obs-c-oracle --benches: clean.zzz_probe.rswas picked up asmodule(criterion, "zzz_probe", zzz_probe::benchmarks);and compiled with no edit to a shared file, then removed.uv run -m unittest discover -s ci -p test_sorted_shared_lists.pypasses (5 tests).Tiers
Not applicable: this moves build-side registration, not C behavior. No Rust unit, Tier 2 cmocka, Tier 3 differential or Tier 4 protocol surface changes; the bench fixtures and their assertions are untouched.
./lintreaches one pre-existing failure intest_macos_browser_helpers.pyfrom this checkout's modifiedplugins/obs-browsersubmodule pointer, which is excluded from the diff. CI is the merge gate.