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

bootstrap requires non-existing src/gcc submodule on static.rust-lang.org tarball #138124

Closed
fossdd opened this issue Mar 6, 2025 · 1 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)

Comments

@fossdd
Copy link

fossdd commented Mar 6, 2025

Summary

Hi, I'm a Alpine Linux contributor.

We use the tarball of https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.xz which does not contain the src/gcc submodule added in 9028177.

Since 1.85.0 bootstrap started failing in build_helper:

thread 'main' panicked at src/bootstrap/src/utils/helpers.rs:442:5:
std::fs::read_dir(dir) failed with No such file or directory (os error 2)
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: bootstrap::utils::helpers::dir_is_empty
             at ./src/bootstrap/src/utils/helpers.rs:37:23
   3: bootstrap::Build::require_submodule
             at ./src/bootstrap/src/lib.rs:481:12
   4: bootstrap::Build::require_and_update_all_submodules
             at ./src/bootstrap/src/lib.rs:502:13

By debugging i found that it fails to find src/gcc, which indeed is missing from the tarball.

Also using --disable-manage-submodules doesn't work since the config option is checked after the failing line:

if dir_is_empty(&absolute_path) {
let maybe_enable = if !self.config.submodules()

Command used

https://gitlab.alpinelinux.org/alpine/aports/-/blob/69a7e15bf81d1947d3347c1a7eaf36a07290e535/main/rust/APKBUILD

Bootstrap configuration (config.toml)

./configure \
		--build="$_build" \
		--host="$_target" \
		--target="$targets" \
		--prefix="/usr" \
		--release-channel="stable" \
		--enable-local-rust \
		--local-rust-root="/usr" \
		--llvm-root="/usr/lib/llvm$_llvmver" \
		--disable-docs \
		--enable-extended \
		--tools="cargo,clippy,src,${rust_analyzer}rustdoc,rustfmt,rust-demangler" \
		--enable-llvm-link-shared \
		--enable-option-checking \
		--enable-locked-deps \
		--enable-profiler \
		--enable-vendor \
		--disable-manage-submodules \
		--dist-compression-formats=gz \
		--python="python3" \
		--set="change-id=134650" \
		--set="rust.musl-root=/usr" \
		--set="rust.backtrace-on-ice=true" \
		--set="rust.codegen-units=1" \
		--set="rust.codegen-units-std=1" \
		--set="rust.deny-warnings=false" \
		--set="rust.remap-debuginfo=true" \
		--set="rust.lld=false" \
		--set="rust.description=Alpine Linux $pkgver-r$pkgrel" \
		--set="target.$_target.llvm-config=/usr/lib/llvm$_llvmver/bin/llvm-config" \
		--set="target.$_target.musl-root=/usr" \
		--set="target.$_target.crt-static=false" \
		--set="target.$_target.cc=${CROSS_COMPILE}cc" \
		--set="target.$_target.cxx=${CROSS_COMPILE}c++" \
		--set="target.$_target.ar=${CROSS_COMPILE}ar" \
		--set="target.$_target.linker=${CROSS_COMPILE}cc" \
		--set="target.$_build.musl-root=/usr" \
		--set="target.$_build.crt-static=false" \
		--set="target.$_build.cc=cc" \
		--set="target.$_build.cxx=c++" \
		--set="target.$_build.ar=ar" \
		--set="target.$_build.linker=cc"

Operating system

Alpine Linux edge

HEAD

4d91de4e48198da2e33413efdcd9cd2cc0c46688

Additional context

Build Log

configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-alpine-linux-musl', '--host=x ...
configure: build.build          := x86_64-alpine-linux-musl
configure: build.host           := ['x86_64-alpine-linux-musl']
configure: build.target         := ['x86_64-alpine-linux-musl', 'wasm32-wasip1',  ...
configure: install.prefix       := /usr
configure: rust.channel         := stable
configure: build.rustc          := /usr/bin/rustc
configure: build.cargo          := /usr/bin/cargo
configure: build.rustc          := /usr/bin/rustc
configure: build.cargo          := /usr/bin/cargo
configure: target.x86_64-alpine-linux-musl.llvm-config := /usr/lib/llvm19/bin/llv ...
configure: build.docs           := False
configure: build.extended       := True
configure: build.tools          := ['cargo', 'clippy', 'src', 'rust-analyzer-proc ...
configure: llvm.link-shared     := True
configure: build.locked-deps    := True
configure: build.profiler       := True
configure: build.vendor         := True
configure: dist.compression-formats := ['gz']
configure: build.python         := python3
configure: change-id            := 134650
configure: rust.musl-root       := /usr
configure: rust.backtrace-on-ice := True
configure: rust.codegen-units   := 1
configure: rust.codegen-units-std := 1
configure: rust.deny-warnings   := False
configure: rust.remap-debuginfo := True
configure: rust.lld             := False
configure: rust.description     := Alpine Linux 1.85.0-r0
configure: rust.lto             := thin
configure: target.x86_64-alpine-linux-musl.llvm-config := /usr/lib/llvm19/bin/llv ...
configure: target.x86_64-alpine-linux-musl.musl-root := /usr
configure: target.x86_64-alpine-linux-musl.crt-static := False
configure: target.x86_64-alpine-linux-musl.cc := cc
configure: target.x86_64-alpine-linux-musl.cxx := c++
configure: target.x86_64-alpine-linux-musl.ar := ar
configure: target.x86_64-alpine-linux-musl.linker := cc
configure: target.x86_64-alpine-linux-musl.musl-root := /usr
configure: target.x86_64-alpine-linux-musl.crt-static := False
configure: target.x86_64-alpine-linux-musl.cc := cc
configure: target.x86_64-alpine-linux-musl.cxx := c++
configure: target.x86_64-alpine-linux-musl.ar := ar
configure: target.x86_64-alpine-linux-musl.linker := cc
configure: target.wasm32-unknown-unknown.sanitizers := False
configure: target.wasm32-unknown-unknown.profiler := False
configure: target.wasm32-unknown-unknown.linker := lld
configure: target.wasm32-wasip1.sanitizers := False
configure: target.wasm32-wasip1.profiler := False
configure: target.wasm32-wasip1.wasi-root := /usr/share/wasi-sysroot
configure: target.wasm32-wasip1-threads.sanitizers := False
configure: target.wasm32-wasip1-threads.profiler := False
configure: target.wasm32-wasip1-threads.wasi-root := /usr/share/wasi-sysroot
configure: target.wasm32-wasip2.sanitizers := False
configure: target.wasm32-wasip2.profiler := False
configure: target.wasm32-wasip2.wasi-root := /usr/share/wasi-sysroot
configure: profile              := dist
configure: 
configure: writing `config.toml` in current directory
configure: 
configure: run `python /builds/fossdd/aports/main/rust/src/rustc-1.85.0-src/x.py --help`
Building bootstrap
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling memchr v2.7.4
   Compiling version_check v0.9.5
   Compiling typenum v1.17.0
   Compiling libc v0.2.167
   Compiling shlex v1.3.0
   Compiling serde v1.0.215
   Compiling rustix v0.38.40
   Compiling crossbeam-utils v0.8.20
   Compiling regex-syntax v0.8.5
   Compiling pkg-config v0.3.31
   Compiling bitflags v2.6.0
   Compiling linux-raw-sys v0.4.14
   Compiling cfg-if v1.0.0
   Compiling anstyle v1.0.10
   Compiling heck v0.5.0
   Compiling clap_lex v0.7.2
   Compiling same-file v1.0.6
   Compiling serde_json v1.0.132
   Compiling semver v1.0.23
   Compiling log v0.4.22
   Compiling cpufeatures v0.2.15
   Compiling ryu v1.0.18
   Compiling bootstrap v0.0.0 (/builds/fossdd/aports/main/rust/src/rustc-1.85.0-src/src/bootstrap)
   Compiling itoa v1.0.11
   Compiling home v0.5.9
   Compiling termcolor v1.4.1
   Compiling cc v1.1.22
   Compiling clap_builder v4.5.20
   Compiling walkdir v2.5.0
   Compiling generic-array v0.14.7
   Compiling aho-corasick v1.1.3
   Compiling object v0.36.5
   Compiling crossbeam-epoch v0.9.18
   Compiling quote v1.0.37
   Compiling cmake v0.1.48
   Compiling crossbeam-deque v0.8.5
   Compiling syn v2.0.87
   Compiling filetime v0.2.25
   Compiling lzma-sys v0.1.20
   Compiling regex-automata v0.4.9
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling xz2 v0.1.7
   Compiling digest v0.10.7
   Compiling sha2 v0.10.8
   Compiling xattr v1.3.1
   Compiling fd-lock v4.0.2
   Compiling tar v0.4.43
   Compiling toml v0.5.11
   Compiling bstr v1.10.0
   Compiling clap_derive v4.5.18
   Compiling serde_derive v1.0.215
   Compiling globset v0.4.15
   Compiling opener v0.5.2
   Compiling ignore v0.4.23
   Compiling clap v4.5.20
   Compiling clap_complete v4.5.37
   Compiling build_helper v0.1.0 (/builds/fossdd/aports/main/rust/src/rustc-1.85.0-src/src/build_helper)
    Finished `dev` profile [unoptimized] target(s) in 30.74s
thread 'main' panicked at src/bootstrap/src/utils/helpers.rs:441:5:
std::fs::read_dir(dir) failed with No such file or directory (os error 2)
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: bootstrap::utils::helpers::dir_is_empty
             at ./src/bootstrap/src/utils/helpers.rs:37:23
   3: bootstrap::Build::require_submodule
             at ./src/bootstrap/src/lib.rs:481:12
   4: bootstrap::Build::require_and_update_all_submodules
             at ./src/bootstrap/src/lib.rs:502:13
   5: <bootstrap::core::build_steps::dist::PlainSourceTarball as bootstrap::core::builder::Step>::run
             at ./src/bootstrap/src/core/build_steps/dist.rs:1031:13
   6: bootstrap::core::builder::Builder::ensure
             at ./src/bootstrap/src/core/builder/mod.rs:1451:23
   7: <bootstrap::core::build_steps::dist::PlainSourceTarball as bootstrap::core::builder::Step>::make_run
             at ./src/bootstrap/src/core/build_steps/dist.rs:968:9
   8: bootstrap::core::builder::StepDescription::maybe_run
             at ./src/bootstrap/src/core/builder/mod.rs:388:13
   9: bootstrap::core::builder::StepDescription::run
             at ./src/bootstrap/src/core/builder/mod.rs:438:21
  10: bootstrap::core::builder::Builder::run_step_descriptions
             at ./src/bootstrap/src/core/builder/mod.rs:1177:9
  11: bootstrap::core::builder::Builder::execute_cli
             at ./src/bootstrap/src/core/builder/mod.rs:1157:9
  12: bootstrap::Build::build
             at ./src/bootstrap/src/lib.rs:579:17
  13: bootstrap::main
             at ./src/bootstrap/src/bin/main.rs:86:5
  14: core::ops::function::FnOnce::call_once
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Build completed unsuccessfully in 0:00:33

@fossdd fossdd 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 Mar 6, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 6, 2025
@fossdd
Copy link
Author

fossdd commented Mar 6, 2025

It was apparently removed in #135658 to fix #135606.

Also it was reported already at #137332 with #137338 and #137340 as fixes.

@fossdd fossdd closed this as completed Mar 6, 2025
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 6, 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

3 participants