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

cross build regression in 1.83+ #135796

Closed
Fabian-Gruenbichler opened this issue Jan 20, 2025 · 2 comments
Closed

cross build regression in 1.83+ #135796

Fabian-Gruenbichler opened this issue Jan 20, 2025 · 2 comments
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Fabian-Gruenbichler
Copy link
Contributor

Summary

Since 1.83, cross-building in Debian is broken because of the check/invocation introduced by #130899 (68034f8 to be exact).

Command used

on an amd64/x86_64 host:

python3 src/bootstrap/bootstrap.py -j 8 build --stage 2 --config config.toml --on-fail env --target aarch64-unknown-linux-gnu 

Expected behaviour

up to 1.82, cross building worked.

Actual behaviour

since 1.83, the newly introduced rustc invocation fails, since it doesn't seem to set the right LD_LIBRARY_PATH:

      < Std { target: aarch64-unknown-linux-gnu, compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: false }
      c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu } }
      > Rustc { target: aarch64-unknown-linux-gnu, compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu }, crates: [] }
        c Std { target: aarch64-unknown-linux-gnu, compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: false }
        c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu } }
        c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu } }
        c Std { target: x86_64-unknown-linux-gnu, compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu }, crates: [], force_recompile: false, extra_rust_args: [], is_for_mir_opt_tests: false }
        c Libdir { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu }, target: x86_64-unknown-linux-gnu }
        c Sysroot { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu }, force_recompile: false }
        c Sysroot { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu }, force_recompile: false }
using sysroot /<<PKGBUILDDIR>>/build/x86_64-unknown-linux-gnu/stage1
        c Sysroot { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu }, force_recompile: false }
running: "/<<PKGBUILDDIR>>/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "--target" "aarch64-unknown-linux-gnu" "--print=file-names" "--crate-type=proc-macro" "-" (failure_mode=Exit) (created at src/core/builder.rs:1688:33, executed at src/core/builder.rs:1694:26)

Command "/<<PKGBUILDDIR>>/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "--target" "aarch64-unknown-linux-gnu" "--print=file-names" "--crate-type=proc-macro" "-" (failure_mode=Exit) did not execute successfully.
Expected success, got exit status: 127
Created at: src/core/builder.rs:1688:33
Executed at: src/core/builder.rs:1694:26

STDOUT ----


STDERR ----
/<<PKGBUILDDIR>>/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-3099989dab198f47.so: cannot open shared object file: No such file or directory

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/src/bootstrap/bootstrap.py", line 1226, in <module>
    main()
  File "/<<PKGBUILDDIR>>/src/bootstrap/bootstrap.py", line 1211, in main
    bootstrap(args)
  File "/<<PKGBUILDDIR>>/src/bootstrap/bootstrap.py", line 1187, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/<<PKGBUILDDIR>>/src/bootstrap/bootstrap.py", line 202, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /<<PKGBUILDDIR>>/build/bootstrap/debug/bootstrap -j 1 build --stage 2 --config debian/config.toml --on-fail env

the mentioned librustc_driver-3099989dab198f47.so exists in stage1/lib, setting LD_LIBRARY_PATH and repeating the rustc invocation doesn't fail, manually repeating it without setting LD_LIBRARY_PATH does and gives the same error.

Bootstrap configuration (config.toml)

somewhat reduced from the actual config used during a Debian package build (this is the one I used to bisect/reproduce the issue from git):

change-id = 133207

[build]
submodules = true
locked-deps = false
verbose = 2
profiler = false

build = "x86_64-unknown-linux-gnu"
host = ["aarch64-unknown-linux-gnu"]
target = ["aarch64-unknown-linux-gnu"]

docs = true

extended = true
tools = [
  "cargo",
  "clippy",
  "rust-analyzer",
  "rust-analyzer-proc-macro-srv",
  "rustdoc",
  "rustfmt",
  "wasm-component-ld",
]

# we use pre-built LLVM, so can't optimize compiler-rt
optimized-compiler-builtins = false

[install]
prefix = "/usr"

[target.x86_64-unknown-linux-gnu]
llvm-config = "/usr/lib/llvm-19/bin/llvm-config"
linker = "x86_64-linux-gnu-gcc"
profiler = "/usr/lib/llvm-19/lib/clang/19/lib/linux/libclang_rt.profile-aarch64.a"

[target.aarch64-unknown-linux-gnu]
llvm-config = "/usr/lib/llvm-19/bin/llvm-config"
linker = "aarch64-linux-gnu-gcc"
profiler = "/usr/lib/llvm-19/lib/clang/19/lib/linux/libclang_rt.profile-aarch64.a"

[llvm]
link-shared = true
download-ci-llvm = false

[rust]
download-rustc = false
jemalloc = false
optimize = true
dist-src = false

channel = "stable"

debuginfo-level = 2
debuginfo-level-std = 2
rpath = false
remap-debuginfo = true

omit-git-hash = true
verbose-tests = true
backtrace-on-ice = true

deny-warnings = false

Operating system

Debian unstable (sid) with rustc 1.84.0 as packaged, but see above

HEAD

Additional context

while the problem surfaced as part of the (modified) Debian package build, it is reproducible using the config and command given above on a stock git clone.

Build Log

too long

master.log

@Fabian-Gruenbichler Fabian-Gruenbichler added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 20, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 20, 2025
@thesamesam
Copy link

See #133629.

@Fabian-Gruenbichler
Copy link
Contributor Author

thanks! somehow my search came up empty - will close this in favor of the other one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. 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

4 participants