tests: delegate cargo_affected_stripped to the shared cargo_affected_with_env - #99
Merged
Merged
Conversation
This was referenced Aug 29, 2026
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.
Surfaced by the nightly survey of
tests/functional/lib_bin_collision.rs.cargo_affected_strippedis defined twice — inlib_bin_collision.rsandduplicate_target_names.rs— with byte-identical bodies, and both hand-roll the process spawn thatcargo_affected_with_envinmain.rsalready provides. That helper exists for exactly this case;tests/CLAUDE.mdlists it as the one "for scenarios that need to influence the build, e.g.RUSTFLAGS", andremapped_paths.rsuses it that way.Each
cargo_affected_strippedbecomes a one-line delegation. The wrapper itself stays, because the name carries the scenario's intent (-C debuginfo=0) at every call site, and its doc comment is where each file explains why it strips debuginfo — a reason that differs between the two scenarios.No behavior change:
cargo_affected_with_envbuilds the same command from the sameCARGO_BIN_EXE_cargo-affectedpath, sets the same env, and panics with the same message. Call sites and assertions are untouched, so no new test — the existing scenarios are the coverage, and CI exercises them (.github/workflows/ci.yamlinstallsllvm-toolsandcargo-nextestbeforecargo test).cargo fmt --checkandcargo clippy --all-targetsare clean, and the suite compiles. The two scenarios themselves can't run in the agent sandbox — they fail withcargo-affected requires cargo-nextest >= 0.9.116, the missing-tooling gap #96 addresses — so CI is what actually gates this one.Deliberately kept off the doc-comment lines that #31 and #63 rewrite, so this should merge cleanly alongside either.