-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Bootstrap regression in 1.71.0 #114338
Comments
This is a stripped down version of the build script in use, which was unchanged between 1.70.0 and 1.71.0: #!/bin/bash
# Fail when commands exit unsuccesfully.
set -o errexit
# Fail when using an undefined variable.
set -o nounset
# Fail if commands fail as part of a pipeline.
set -o pipefail
echo "Discovering build and source directory..."
RUST_CONFIGURE_ARGS=(
# https://github.com/rust-lang/rust/blob/934624fe5f66ce3fb8abf0597a6deb079783335f/src/ci/run.sh#L50
--disable-manage-submodules
--enable-locked-deps
--enable-cargo-native-static
--set rust.codegen-units-std=1
--set rust.remap-debuginfo
--debuginfo-level-std=1
# don't spend time _also_ building .gz files
--dist-compression-formats=xz
# avoid taking a runtime dependency on libstdc++
--enable-llvm-static-stdcpp
# disallow nightly features
--release-channel=stable
# don't access the internet to get dependencies
--enable-vendor
--local-rust-root "$BOOTSTRAP_INSTALL_DIR"
# we're building with the same version of the compiler, so speed up a bit
--enable-local-rebuild
# https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile#L94
# note that full-tools implies --extended
--enable-full-tools
--enable-sanitizers
--enable-profiler
# don't spend time generating docs, since those won't be patched
--disable-docs
--set llvm.thin-lto=true
--set rust.jemalloc
# limit the number of concurrent link jobs to avoid build host OOMs
--set llvm.link-jobs=3
# install to build/
--prefix "$INSTALL_DIR"
# and stick configuration under there too (note the relative path)
--sysconfdir "etc"
# we also need to make sure `--remap-path-prefix` is passed to rustc and
# llvm builds to avoid the absolute builder path from ending up in the
# final artifact. If we don't do this, re-builds of the exact same Rust
# version generates different binaries entirely unnecessarily (i.e., when
# there are no source-level differences). We also do it so that the paths
# in the debug symbols in our binaries match those in the upstream release
# artifacts, namely /rustc/<git commit of release>, which other tooling
# might depend on.
--set rust.remap-debuginfo=true
--tools "cargo,clippy,rustfmt,llvm-tools,src,rustdoc,rust-analyzer-proc-macro-srv"
--build "$targetTriple"
--target "$targetTriple"
)
./configure "${RUST_CONFIGURE_ARGS[@]}"
echo "Patching out unneeded build targets..."
sed -i.bkp \
-e '/dist::RustDev,/d' \
-e '/dist::Extended,/d' \
src/bootstrap/builder.rs
echo "Make build scripts respect LDFLAGS during bootstrap..."
mkdir -p .cargo
cat > .cargo/config <<EOF
target-applies-to-host = false
[host]
rustflags=["-Clink-args=$LDFLAGS"]
# include the vendor source replacement that x.py would normally generate with
# ./configure --enable-vendor:
[source.crates-io]
replace-with = 'vendored-sources'
registry = 'https://example.com'
[source.vendored-sources]
directory = '$PWD/vendor'
EOF
echo "Running rust build..."
python x.py dist
echo "Installing build artifacts..."
python x.py install
echo "Exporting rustup artifacts..."
ls -l build/dist/
mkdir -p "$BUILD_DIR"/rustup
cp -r build/dist/* "$BUILD_DIR"/rustup |
What is bug? We are not blindly copying the entire sysroot. I'm not sure if I understand the problem. Are we supposed to find these binaries in tarballs too, or is it something else? |
Did some investigating. Just running
Now running with
|
If I look at the bins that are part of
rustc
's tarball in 1.70.0 I see this:But when I built Rust again in 1.71.0, and inspected the produced artifacts, I see:
The difference being that
cargo-fmt
,rustfmt
,cargo-clippy
, andclippy-driver
are now included.I tracked this change down to this commit: 6d99d6a, which was a part of #110365 by @ozkanonur.
I validated my claim by applying this patch to Rust's source:
And upon re-building, inspecting the tarball again:
I spoke with @jyn514, who said:
One thing that isn't clear to me is why do the officially produced artifacts served through
static.rust-lang.org
not suffer from this:The text was updated successfully, but these errors were encountered: