Crater run for cargo build-dir changes#149852
Conversation
|
Some changes occurred in src/tools/cargo cc @ehuss |
This comment has been minimized.
This comment has been minimized.
|
Do you happen to know the crater command you want to run? (The command syntax is documented at https://github.com/rust-lang/crater/blob/master/docs/bot-usage.md) |
|
Let's do @bors try |
This comment has been minimized.
This comment has been minimized.
…, r=<try> Crater run for cargo build-dir changes
|
@Kivooeo IIUC, that's not going to be sufficient for this because the new layout is not enabled by default. There may be some special settings like environment variables that will be needed to test this properly. And as for the mode, I suspect we want to build, not check, because we'll want to see if build scripts or proc-macros are doing any shenanigans that are required for linking correctly. (Or maybe |
|
For this, you can either set Note that I guess A full |
|
@craterbot run mode=build-and-test start=master#198328ad7960b1bece0dc48496bff6c62dd5d339 end=try#311784882baa42a9638298cb325fa01a062c9d0f+cargoflags=-Zbuild-dir-new-layout crates=random-1000 p=1 Small run just to make sure it mostly works. |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
☔ The latest upstream changes (presumably #149934) made this pull request unmergeable. Please resolve the merge conflicts. |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
Footnotes
|
|
Example from https://github.com/ikorason/headr at 7f4ae60bfd5efd605d9a7e2572ba482b3ac02551
Example from chute-kun 0.1.0
|
This also makes artifact deps available for consistency purposes. I originally proposed this for when moving Cargo off of Cargo's own internals but went with a different solution. Re-visiting this because `assert_cmd` has 2300+ dependents and it seems like making `assert_cmd::cargo_bin` work would be a better use of time than migrating all of those users to `assert_cmd::cargo_bin!`. For example, within the top 130 dependents (100,000 downloads or more), I found 66 that used `assert_cmd::cargo_bin` (rust-lang/rust#149852). > The reason to make `CARGO_BIN_EXE` set only at build-time was to > address the concern of manually running the test executable. > It's not > too common for tests to look at any runtime environment variables > (that I know of), so it usually just works (like running > `gdb target/debug/.../test-xxx`). > The concern was that if it were set at > runtime it would move more down the path where directly running the test > executable doesn't "just work". See https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/cargo_bin_exe.20and.20tests/near/513638220 However, - This is user opt-in - Users can run with `-vv` to see the env variables that are set - Users can run `CARGO_TARGET_..._RUNNER=gdb` - We can notify the `cargo nextest`, the main third-party test runner, about this. It should be easy to support as they have their own version of this, see https://nexte.st/docs/configuration/env-vars/?h=nextest_bin_exe#environment-variables-nextest-sets
|
Realized a better route for this might be to move forward with making First step is rust-lang/cargo#16421 |
Unless I'm mistaken it already does that.
Footnotes |
That is a bug and it always falls back to the |
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/cargo/pull/16807)* ### What does this PR try to resolve? [FCP](rust-lang#16807 (comment)) This PR stabilizes the `build-dir` reorg tracked in rust-lang#15010 We have completed a crater runs (rust-lang/rust#149852) as well a call for testing (https://blog.rust-lang.org/2026/03/13/call-for-testing-build-dir-layout-v2/) with no issues reported. At a recent Cargo meeting, we discussed the path towards stabilization: * Stabilize `build-dir` layout v2, and merge into nightly shortly after the 1.96 beta branch * Allow a full nightly cycle for nightly users to report issues. * Pending no major blockers, allow the stabilization to be included in the Rust 1.97 beta (otherwise revert before beta branching) This stabilization does NOT remove the code for the legacy `build-dir` layout and enables `-Zbuild-dir-new-layout` by default. We also provide a temporary `__CARGO_TEMPORARY_BUILD_DIR_NEW_LAYOUT_OPT_OUT` env var that users can use to opt out. Note that this flag is temporary and only meant to mitigate the transition. It will be removed in the next release along with the legacy layout code. The rational for this approach is that we may need to rollback the changes before the next stabilization and removing the feature flag would be a lot of changes that could result in a conflict. Keeping the feature flag minimizes the code changes needed to stabilize and makes it less risky if we need to revert. The opt out flag is to provide a short term way for users opt if. This is primarily intended for users that absolutely must use nightly and rely on tools that expect the old layout. closes rust-lang#15010 Flag/opt out priority: (highest to lowest) * `-Zfine-grain-locking` (will always force enable the new layout) * `__CARGO_TEMPORARY_BUILD_DIR_NEW_LAYOUT_OPT_OUT=1` * `-Zbuild-dir-new-layout` (this will exist on nightly but be enabled by default) Note on the locking design: We will defer changing `.cargo-artifact-lock` to `.cargo-lock` to reduce the scope of this PR. See rust-lang#16807 (comment) for the rational for why this is safe to do and forward compatible ### Pending tasks - [x] Finish update tests - [x] Update Cargo docs - [x] Rustc bootstrap is blocking this PR [#t-infra/bootstrap > Has anyone tested &rust-lang#96;./x&rust-lang#96; with the new build-dir layout?](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Has.20anyone.20tested.20.60.2E.2Fx.60.20with.20the.20new.20build-dir.20layout.3F/with/581660716) rust-lang/rust#155439 ### How to test and review this PR? There are a LOT of changes and I did my best to separate them into isolated commits. However the stabilization commit has a lot of path updates in many tests.
View all comments
PR for crater run of rust-lang/cargo#16336
Before running, we should probably get a sanity check from @epage that there is nothing I missed.
See Zulip Thread
r? @Mark-Simulacrum