Skip to content

Build failing on native illumos as try_lock is not supported #149613

@Toasterson

Description

@Toasterson

Summary

When trying to build Rust natively on illumos (not Cross compiling as the CI does) we get a panic. This in the release 1.91 version

Command used

cd /usr/src/oi-userland/components/developer/rust/build/amd64 ; /usr/bin/env -i CONFIG_SHELL="/bin/bash" PATH="/usr/gcc/14/bin:/usr/clang/20/bin:/usr/ruby/3.2/bin:/usr/jdk/openjdk21/bin:/usr/postgres/16/bin:/usr/mariadb/10.6/bin:/usr/openssl/3/bin:/usr/gnu/bin:/usr/bin/amd64:/usr/bin:/usr/sbin/amd64:/usr/sbin" CC="/usr/gcc/14/bin/gcc" CXX="/usr/gcc/14/bin/g++" F77="/usr/gcc/14/bin/gfortran" FC="/usr/gcc/14/bin/gfortran" CFLAGS="-m64 -O3 " CXXFLAGS="-m64 -O3 " FFLAGS=" -m64 -O3 " FCFLAGS="-m64 -O3 " LDFLAGS="-m64" PKG_CONFIG_PATH="/usr/mariadb/10.6/lib/amd64/pkgconfig:/usr/openssl/3/lib/amd64/pkgconfig:/usr/lib/amd64/pkgconfig:/usr/lib/pkgconfig"  "ac_cv_func_realloc_0_nonnull=yes" CFLAGS="-m64 -O3" CXXFLAGS="-m64 -O3" LDFLAGS="-m64" /bin/bash /usr/src/oi-userland/components/developer/rust/rustc-1.91.1-src/configure --prefix=/usr --mandir=/usr/share/man --bindir=/usr/bin --libdir=/usr/lib --docdir=/usr/share/doc/rust-1.91.1 --datadir=/usr/share --enable-local-rust --local-rust-root=/usr --enable-extended        --default-linker=/usr/gcc/14/bin/gcc --set target.x86_64-unknown-illumos.cc=/usr/gcc/14/bin/gcc --set target.x86_64-unknown-illumos.cxx=/usr/gcc/14/bin/g++ --set target.x86_64-unknown-illumos.ar=/usr/gnu/bin/ar --set target.x86_64-unknown-illumos.linker=/usr/gcc/14/bin/gcc --enable-rpath --disable-codegen-tests --disable-dist-src --disable-llvm-static-stdcpp --enable-vendor --disable-docs --disable-compiler-docs --disable-cargo-native-static --enable-option-checking --release-channel=stable --python=/usr/bin/python3.9 --disable-clang --enable-llvm-link-shared --llvm-root=/usr/clang/20 --llvm-config=/usr/clang/20/bin

Expected behaviour

The Compiler building as before

Actual behaviour

We see this panic, which suggest try_lock has no illumos implementation.

thread 'main' panicked at src/bootstrap/src/bin/main.rs:53:9: build_lock.try_lock().or_else(|e| { if let TryLockError::Error(e) = e { return Err(e); } let mut pid = String::new(); t!(build_lock.read_to_string(&mut pid)); if !pid.is_empty() { println!("WARNING: build directory locked by process {pid}, waiting for lock"); } else { println!("WARNING: build directory locked, waiting for lock"); } build_lock.lock() }) failed with try_lock() not supported stack backtrace: 0: __rustc::rust_begin_unwind 1: core::panicking::panic_fmt 2: bootstrap::main at /usr/share/src/oi-userland/components/developer/rust/rustc-1.91.1-src/src/bootstrap/src/bin/main.rs:53:9 3: core::ops::function::FnOnce::call_once at /jenkins/jobs/oi-userland/workspace/components/developer/rust/rustc-1.90.0-src/library/core/src/ops/function.rs:253:5 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. Panic was initiated from src/bootstrap/src/bin/main.rs:53:9 Traceback (most recent call last): File "/usr/src/oi-userland/components/developer/rust/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 1409, in <module> main() File "/usr/src/oi-userland/components/developer/rust/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 1389, in main bootstrap(args) File "/usr/src/oi-userland/components/developer/rust/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 1364, in bootstrap run(args, env=env, verbose=build.verbose, is_bootstrap=True) File "/usr/src/oi-userland/components/developer/rust/rustc-1.91.1-src/src/bootstrap/bootstrap.py", line 237, in run raise RuntimeError(err) RuntimeError: failed to run: /usr/share/src/oi-userland/components/developer/rust/build/amd64/build/bootstrap/debug/bootstrap build --stage 2 -v -j12 make: *** [Makefile:19: all] Error 1 make: *** [/usr/share/src/oi-userland/make-rules/common-rules.mk:55: /usr/src/oi-userland/components/developer/rust/build/amd64/.built] Error 2

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]

