Problem
Build scripts fail to run with new build dir layout when __CARGO_DEFAULT_LIB_METADATA is set
This is a recent regression, probably introduced by #16812.
Steps
- Set up a project with a
libc dependency (or anything else that needs a build script)
- Run
CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT=true __CARGO_DEFAULT_LIB_METADATA=foo cargo build
Expected behavior: A successful build.
Actual behavior:
error: failed to run custom build command for `getrandom v0.4.2`
Caused by:
could not execute process `/home/r/src/rust/lib-crates/rustc-build-sysroot/target/debug/build/getrandom/0b53632d37620753/out/build_script_build` (never executed)
Caused by:
No such file or directory (os error 2)
I'm aware that __CARGO_DEFAULT_LIB_METADATA is internal and unstable, but it is used for the sysroot build, so this causes cargo-based sysroot builds to break. Rustc bootstrap doesn't use the new build dir layout yet so it is not affected at this time, but Miri (which uses https://github.com/RalfJung/rustc-build-sysroot/) is affected when CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT is set.
Possible Solution(s)
No response
Notes
No response
Version
Problem
Build scripts fail to run with new build dir layout when
__CARGO_DEFAULT_LIB_METADATAis setThis is a recent regression, probably introduced by #16812.
Steps
libcdependency (or anything else that needs a build script)CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT=true __CARGO_DEFAULT_LIB_METADATA=foo cargo buildExpected behavior: A successful build.
Actual behavior:
I'm aware that
__CARGO_DEFAULT_LIB_METADATAis internal and unstable, but it is used for the sysroot build, so this causes cargo-based sysroot builds to break. Rustc bootstrap doesn't use the new build dir layout yet so it is not affected at this time, but Miri (which uses https://github.com/RalfJung/rustc-build-sysroot/) is affected whenCARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUTis set.Possible Solution(s)
No response
Notes
No response
Version