Repository navigation
The dev-build guard recognises the test binaries Rust 1.100's cargo builds - #219
Open
DrewBradfordXYZ wants to merge 1 commit into
Open
DrewBradfordXYZ wants to merge 1 commit into
DrewBradfordXYZ wants to merge 1 commit into
Conversation
…uilds Since Rust 1.100, cargo runs test binaries from its build-dir layout, <target>/debug/build/<package>/<hash>/out/, not <target>/debug/deps/. dev_build() looked only at the binary's own folder (or the one above deps/), so under 1.100 the nebula binary's tests no longer looked like a cargo build and dev_builds_are_refused_without_force failed. CI on every PR went red the day the runners picked 1.100.0 up. The path rule is now a pure function, in_cargo_target, which also accepts the out/ ← <hash> ← <package> ← build/ ← <profile> chain. A new test feeds it each layout and a few paths it must refuse, so it no longer depends on which cargo runs it. What `nebula upgrade` refuses is unchanged: a binary in <target>/release or <target>/debug. Checked: cargo +1.100.0 fmt --check, clippy -D warnings and test --workspace (1,938 passed) are clean, and the upgrade tests pass on 1.97.1 too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
CI has been red on every PR since the runners picked up Rust 1.100.0 (
stable-x86_64-unknown-linux-gnu updated - rustc 1.100.0 (from rustc 1.99.1)):upgrade::tests::dev_builds_are_refused_without_forcefails with "test binary should look like a cargo build". It passed on 1.99.1 at the same commit (#216's run on Nov 11).Why
Since 1.100, cargo runs test binaries from its build-dir layout:
dev_build()only looked at the binary's own folder, or the one abovedeps/, so the test binary stopped looking like a cargo build. Binaries fromcargo buildstill land intarget/release/, sonebula upgradeitself was never affected; only the test broke.What
in_cargo_target, that accepts all three places: directly in a profile dir, in itsdeps/, and the<profile>/build/<package>/<hash>/out/chain.cargo_target_dirs_are_recognised, feeds it each layout plus paths it must refuse (~/.cargo/bin/nebula,/usr/local/bin/nebula, an unrelatedout/dir, a build script). It passes whichever cargo runs it.nebula upgraderefuses is unchanged.Checked
cargo +1.100.0 fmt --check,clippy --workspace --all-targets -- -D warningsandtest --workspace(1,938 passed, 0 failed) are clean on macOS, and the upgrade tests also pass on 1.97.1.