# When true, link libstdc++ statically into the rustc_llvm.
# This is useful if you don't want to use the dynamic version of that
# library provided by LLVM.
static-libstdcpp = false

# 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

# Whether to build the clang compiler.
clang = false

[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

# Python interpreter to use for various tasks throughout the build, notably
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
#
# Defaults to the Python interpreter used to execute x.py.
python = '/usr/bin/python3.9'

# 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

# 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 = ['--prefix=/usr', '--mandir=/usr/share/man', '--bindir=/usr/bin', '--libdir=/usr/lib', '--docdir=/usr/share/doc/rust-1.91.1', '--datadir=/usr/share', '--enable-local-rust', '--local-rust-root=/usr', '--enable-extended', '--default-linker=/usr/gcc/14/bin/gcc', '--set', 'target.x86_64-unknown-illumos.cc=/usr/gcc/14/bin/gcc', '--set', 'target.x86_64-unknown-illumos.cxx=/usr/gcc/14/bin/g++', '--set', 'target.x86_64-unknown-illumos.ar=/usr/gnu/bin/ar', '--set', 'target.x86_64-unknown-illumos.linker=/usr/gcc/14/bin/gcc', '--enable-rpath', '--disable-codegen-tests', '--disable-dist-src', '--disable-llvm-static-stdcpp', '--enable-vendor', '--disable-docs', '--disable-compiler-docs', '--disable-cargo-native-static', '--enable-option-checking', '--release-channel=stable', '--python=/usr/bin/python3.9', '--disable-clang', '--enable-llvm-link-shared', '--llvm-root=/usr/clang/20', '--llvm-config=/usr/clang/20/bin']

[install]

# Where to install the generated toolchain. Must be an absolute path.
prefix = '/usr'

# Where to install documentation in `prefix` above
docdir = '/usr/share/doc/rust-1.91.1'

# Where to install binaries in `prefix` above
bindir = '/usr/bin'

# Where to install libraries in `prefix` above
libdir = '/usr/lib'

# Where to install man pages in `prefix` above
mandir = '/usr/share/man'

# Where to install data in `prefix` above
datadir = '/usr/share'

[rust]

# The default linker that will be hard-coded into the generated
# compiler for targets that don't specify a default linker explicitly
# in their target specifications.  Note that this is not the linker
# used to link said compiler. It can also be set per-target (via the
# `[target.<triple>]` block), which may be useful in a cross-compilation
# setting.
#
# See https://doc.rust-lang.org/rustc/codegen-options/index.html#linker for more information.
default-linker = '/usr/gcc/14/bin/gcc'

# 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'

# By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix
# platforms to ensure that the compiler is usable by default from the build
# directory (as it links to a number of dynamic libraries). This may not be
# desired in distributions, for example.
rpath = true

# Flag indicating whether codegen tests will be run or not. If you get an error
# saying that the FileCheck executable is missing, you may want to disable this.
# Also see the target's llvm-filecheck option.
codegen-tests = false

# Whether to create a source tarball by default when running `x dist`.
#
# You can still build a source tarball when this is disabled by explicitly passing `x dist rustc-src`.
dist-src = false

[dist]

[target.x86_64-pc-solaris]

# 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/clang/20/bin'

[target.x86_64-unknown-illumos]

# 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/gcc/14/bin/gcc'

# 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/gcc/14/bin/g++'

# Archiver to be used to assemble static libraries compiled from C/C++ code.
# Note: an absolute path should be used, otherwise LLVM build will break.
ar = '/usr/gnu/bin/ar'

# 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 `use-lld` option for Rust code when targeting MSVC.
linker = '/usr/gcc/14/bin/gcc' 

Operating system

OpenIndiana Hipster Rolling with GCC 14 (x86_64-unknown-illumos)

HEAD

ed61e7d

Additional context

The build log is too big so here the log as Gist
https://gist.github.com/Toasterson/59714e0b15a54f257e17ad431d148a96

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-illumosthe other shiny OST-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