-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: remove the use of CARGO_RUSTC_CURRENT_DIR
#14869
Conversation
.cargo/config.toml
Outdated
[env] | ||
# HACK: Until this is stabilized, `snapbox`s polyfill could get confused | ||
# inside of the rust-lang/rust repo because it looks for the furthest-away `Cargo.toml` | ||
CARGO_RUSTC_CURRENT_DIR = { value = "", relative = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We likely still want this for snapbox which reads CARGO_RUSTC_CURRENT_DIR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested SNAPSHOTS=overwrite
to update inline snapshots for some tests in
- tests/build-std/main.rs
- tests/testsuite/rename_deps.rs
- crates/cargo-util-schemas/src/manifest/rust_version.rs
And they are all working.
I assume we don't really need that except for people working on Cargo from rust-lang/rust repo. I can keep it there if this is what we want to support.
Snapbox also uses |
Do we know why this doesn't work for bootstrap but it works for everything else? Are they running our tests outside of our repo, making it so the config isn't loaded? Could that change? |
I believe that is because bootstrap invokes cargo with |
fcbf790
to
17b642f
Compare
☔ The latest upstream changes (presumably 3908f64) made this pull request unmergeable. Please resolve the merge conflicts. |
The environment variable has been removed in rust-lang#14799. Switch to plain old `CARGO_MANIFEST_DIR` because snapbox's `current_rs` favors furthest Cargo.toml, blocking tests running in rust-lang/rust as a submodule. See also build failures in rust-lang/rust#133533
17b642f
to
da846c6
Compare
It might be possible to change, but that requires bootstrap team's involvement. I would suggest we unblock this first, and then discuss with other folks for any further refactors. |
Suggest a patch to that PR: rust-lang/rust#133533 (comment). |
Close as this patch works. |
What does this PR try to resolve?
The environment variable has been removed in #14799.
Switch to plain old
CARGO_MANIFEST_DIR
because snapbox's
current_rs
favors furthest Cargo.toml,blocking tests running in rust-lang/rust as a submodule.
See also build failures in rust-lang/rust#133533
How should we test and review this PR?
Pull this change into rust-lang/rust and run