Skip to content
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

Rustbuild: Building stage0 with system installed rust with rustlib in /usr/lib64 fails #51698

Closed
aclemons opened this issue Jun 22, 2018 · 2 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@aclemons
Copy link

I initially built rust version 1.19.0 from source using the downloaded stage0 snapshot compiler and have been building each successive version with the previous version with this config.toml:

[build]
build = "x86_64-unknown-linux-gnu"
host = ["x86_64-unknown-linux-gnu"]
target = ["x86_64-unknown-linux-gnu"]
full-bootstrap = false
submodules = false
vendor = true
extended = true
rustc = "/usr/bin/rustc"
cargo = "/usr/bin/cargo"

[install]
prefix = "/usr"
docdir = "doc/rust"
libdir = "lib64"
mandir = "man"

[rust]
codegen-units = 0
channel = "stable"
rpath = true
codegen-tests = false
ignore-git = true

(The 1.19.0 config.toml did not include rustc/cargo configs)

This worked fine until rust 1.26.x. This now breaks building stage0 (further details below).

Environment:
Slackware64 14.2

It does not break on Slackware 14.2 (32bit) using libdir = "lib" in the config.toml.

After some research, I've found a workaround.

In the file src/bootstrap/builder.rs, fn sysroot_libdir always sets the libdir to Path::new("lib") for stage0. This is fine for the case of building with the downloaded stage0, but not for the case of using the system rustc with rustlib in /usr/lib64.

After I changed the source to use lib64 when building on x86_64, I could finally build 1.26.x successfully.

Meta

rustc --version --verbose:

rustc 1.25.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.25.0
LLVM version: 6.0

Backtrace:

[...]
Dist docs (x86_64-unknown-linux-gnu)
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling cc v1.0.9
   Compiling build_helper v0.1.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/build_helper)
   Compiling core v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/libcore)
   Compiling unwind v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/libunwind)
   Compiling std v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/libstd)
   Compiling cmake v0.1.29
   Compiling compiler_builtins v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/rustc/compiler_builtins_shim)
   Compiling alloc_jemalloc v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/liballoc_jemalloc)
   Compiling rustc_tsan v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/librustc_tsan)
   Compiling rustc_asan v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/librustc_asan)
   Compiling rustc_msan v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/librustc_msan)
   Compiling rustc_lsan v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/librustc_lsan)
   Compiling std_unicode v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/libstd_unicode)
   Compiling libc v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/rustc/libc_shim)
   Compiling alloc v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/liballoc)
   Compiling panic_abort v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/libpanic_abort)
   Compiling alloc_system v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/liballoc_system)
   Compiling panic_unwind v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/libpanic_unwind)
    Finished release [optimized] target(s) in 49.9 secs
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling term v0.0.0 (file:///home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/libterm)
   Compiling getopts v0.2.15
error[E0463]: can't find crate for `std`
error: aborting due to previous error
error: Could not compile `term`.
Caused by:
  process didn't exit successfully: `/home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/build/bootstrap/debug/rustc --crate-name term libterm/lib.rs --error-format json --crate-type dylib --crate-type rlib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=2548365409e71e93 -C extra-filename=-2548365409e71e93 --out-dir /home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/build/x86_64-unknown-linux-gnu/stage0-test/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/build/x86_64-unknown-linux-gnu/stage0-test/x86_64-unknown-linux-gnu/release/deps -L dependency=/home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/build/x86_64-unknown-linux-gnu/stage0-test/release/deps` (exit code: 101)
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
error: aborting due to previous error
error: Could not compile `getopts`.
Caused by:
  process didn't exit successfully: `/home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/build/bootstrap/debug/rustc --crate-name getopts vendor/getopts/src/lib.rs --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=1df97bed08af6795 -C extra-filename=-1df97bed08af6795 --out-dir /home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/build/x86_64-unknown-linux-gnu/stage0-test/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/build/x86_64-unknown-linux-gnu/stage0-test/x86_64-unknown-linux-gnu/release/deps -L dependency=/home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/build/x86_64-unknown-linux-gnu/stage0-test/release/deps --cap-lints allow` (exit code: 101)
command did not execute successfully: "/usr/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "10" "--release" "--frozen" "--manifest-path" "/home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/src/libtest/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1064:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: /home/acl/slack-rust-bootstrap/rust/tmp/rustc-1.26.2-src/build/bootstrap/debug/bootstrap dist
Build completed unsuccessfully in 0:01:38
aclemons added a commit to aclemons/slackbuilds.org that referenced this issue Jun 22, 2018
This took longer than expected to get sorted out on my side. Building
1.26.2 from 1.25.0 on x86_64 was failing. I finally managed to track
down a workaround and have added a patch for that.

rust-lang/rust#51698

Signed-off-by: Andrew Clemons <[email protected]>
aclemons added a commit to aclemons/slack-rust-bootstrap that referenced this issue Jun 22, 2018
@aclemons
Copy link
Author

Also confirmed that 1.25.0 cannot rebuild itself (building 1.25.0 again with a system installed 1.25.0). It fails with the same error. 1.24.1 can so it seems the change was added during the 1.25 cycle.

aclemons added a commit to aclemons/slackbuilds.org that referenced this issue Jun 22, 2018
This took longer than expected to get sorted out on my side. Building
1.26.2 from 1.25.0 on x86_64 was failing. I finally managed to track
down a workaround and have added a patch for that.

rust-lang/rust#51698

Signed-off-by: Andrew Clemons <[email protected]>
willysr pushed a commit to SlackBuildsOrg/slackbuilds that referenced this issue Jun 23, 2018
This took longer than expected to get sorted out on my side. Building
1.26.2 from 1.25.0 on x86_64 was failing. I finally managed to track
down a workaround and have added a patch for that.

rust-lang/rust#51698

Signed-off-by: Andrew Clemons <[email protected]>
aclemons added a commit to aclemons/slack-rust-bootstrap that referenced this issue Jul 15, 2018
@jonas-schievink jonas-schievink added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jan 27, 2019
@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

I think this has since been fixed; we aren't planning to backport patches to 1.25 at this late date.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants