Skip to content

rust 1.81.0 fails to build without network access #130099

Closed
@jpalus

Description

@jpalus

Distribution packages are often built from self contained sources in isolated environment without network access. Contrary to previous releases rust 1.81.0 fails to build without network access although it's not clear to me why exactly. ./x.py dist fails with;

Command cd "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/build/tmp/tarball/rustc/src/image" && RUSTC_BOOTSTRAP="1" "/usr/bin/cargo" "vendor" "--versioned-dirs" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/cargo/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rust-analyzer/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./compiler/rustc_codegen_cranelift/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./compiler/rustc_codegen_gcc/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/bootstrap/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/opt-dist/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/syn-1.0.89/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/cargo-0.60.0/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/serde-1.0.136/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/ripgrep-13.0.0/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/regex-1.5.5/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/clap-3.1.6/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/hyper-0.14.18/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/externs/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/ctfe-stress-5/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/cargo-0.60.0/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/token-stream-stress/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/match-stress/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/tuple-stress/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/diesel-1.4.8/Cargo.toml" "--sync" "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./src/tools/rustc-perf/collector/compile-benchmarks/bitmaps-3.1.0/Cargo.toml" (failure_mode=Exit, stdout_mode=Capture, stderr_mode=Capture) did not execute successfully.
Expected success, got exit status: 101
Created at: src/core/build_steps/dist.rs:1026:27
Executed at: src/core/build_steps/dist.rs:1063:40

STDOUT ----


STDERR ----
Updating crates.io index
warning: spurious network error (3 tries remaining): [6] Could not resolve hostname (Could not resolve host: index.crates.io)
warning: spurious network error (2 tries remaining): [6] Could not resolve hostname (Could not resolve host: index.crates.io)
warning: spurious network error (1 tries remaining): [6] Could not resolve hostname (Could not resolve host: index.crates.io)
error: failed to sync

Caused by:
  failed to load pkg lockfile

Caused by:
  failed to get `serde` as a dependency of package `cargo-platform v0.1.8 (/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/src/tools/cargo/crates/cargo-platform)`

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)

Traceback (most recent call last):
  File "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/./x.py", line 50, in <module>
    bootstrap.main()
  File "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 1191, in main
    bootstrap(args)
  File "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 1167, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 186, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /tmp/B.dlfv1vcs/BUILD/rustc-1.81.0-src/build/bootstrap/debug/bootstrap dist -j 28 --verbose

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions