Repository navigation
Description
Summary
I'm compiling rustc in an openSUSE docker container. When running make I very quickly get an error because it's trying to copy /usr to stage0-sysroot. The file in question is this one:
-rwsr-x--- 1 root messagebus 56K Jun 20 2023 /usr/lib/dbus-1/dbus-daemon-launch-helperI don't understand why it's necessary to copy all of /usr to the stage0-sysroot directory. Certainly this file (and many others) are not required? This seems like a bug to me, but maybe I have missed some critical configuration step.
I could of course run as root in the container, but I don't think root permission should be required to build rustc.
Command used
tar xf rustc-1.92.0-src.tar.gz
cd rustc-1.92.0-src
./configure \
--set=llvm.download-ci-llvm=false \
--set=target.x86_64-unknown-linux-gnu.cc=/usr/local/bin/gcc-15.2.0 \
--set=target.x86_64-unknown-linux-gnu.cxx=/usr/local/bin/g++-15.2.0 \
--set=target.x86_64-unknown-linux-gnu.linker=/usr/local/bin/gcc-15.2.0 \
--set=change-id=ignore \
--disable-lld \
--enable-ccache \
--enable-extended \
--enable-llvm-link-shared \
--enable-local-rust \
--enable-ninja \
--enable-profiler \
--enable-sanitizers \
--enable-vendor \
--disable-cargo-native-static \
--disable-compiler-docs \
--disable-docs \
--llvm-config=/usr/staging/local/bin/llvm-config \
--release-channel=stable
export RUST_BACKTRACE=1
make --jobs $(nproc)Expected behaviour
rustc compiles
Actual behaviour
Error when copying file because of missing read permissions.
thread 'main' (64) panicked at src/bootstrap/src/core/build_steps/compile.rs:821:21:
failed to copy `/usr/lib/dbus-1/dbus-daemon-launch-helper` to `/staging/rustc-1.92.0-src/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/dbus-1/dbus-daemon-launch-helper`: Permission denied (os error 13)Bootstrap configuration (bootstrap.toml)
# Use different pre-set defaults than the global defaults.
#
# See `src/bootstrap/defaults` for more information.
# Note that this has no default value (x.py uses the defaults in `bootstrap.example.toml`).
profile = 'dist'
[llvm]
# Currently, we only support this when building LLVM for the build triple.
#
# Note that many of the LLVM options are not currently supported for
# downloading. Currently only the "assertions" option can be toggled.
download-ci-llvm = false
# Whether to use Ninja to build LLVM. This runs much faster than make.
ninja = true
# Whether to build LLVM as a dynamically linked library (as opposed to statically linked).
# Under the hood, this passes `--shared` to llvm-config.
# NOTE: To avoid performing LTO multiple times, we suggest setting this to `true` when `thin-lto` is enabled.
link-shared = true
[gcc]
[build]
# Instead of downloading the src/stage0 version of Cargo specified, use
# this Cargo binary instead to build all Rust code
# If you set this, you likely want to set `rustc` as well.
cargo = '/usr/bin/cargo'
# Instead of downloading the src/stage0 version of the compiler
# specified, use this rustc binary instead as the stage0 snapshot compiler.
# If you set this, you likely want to set `cargo` as well.
rustc = '/usr/bin/rustc'
# Whether to build documentation by default. If false, rustdoc and
# friends will still be compiled but they will not be used to generate any
# documentation.
#
# You can still build documentation when this is disabled by explicitly passing paths,
# e.g. `x doc library`.
docs = false
# Indicate whether to build compiler documentation by default.
# You can still build documentation when this is disabled by explicitly passing a path: `x doc compiler`.
compiler-docs = false
# Indicate whether the vendored sources are used for Rust dependencies or not.
#
# Vendoring requires additional setup. We recommend using the pre-generated source tarballs if you
# want to use vendoring. See https://forge.rust-lang.org/infra/other-installation-methods.html#source-code.
vendor = true
# Enable a build of the extended Rust tool set which is not only the compiler
# but also tools such as Cargo. This will also produce "combined installers"
# which are used to install Rust and Cargo together.
# The `tools` (check `bootstrap.example.toml` to see its default value) option specifies
# which tools should be built if `extended = true`.
#
# This is disabled by default.
extended = true
# Build the sanitizer runtimes
sanitizers = true
# Build the profiler runtime (required when compiling with options that depend
# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`).
profiler = true
# Indicates whether the native libraries linked into Cargo will be statically
# linked or not.
cargo-native-static = false
# Arguments passed to the `./configure` script, used during distcheck. You
# probably won't fill this in but rather it's filled in by the `./configure`
# script. Useful for debugging.
configure-args = ['--set=llvm.download-ci-llvm=false', '--set=target.x86_64-unknown-linux-gnu.cc=/usr/local/bin/gcc-15.2.0', '--set=target.x86_64-unknown-linux-gnu.cxx=/usr/local/bin/g++-15.2.0', '--set=target.x86_64-unknown-linux-gnu.linker=/usr/local/bin/gcc-15.2.0', '--disable-lld', '--enable-ccache', '--enable-extended', '--enable-llvm-link-shared', '--enable-local-rust', '--enable-ninja', '--enable-profiler', '--enable-sanitizers', '--enable-vendor', '--disable-cargo-native-static', '--disable-compiler-docs', '--disable-docs', '--llvm-config=/usr/staging/local/bin/llvm-config', '--release-channel=stable']
# Indicates whether ccache is used when building certain artifacts (e.g. LLVM).
# Set to `true` to use the first `ccache` in PATH, or set an absolute path to use
# a specific version.
ccache = true
[install]
[rust]
# The "channel" for the Rust build to produce. The stable/beta channels only
# allow using stable features, whereas the nightly and dev channels allow using
# nightly features.
#
# You can set the channel to "auto-detect" to load the channel name from `src/ci/channel`.
#
# If using tarball sources, default value is "auto-detect", otherwise, it's "dev".
channel = 'stable'
# Indicates whether LLD will be compiled and made available in the sysroot for rustc to execute,
lld = false
[dist]
[target.x86_64-unknown-linux-gnu]
# C compiler to be used to compile C code. Note that the
# default value is platform specific, and if not specified it may also depend on
# what platform is crossing to what platform.
# See `src/bootstrap/src/utils/cc_detect.rs` for details.
cc = '/usr/local/bin/gcc-15.2.0'
# C++ compiler to be used to compile C++ code (e.g. LLVM and our LLVM shims).
# This is only used for host targets.
# See `src/bootstrap/src/utils/cc_detect.rs` for details.
cxx = '/usr/local/bin/g++-15.2.0'
# Linker to be used to bootstrap Rust code. Note that the
# default value is platform specific, and if not specified it may also depend on
# what platform is crossing to what platform.
# Setting this will override the `bootstrap-override-lld` option for Rust code when targeting MSVC.
linker = '/usr/local/bin/gcc-15.2.0'
# Path to the `llvm-config` binary of the installation of a custom LLVM to link
# against. Note that if this is specified we don't compile LLVM at all for this
# target.
llvm-config = '/usr/staging/local/bin/llvm-config'Operating system
Docker image based on SUSE Linux Enterprise Server 15 SP7
HEAD
rustc-1.92.0-src.tar.gz
git-commit-hash content: ded5c06cf21d2b93bffd5d884aa6e96934ee4234
Additional context
Build Log
configure: processing command line
configure:
configure: build.configure-args := ['--set=llvm.download-ci-llvm=false', '--set=t ...
configure: llvm.download-ci-llvm := False
configure: target.x86_64-unknown-linux-gnu.cc := /usr/local/bin/gcc-15.2.0
configure: target.x86_64-unknown-linux-gnu.cxx := /usr/local/bin/g++-15.2.0
configure: target.x86_64-unknown-linux-gnu.linker := /usr/local/bin/gcc-15.2.0
configure: change-id := ignore
configure: rust.lld := False
configure: build.ccache := True
configure: build.extended := True
configure: llvm.link-shared := True
configure: build.rustc := /usr/bin/rustc
configure: build.cargo := /usr/bin/cargo
configure: llvm.ninja := True
configure: build.profiler := True
configure: build.sanitizers := True
configure: build.vendor := True
configure: build.cargo-native-static := False
configure: build.compiler-docs := False
configure: build.docs := False
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/staging/local/bin/ ...
configure: rust.channel := stable
configure: profile := dist
configure:
configure: writing `bootstrap.toml` in current directory
configure:
configure: run `python3 /staging/rustc-1.92.0-src/x.py --help`
Compiling proc-macro2 v1.0.89
Compiling memchr v2.7.4
Compiling unicode-ident v1.0.13
Compiling typenum v1.17.0
Compiling version_check v0.9.5
Compiling shlex v1.3.0
Compiling libc v0.2.174
Compiling regex-syntax v0.8.5
Compiling crossbeam-utils v0.8.20
Compiling serde v1.0.215
Compiling pkg-config v0.3.31
Compiling clap_lex v0.7.2
Compiling heck v0.5.0
Compiling cfg-if v1.0.0
Compiling anstyle v1.0.10
Compiling same-file v1.0.6
Compiling serde_json v1.0.132
Compiling log v0.4.22
Compiling semver v1.0.23
Compiling object v0.37.3
Compiling itoa v1.0.11
Compiling ryu v1.0.18
Compiling cpufeatures v0.2.15
Compiling bootstrap v0.0.0 (/staging/rustc-1.92.0-src/src/bootstrap)
Compiling home v0.5.11
Compiling termcolor v1.4.1
Compiling walkdir v2.5.0
Compiling cc v1.2.28
Compiling clap_builder v4.5.20
Compiling generic-array v0.14.7
Compiling aho-corasick v1.1.3
Compiling crossbeam-epoch v0.9.18
Compiling quote v1.0.37
Compiling cmake v0.1.54
Compiling crossbeam-deque v0.8.5
Compiling syn v2.0.87
Compiling lzma-sys v0.1.20
Compiling filetime v0.2.26
Compiling tar v0.4.44
Compiling xz2 v0.1.7
Compiling regex-automata v0.4.9
Compiling crypto-common v0.1.6
Compiling block-buffer v0.10.4
Compiling digest v0.10.7
Compiling sha2 v0.10.8
Compiling toml v0.5.11
Compiling clap_derive v4.5.18
Compiling serde_derive v1.0.215
Compiling bstr v1.10.0
Compiling globset v0.4.15
Compiling opener v0.8.2
Compiling ignore v0.4.23
Compiling clap v4.5.20
Compiling clap_complete v4.5.37
Compiling build_helper v0.1.0 (/staging/rustc-1.92.0-src/src/build_helper)
Finished `dev` profile [unoptimized] target(s) in 26.65s
thread 'main' (1518) panicked at src/bootstrap/src/core/build_steps/compile.rs:821:21:
failed to copy `/usr/lib/dbus-1/dbus-daemon-launch-helper` to `/staging/rustc-1.92.0-src/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/dbus-1/dbus-daemon-launch-helper`: Permission denied (os error 13)
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: bootstrap::Build::copy_link_internal
at ./src/bootstrap/src/lib.rs:1840:17
3: bootstrap::Build::copy_link
at ./src/bootstrap/src/lib.rs:1789:14
4: bootstrap::Build::cp_link_r
at ./src/bootstrap/src/lib.rs:1869:22
5: bootstrap::Build::cp_link_r
at ./src/bootstrap/src/lib.rs:1867:22
6: <bootstrap::core::build_steps::compile::StdLink as bootstrap::core::builder::Step>::run
at ./src/bootstrap/src/core/build_steps/compile.rs:821:21
7: bootstrap::core::builder::Builder::ensure
at ./src/bootstrap/src/core/builder/mod.rs:1809:36
8: bootstrap::core::builder::Builder::std
at ./src/bootstrap/src/core/builder/mod.rs:1502:22
9: <bootstrap::core::build_steps::compile::Rustc as bootstrap::core::builder::Step>::run
at ./src/bootstrap/src/core/build_steps/compile.rs:1074:17
10: bootstrap::core::builder::Builder::ensure
at ./src/bootstrap/src/core/builder/mod.rs:1809:36
11: <bootstrap::core::build_steps::compile::Assemble as bootstrap::core::builder::Step>::run
at ./src/bootstrap/src/core/build_steps/compile.rs:2220:21
12: bootstrap::core::builder::Builder::ensure
at ./src/bootstrap/src/core/builder/mod.rs:1809:36
13: bootstrap::core::builder::Builder::compiler
at ./src/bootstrap/src/core/builder/mod.rs:1379:14
14: <bootstrap::core::build_steps::compile::Assemble as bootstrap::core::builder::Step>::run
at ./src/bootstrap/src/core/build_steps/compile.rs:2188:21
15: bootstrap::core::builder::Builder::ensure
at ./src/bootstrap/src/core/builder/mod.rs:1809:36
16: bootstrap::core::builder::Builder::compiler
at ./src/bootstrap/src/core/builder/mod.rs:1379:14
17: <bootstrap::core::build_steps::compile::Std as bootstrap::core::builder::Step>::make_run
at ./src/bootstrap/src/core/build_steps/compile.rs:140:41
18: bootstrap::core::builder::StepDescription::maybe_run
at ./src/bootstrap/src/core/builder/mod.rs:533:13
19: bootstrap::core::builder::StepDescription::run
at ./src/bootstrap/src/core/builder/mod.rs:585:26
20: bootstrap::core::builder::Builder::run_step_descriptions
at ./src/bootstrap/src/core/builder/mod.rs:1352:9
21: bootstrap::core::builder::Builder::execute_cli
at ./src/bootstrap/src/core/builder/mod.rs:1331:14
22: bootstrap::Build::build
at ./src/bootstrap/src/lib.rs:800:25
23: bootstrap::main
at ./src/bootstrap/src/bin/main.rs:130:11
24: core::ops::function::FnOnce::call_once
at /home/abuild/rpmbuild/BUILD/rustc-1.92.0-src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Building bootstrap
Build completed unsuccessfully in 0:00:27
make: *** [Makefile:19: all] Error 1
Finished `dev` profile [unoptimized] target(s) in 0.46s
thread 'main' (1560) panicked at src/bootstrap/src/core/build_steps/compile.rs:821:21:
failed to copy `/usr/lib/dbus-1/dbus-daemon-launch-helper` to `/staging/rustc-1.92.0-src/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/dbus-1/dbus-daemon-launch-helper`: Permission denied (os error 13)
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: bootstrap::Build::copy_link_internal
at ./src/bootstrap/src/lib.rs:1840:17
3: bootstrap::Build::copy_link
at ./src/bootstrap/src/lib.rs:1789:14
4: bootstrap::Build::cp_link_r
at ./src/bootstrap/src/lib.rs:1869:22
5: bootstrap::Build::cp_link_r
at ./src/bootstrap/src/lib.rs:1867:22
6: <bootstrap::core::build_steps::compile::StdLink as bootstrap::core::builder::Step>::run
at ./src/bootstrap/src/core/build_steps/compile.rs:821:21
7: bootstrap::core::builder::Builder::ensure
at ./src/bootstrap/src/core/builder/mod.rs:1809:36
8: bootstrap::core::builder::Builder::std
at ./src/bootstrap/src/core/builder/mod.rs:1502:22
9: <bootstrap::core::build_steps::compile::Rustc as bootstrap::core::builder::Step>::run
at ./src/bootstrap/src/core/build_steps/compile.rs:1074:17
10: bootstrap::core::builder::Builder::ensure
at ./src/bootstrap/src/core/builder/mod.rs:1809:36
11: <bootstrap::core::build_steps::compile::Assemble as bootstrap::core::builder::Step>::run
at ./src/bootstrap/src/core/build_steps/compile.rs:2220:21
12: bootstrap::core::builder::Builder::ensure
at ./src/bootstrap/src/core/builder/mod.rs:1809:36
13: bootstrap::core::builder::Builder::compiler
at ./src/bootstrap/src/core/builder/mod.rs:1379:14
14: <bootstrap::core::build_steps::install::Std as bootstrap::core::builder::Step>::make_run
at ./src/bootstrap/src/core/build_steps/install.rs:194:49
15: bootstrap::core::builder::StepDescription::maybe_run
at ./src/bootstrap/src/core/builder/mod.rs:533:13
16: bootstrap::core::builder::StepDescription::run
at ./src/bootstrap/src/core/builder/mod.rs:585:26
17: bootstrap::core::builder::Builder::run_step_descriptions
at ./src/bootstrap/src/core/builder/mod.rs:1352:9
18: bootstrap::core::builder::Builder::execute_cli
at ./src/bootstrap/src/core/builder/mod.rs:1331:14
19: bootstrap::Build::build
at ./src/bootstrap/src/lib.rs:800:25
20: bootstrap::main
at ./src/bootstrap/src/bin/main.rs:130:11
21: core::ops::function::FnOnce::call_once
at /home/abuild/rpmbuild/BUILD/rustc-1.92.0-src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Building bootstrap
Build completed unsuccessfully in 0:00:01
make: *** [Makefile:95: install] Error 1
Activity
Kobzol commentedon Jan 30, 2026
Yeah, this is a known issue (#143735). It will require some non-trivial refactoring of bootstrap (#146203) to get rid of it.
Closing as duplicate of #143735.