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

rust-1.86.0_beta fails to compile in offline mode #137485

Closed
stefson opened this issue Feb 23, 2025 · 7 comments
Closed

rust-1.86.0_beta fails to compile in offline mode #137485

stefson opened this issue Feb 23, 2025 · 7 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

@stefson
Copy link

stefson commented Feb 23, 2025

hey everyone,

I just downloaded the rust-1.86.0_beta tarball, unpacked it and compiled it.

Sadly, the build fails to compile with this error:

running: cd "/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src" && CARGO="/usr/lib/rust/1.85.0/bin/cargo" DEST="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/COPYRIGHT.html" DEST_LIBSTD="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/COPYRIGHT-library.html" LD_LIBRARY_PATH="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage0-bootstrap-tools/x86_64-gentoo-linux-musl/release/deps:/usr/lib/rust/1.85.0/lib" LICENSE_METADATA="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/license-metadata.json" OUT_DIR="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build" RUSTC="/usr/lib/rust/1.85.0/bin/rustc" "/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage0-tools-bin/generate-copyright" (failure_mode=Exit) (created at src/bootstrap/src/core/build_steps/tool.rs:1211:23, executed at src/bootstrap/src/core/build_steps/run.rs:224:13)
Vendoring deps into /var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/vendor...
error: failed to sync

Caused by:
  failed to load pkg lockfile

Caused by:
  failed to get `tikv-jemalloc-sys` as a dependency of package `rustc-main v0.0.0 (/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/compiler/rustc)`

Caused by:
  download of config.json failed

Caused by:
  failed to download from `https://index.crates.io/config.json`

Caused by:
  [6] Could not resolve hostname (Could not resolve host: index.crates.io)
Error: Failed to complete cargo vendor

Command cd "/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src" && CARGO="/usr/lib/rust/1.85.0/bin/cargo" DEST="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/COPYRIGHT.html" DEST_LIBSTD="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/COPYRIGHT-library.html" LD_LIBRARY_PATH="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage0-bootstrap-tools/x86_64-gentoo-linux-musl/release/deps:/usr/lib/rust/1.85.0/lib" LICENSE_METADATA="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/license-metadata.json" OUT_DIR="/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build" RUSTC="/usr/lib/rust/1.85.0/bin/rustc" "/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage0-tools-bin/generate-copyright" (failure_mode=Exit) did not execute successfully.
Expected success, got exit status: 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1211:23
Executed at: src/bootstrap/src/core/build_steps/run.rs:224:13

Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/./x.py", line 53, in <module>
    bootstrap.main()
  File "/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 1339, in main
    bootstrap(args)
  File "/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 1314, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 236, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/build/bootstrap/debug/bootstrap install -vv --config=/var/tmp/portage/dev-lang/rust-1.86.0_beta/work/rustc-beta-src/config.toml -j12

please be so kind to allow an offline build, thank you!

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 23, 2025
@jieyouxu
Copy link
Member

What's the exact invocation you used to build? Are you trying to build a dist tarball from the dist tarball?

Maybe related to #130099?

@jieyouxu jieyouxu added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) S-needs-info Status: The issue lacks details necessary to triage or act on it. labels Feb 23, 2025
@ehuss
Copy link
Contributor

ehuss commented Feb 23, 2025

I haven't tried, but I imagine this is fixed by #137020, and could maybe use a backport?

@jieyouxu
Copy link
Member

Oh right. #137020 is beta-accepted but not yet backported.

@onur-ozkan onur-ozkan removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 23, 2025
@stefson
Copy link
Author

stefson commented Feb 23, 2025

yes, I saw that one too - it was just nominated for beta backport.

so maybe just put this on hold, and wait for the backport getting merged?

still, my config.toml for completeness:

[llvm]
download-ci-llvm = false
optimize = true
release-debuginfo = false
assertions = false
ninja = true
targets = "X86"
experimental-targets = ""
link-shared = false
[build]
build = "x86_64-gentoo-linux-musl"
host = ["x86_64-gentoo-linux-musl"]
target = ["x86_64-gentoo-linux-musl"]
cargo = "/usr/lib/rust/1.85.0/bin/cargo"
rustc = "/usr/lib/rust/1.85.0/bin/rustc"
docs = false
compiler-docs = false
submodules = false
python = "python3.12"
locked-deps = true
vendor = true
extended = true
tools = ["rustfmt","cargo","rustdoc"]
verbose = 2
sanitizers = false
cargo-native-static = false
[install]
prefix = "/usr/lib/rust/1.86.0_beta"
sysconfdir = "etc"
docdir = "share/doc/rust"
bindir = "bin"
libdir = "lib"
mandir = "share/man"
[rust]
# https://github.com/rust-lang/rust/issues/54872
codegen-units-std = 1
optimize = true
debug = false
debug-assertions = false
debuginfo-level-rustc = 0
backtrace = true
incremental = false
default-linker = "x86_64-gentoo-linux-musl-gcc"
channel = "stable"
rpath = false
verbose-tests = true
optimize-tests = true
codegen-tests = true
dist-src = false
# https://github.com/rust-lang/rust/issues/117885
remap-debuginfo = true
lld = false
backtrace-on-ice = true
jemalloc = false
# See https://github.com/rust-lang/rust/issues/121124
lto = "off"
[dist]
src-tarball = false
compression-formats = ["xz"]
[target.x86_64-gentoo-linux-musl]
cc = "x86_64-gentoo-linux-musl-gcc"
cxx = "x86_64-gentoo-linux-musl-g++"
linker = "x86_64-gentoo-linux-musl-gcc"
ar = "x86_64-gentoo-linux-musl-ar"
crt-static = false

@jieyouxu
Copy link
Member

In the meantime, if you don't need to vendor deps for dist build, you could try setting

[dist]
vendor = false

@jieyouxu
Copy link
Member

I'm going to reopen #136955 to track the beta-backport, and close this as a duplicate of #136955 (yes, your invocation indeed fails at generate-copyright). Thanks for the report.

@stefson
Copy link
Author

stefson commented Feb 24, 2025

@jieyouxu the diagnosis is correct, I backported #137020 locally and it build just fine in offline mode:

rustc 1.86.0 (f0cb41030 2025-02-17) (built from a source tarball)
binary: rustc
commit-hash: f0cb41030579cd1a6f72bd23f38e677052d5d485
commit-date: 2025-02-17
host: x86_64-gentoo-linux-musl
release: 1.86.0
LLVM version: 19.1.7

@jieyouxu jieyouxu added C-bug Category: This is a bug. and removed S-needs-info Status: The issue lacks details necessary to triage or act on it. labels Feb 24, 2025
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

5 participants