• Re: [gentoo-user] rust tries to use clang-19 but depends on clang-20

    From Eli Schwartz@21:1/5 to Nate Eldredge on Thu Mar 20 07:10:01 2025
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------yRh7JszaVXOwVVAOQgCX1q2k
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 3/19/25 6:41 PM, Nate Eldredge wrote:
    I have dev-lang/rust-1.85.0-r1 installed. It fails to build trivial programs:

    nate@trapezoid /tmp $ rustc t.rs
    error: linker `clang-19` not found
    |
    = note: No such file or directory (os error 2)

    error: aborting due to 1 previous error
    It appears that although
    rust is installed with LLVM_SLOT=19, its dependency on clang is
    being satisfied by clang-20. clang-19 is no longer on the system
    after a recent `emerge -vauDN @world ; emerge -a --depclean`
    installed clang-20 and removed clang-19 as apparently not needed.
    Below is the output of `emerge -pve dev-lang/rust`.

    I'm using profile default/linux/arm64/23.0/llvm/systemd (dev). The
    USE flags I've set for dev-lang/rust are `rustfmt profiler system-
    llvm clippy system-bootstrap`.

    Is this a bug in the ebuild, that rust should explicitly depend on
    clang-19 when installed with LLVM_SLOT=19 ? Or have I messed
    something up locally? I don't think I've done anything except the
    usual `emerge -vauDN @world ; emerge -a --depclean`.

    Happy to provide other details. I was not sure what is the best way
    to show dependencies and what's installed.

    Rust doesn't depend on clang at all. The current ebuild does embed $CC
    at the time you compile rust, as the default value for

    ```
    rustc -C linker=$CC
    ```

    But for the llvm profile that should be "clang" and not "clang-19". So
    you probably changed this to a non-default value and then it broke. The
    ebuild is buggy either way, yes...


    At no point is it expected that rust explicitly depends on any specific compile. The solution is to make sure the default linker isn't specific
    to that version in the first place.

    You can also pass -C linker=clang if you like. Portage will already do
    this for rust software packaged in ::gentoo.



    --
    Eli Schwartz

    --------------yRh7JszaVXOwVVAOQgCX1q2k--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCZ9uwpgUDAAAAAAAKCRCEp9ErcA0vV5VQ AQCrkiBzDXH07VBk0edu1+yW/OQEV3RJjutg3hIV2KeyXQEApc+zItXnr0RLkfeKRGsZ1OHFhLq8 x8drGSrf4G8XvA8=
    =j/AS
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Eldredge@21:1/5 to eschwartz@gentoo.org on Thu Mar 20 17:00:01 2025
    On Mar 20, 2025, at 00:07 Eli Schwartz <eschwartz@gentoo.org> wrote:

    Rust doesn't depend on clang at all. The current ebuild does embed $CC
    at the time you compile rust, as the default value for

    ```
    rustc -C linker=$CC
    ```

    But for the llvm profile that should be "clang" and not "clang-19". So
    you probably changed this to a non-default value and then it broke. The ebuild is buggy either way, yes...

    Oh, I see. That makes sense. So now I have to figure out how $CC got set to "clang-19", since I don't think I would have done that deliberately. I'll investigate.

    At no point is it expected that rust explicitly depends on any specific compile. The solution is to make sure the default linker isn't specific
    to that version in the first place.

    You can also pass -C linker=clang if you like. Portage will already do
    this for rust software packaged in ::gentoo.

    Well, not across the board, it seems, because I became aware of the issue when dev-util/maturin failed to emerge. In the build.log (attached) we can see that some of the rustc commands use -C linker=clang but others do not, and they fail. Is that a
    separate bug?

    Thanks!

    * Package: dev-util/maturin-1.8.3:0 * Repository: gentoo * Maintainer: ionen@gentoo.org * USE: arm64 elibc_glibc kernel_linux python_targets_python3_12 ssl * 39;49;
    00mFEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox * Checking whether Rust 9999 is suitable ... * Checking for dev-lang/rust:9999 ... * Checking for dev-lang/rust-bin:9999 ... * Checking
    whether Rust 1.86.0 is suitable ... * Checking for dev-lang/rust:1.86.0 ... * Checking for dev-lang/rust-bin:1.86.0 ... * Checking whether Rust 1.85.0 is suitable ... * Checking for dev-lang/rust:1.85.0 ...
    32m* Using Rust 1.85.0 (source)>>> Unpacking source...>>> Unpacking maturin-1.8.3.gh.tar.gz to /var/tmp/portage/dev-util/maturin-1.8.3/work>>> Unpacking maturin-1.8.3-vendor.tar.xz to /var/tmp/portage/dev-util/maturin-1.8.3/work>>> Source
    unpacked in /var/tmp/portage/dev-util/maturin-1.8.3/work>>> Preparing source in /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3 ... * Build system packages: * dev-python/gpep517 : 16 * dev-python/
    installer : 0.7.0 * dev-python/setuptools : 76.1.0 * dev-python/setuptools-rust : 1.10.2-r1 * dev-python/setuptools-scm : 8.2.0 * dev-python/wheel : 0.45.1>>> Source
    prepared.>>> Configuring source in /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3 ... * Configured with: --features full --features password-storage --features native-tls --no-default-features>>> Source configured.>>> Compiling
    source in /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3 ... * python3_12: running distutils-r1_run_phase distutils-r1_python_compile * Building the wheel for maturin-1.8.3 via setuptools.build_metacargo_env python3.12 -
    m gpep517 build-wheel --prefix=/usr --backend setuptools.build_meta --output-fd 3 --wheel-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel2025-03-20 09:40:23,512 gpep517 INFO Building wheel via backend setuptools.build_
    meta2025-03-20 09:40:23,641 root INFO running bdist_wheel2025-03-20 09:40:23,666 root INFO running build2025-03-20 09:40:23,666 root INFO running build_py2025-03-20 09:40:23,672 root INFO creating /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-
    1.8.3-python3_12/build/lib/maturin2025-03-20 09:40:23,672 root INFO copying maturin/__init__.py -> /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin2025-03-20 09:40:23,672 root INFO copying maturin/__main__.py -> /
    var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin2025-03-20 09:40:23,672 root INFO running egg_info2025-03-20 09:40:23,677 root INFO creating maturin.egg-info2025-03-20 09:40:23,677 root INFO writing maturin.egg-
    info/PKG-INFO2025-03-20 09:40:23,678 root INFO writing dependency_links to maturin.egg-info/dependency_links.txt2025-03-20 09:40:23,678 root INFO writing requirements to maturin.egg-info/requires.txt2025-03-20 09:40:23,678 root INFO writing top-level
    names to maturin.egg-info/top_level.txt2025-03-20 09:40:23,679 root INFO writing manifest file 'maturin.egg-info/SOURCES.txt'ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any2025-03-20 09:40:23,701 root INFO
    reading manifest file 'maturin.egg-info/SOURCES.txt'2025-03-20 09:40:23,702 root INFO reading manifest template 'MANIFEST.in'2025-03-20 09:40:23,706 root WARNING warning: no files found matching '*.json' under directory 'src/python_interpreter'2025-03-
    20 09:40:23,707 root INFO writing manifest file 'maturin.egg-info/SOURCES.txt'2025-03-20 09:40:23,708 root WARNING warning: build_py: byte-compiling is disabled, skipping.2025-03-20 09:40:23,718 root INFO installing to /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel2025-03-20 09:40:23,718 root INFO running install2025-03-20 09:40:23,727 root INFO running install_lib2025-03-20 09:40:23,734 root INFO creating /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib2025-03-20 09:40:23,736 root INFO creating /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/
    maturin-1.8.3.data/purelib/maturin2025-03-20 09:40:23,736 root INFO copying /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin/__init__.py -> /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/
    build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib/maturin2025-03-20 09:40:23,736 root INFO copying /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin/__main__.py -> /var/tmp/portage/dev-util/maturin-1.8.3/
    work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib/maturin2025-03-20 09:40:23,737 root WARNING warning: install_lib: byte-compiling is disabled, skipping.2025-03-20 09:40:23,737 root INFO running install_egg_info
    2025-03-20 09:40:23,742 root INFO Copying maturin.egg-info to /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib/maturin-1.8.3-py3.12.egg-info2025-03-20 09:40:23,743 root INFO
    running install_scripts2025-03-20 09:40:23,750 root INFO creating /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.dist-info/WHEEL2025-03-20 09:40:23,750 wheel INFO creating '/var/tmp/
    portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/.tmp-5xcys0pu/maturin-1.8.3-cp312-cp312-linux_aarch64.whl' and adding '/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel' to it2025-03-
    20 09:40:23,751 wheel INFO adding 'maturin-1.8.3.data/purelib/maturin/__init__.py'2025-03-20 09:40:23,751 wheel INFO adding 'maturin-1.8.3.data/purelib/maturin/__main__.py'2025-03-20 09:40:23,751 wheel INFO adding 'maturin-1.8.3.dist-info/METADATA'
    2025-03-20 09:40:23,751 wheel INFO adding 'maturin-1.8.3.dist-info/WHEEL'2025-03-20 09:40:23,751 wheel INFO adding 'maturin-1.8.3.dist-info/top_level.txt'2025-03-20 09:40:23,751 wheel INFO adding 'maturin-1.8.3.dist-info/RECORD'2025-03-20 09:40:23,752
    root INFO removing /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel2025-03-20 09:40:23,753 gpep517 INFO The backend produced /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/
    maturin-1.8.3-cp312-cp312-linux_aarch64.whl * Installing maturin-1.8.3-cp312-cp312-linux_aarch64.whl to /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/installpython3.12 -m gpep517 install-wheel --destdir=/var/tmp/
    portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/install --interpreter=/usr/bin/python3.12 --prefix=/usr --optimize=all /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/maturin-1.8.3-cp312-cp312-linux_aarch64.whl
    2025-03-20 09:40:23,864 gpep517 INFO Installing /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/maturin-1.8.3-cp312-cp312-linux_aarch64.whl into /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/install
    2025-03-20 09:40:23,873 gpep517 INFO Installation complete * Using python3.12 in global scope * python3_12: running distutils-r1_run_phase python_compile_all * /usr/lib/rust/1.85.0/bin/cargo build --release --features full --
    features password-storage --features native-tls --no-default-features Compiling proc-macro2 v1.0.92 Compiling unicode-ident v1.0.12 Compiling libc v0.2.167 Compiling cfg-if v1.0.0 Compiling shlex v1.3.0 Compiling serde v1.0.217
    Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name unicode_ident --edition=2018 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/unicode-ident-1.0.12/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-
    incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=off --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=1375ca1a6199e31c -C extra-filename=-0e80abeb425a2f67 --out-dir /var/tmp/
    portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow` Running `/usr/lib/rust/1.85.0/bin/rustc --crate-
    name build_script_build --edition=2021 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/proc-macro2-1.0.92/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C
    embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="proc-macro"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "nightly", "proc-macro", "span-locations"))' -C metadata=0e81ff72b9187942 -C extra-
    filename=-888329b5f3018591 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/build/proc-macro2-888329b5f3018591 -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/
    deps --cap-lints allow` Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --edition=2018 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/serde-1.0.217/build.rs --error-format=json --json=diagnostic-rendered-
    ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="rc"' --cfg 'feature="serde_derive"' --cfg 'feature="std"' --check-cfg 'cfg(
    docsrs,test)' --check-cfg 'cfg(feature, values("alloc", "default", "derive", "rc", "serde_derive", "std", "unstable"))' -C metadata=3f8e63ac45668085 -C extra-filename=-bba9de3227c1888f --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/
    target/release/build/serde-bba9de3227c1888f -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow` Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --
    edition=2021 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/libc-0.2.167/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-
    assertions=off --cfg 'feature="default"' --cfg 'feature="std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("align", "const-extern-fn", "default", "extra_traits", "rustc-dep-of-std", "rustc-std-workspace-core", "std", "use_std"))' -C
    metadata=81cb30f65e8458f4 -C extra-filename=-afdccc31164d0e70 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/build/libc-afdccc31164d0e70 -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/
    maturin-1.8.3/target/release/deps --cap-lints allow` Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name shlex --edition=2015 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/shlex-1.3.0/src/lib.rs --error-format=json --json=
    diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("
    default", "std"))' -C metadata=0a102e22a29d200c -C extra-filename=-217b992af082d2b4 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/
    maturin-1.8.3/target/release/deps --cap-lints allow` Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name cfg_if --edition=2018 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/cfg-if-1.0.0/src/lib.rs --error-format=json --json=
    diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("compiler_builtins", "core", "rustc-dep-of-std"))' -C
    metadata=6020da63e1c4fb40 -C extra-filename=-7ca88ac2d0658a11 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/aarch64-unknown-linux-gnu/release/deps --target aarch64-unknown-linux-gnu -C strip=debuginfo -L dependency=/var/tmp/
    portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/aarch64-unknown-linux-gnu/release/deps -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow -C strip=none -C linker=clang -C target-feature=
    -crt-static -C link-arg=-Wl,-O1 -C link-arg=-Wl,--as-needed -C link-arg=-Wl,--as-needed -C opt-level=2 -C target-cpu=apple-m3` Compiling version_check v0.9.4 Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name version_check --edition=2015 /var/
    tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/version_check-0.9.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-
    assertions=off --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=0ad60a37f5f1dd03 -C extra-filename=-2ba110150515c9ce --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps -C strip=
    debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow` Compiling once_cell v1.20.2 Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name once_cell --edition=2021 /var/tmp/portage/
    dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/once_cell-1.20.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="
    alloc"' --cfg 'feature="default"' --cfg 'feature="race"' --cfg 'feature="std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("alloc", "atomic-polyfill", "critical-section", "default", "parking_lot", "portable-atomic", "race", "std", "
    unstable"))' -C metadata=01b7ec3b26924a89 -C extra-filename=-8730246110ac63a2 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/aarch64-unknown-linux-gnu/release/deps --target aarch64-unknown-linux-gnu -C strip=debuginfo -L
    dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/aarch64-unknown-linux-gnu/release/deps -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow -C strip=none -C linker=
    clang -C target-feature=-crt-static -C link-arg=-Wl,-O1 -C link-arg=-Wl,--as-needed -C link-arg=-Wl,--as-needed -C opt-level=2 -C target-cpu=apple-m3`error: linker `clang-19` not found | = note: No such file or directory (os error 2)error: could
    not compile `proc-macro2` (build script) due to 1 previous errorCaused by: process didn't exit successfully: `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --edition=2021 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/
    vendor/proc-macro2-1.0.92/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="proc-macro"' --
    check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "nightly", "proc-macro", "span-locations"))' -C metadata=0e81ff72b9187942 -C extra-filename=-888329b5f3018591 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/
    target/release/build/proc-macro2-888329b5f3018591 -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow` (exit status: 1)warning: build failed, waiting for other jobs to finish..
    .error: could not compile `serde` (build script) due to 1 previous errorCaused by: process didn't exit successfully: `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --edition=2018 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-
    1.8.3/vendor/serde-1.0.217/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="derive"' --cfg '
    feature="rc"' --cfg 'feature="serde_derive"' --cfg 'feature="std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("alloc", "default", "derive", "rc", "serde_derive", "std", "unstable"))' -C metadata=3f8e63ac45668085 -C extra-filename=-
    bba9de3227c1888f --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/build/serde-bba9de3227c1888f -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints
    allow` (exit status: 1)error: could not compile `libc` (build script) due to 1 previous errorCaused by: process didn't exit successfully: `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --edition=2021 /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3/vendor/libc-0.2.167/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg '
    feature="std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("align", "const-extern-fn", "default", "extra_traits", "rustc-dep-of-std", "rustc-std-workspace-core", "std", "use_std"))' -C metadata=81cb30f65e8458f4 -C extra-filename=-
    afdccc31164d0e70 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/build/libc-afdccc31164d0e70 -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints
    allow` (exit status: 1) * ERROR: dev-util/maturin-1.8.3::gentoo failed (compile phase): * cargo build failed * * Call stack: * ebuild.sh, line 136: Called src_compile *
    0m environment, line 4368: Called distutils-r1_src_compile * environment, line 2270: Called _distutils-r1_run_common_phase 'python_compile_all' * environment, line 746: Called multibuild_foreach_variant 'distutils-r1_
    run_phase' 'python_compile_all' * environment, line 3347: Called _multibuild_run 'distutils-r1_run_phase' 'python_compile_all' * environment, line 3345: Called distutils-r1_run_phase 'python_compile_all' *
    environment, line 2249: Called python_compile_all * environment, line 3618: Called cargo_src_compile * environment, line 1912: Called die * The specific snippet of code: * cargo_env "${@}" |
    | die "cargo build failed" * * If you need support, post the output of `emerge --info '=dev-util/maturin-1.8.3::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-util/maturin-1.8.3::gentoo'`.
    * The complete build log is located at '/var/tmp/portage/dev-util/maturin-1.8.3/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-util/maturin-1.8.3/temp/environment'. * Working
    directory: '/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3' * S: '/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Eldredge@21:1/5 to All on Thu Mar 20 18:10:01 2025
    On Mar 20, 2025, at 10:45, Eli Schwartz <eschwartz@gentoo.org> wrote:

    On 3/20/25 11:54 AM, Nate Eldredge wrote:
    On Mar 20, 2025, at 00:07 Eli Schwartz <eschwartz@gentoo.org> wrote:
    You can also pass -C linker=clang if you like. Portage will
    already do this for rust software packaged in ::gentoo.

    Well, not across the board, it seems, because I became aware of the
    issue when dev-util/maturin failed to emerge. In the build.log
    (attached) we can see that some of the rustc commands use -C
    linker=clang but others do not, and they fail. Is that a separate
    bug?


    Your build.log confuses me.


    Same `cargo build` run, but -C linker is not being passed to proc
    macros? or?

    They might not be the same run; I have MAKEOPTS="-j6 -l6.2" so it could be two separate `cargo build` in parallel. Sorry for the confusion. Here's a simpler build.log with MAKEOPTS="". Here proc-macro2 is built first, and it fails.


    * Package: dev-util/maturin-1.8.3:0 * Repository: gentoo * Maintainer: ionen@gentoo.org * USE: arm64 elibc_glibc kernel_linux python_targets_python3_12 ssl * 39;49;
    00mFEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox * Checking whether Rust 9999 is suitable ... * Checking for dev-lang/rust:9999 ... * Checking for dev-lang/rust-bin:9999 ... * Checking
    whether Rust 1.86.0 is suitable ... * Checking for dev-lang/rust:1.86.0 ... * Checking for dev-lang/rust-bin:1.86.0 ... * Checking whether Rust 1.85.0 is suitable ... * Checking for dev-lang/rust:1.85.0 ...
    32m* Using Rust 1.85.0 (source)>>> Unpacking source...>>> Unpacking maturin-1.8.3.gh.tar.gz to /var/tmp/portage/dev-util/maturin-1.8.3/work>>> Unpacking maturin-1.8.3-vendor.tar.xz to /var/tmp/portage/dev-util/maturin-1.8.3/work>>> Source
    unpacked in /var/tmp/portage/dev-util/maturin-1.8.3/work>>> Preparing source in /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3 ... * Build system packages: * dev-python/gpep517 : 16 * dev-python/
    installer : 0.7.0 * dev-python/setuptools : 76.1.0 * dev-python/setuptools-rust : 1.10.2-r1 * dev-python/setuptools-scm : 8.2.0 * dev-python/wheel : 0.45.1>>> Source
    prepared.>>> Configuring source in /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3 ... * Configured with: --features full --features password-storage --features native-tls --no-default-features>>> Source configured.>>> Compiling
    source in /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3 ... * python3_12: running distutils-r1_run_phase distutils-r1_python_compile * Building the wheel for maturin-1.8.3 via setuptools.build_metacargo_env python3.12 -
    m gpep517 build-wheel --prefix=/usr --backend setuptools.build_meta --output-fd 3 --wheel-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel2025-03-20 10:58:43,782 gpep517 INFO Building wheel via backend setuptools.build_
    meta2025-03-20 10:58:43,907 root INFO running bdist_wheel2025-03-20 10:58:43,932 root INFO running build2025-03-20 10:58:43,932 root INFO running build_py2025-03-20 10:58:43,937 root INFO creating /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-
    1.8.3-python3_12/build/lib/maturin2025-03-20 10:58:43,937 root INFO copying maturin/__init__.py -> /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin2025-03-20 10:58:43,937 root INFO copying maturin/__main__.py -> /
    var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin2025-03-20 10:58:43,938 root INFO running egg_info2025-03-20 10:58:43,943 root INFO creating maturin.egg-info2025-03-20 10:58:43,943 root INFO writing maturin.egg-
    info/PKG-INFO2025-03-20 10:58:43,944 root INFO writing dependency_links to maturin.egg-info/dependency_links.txt2025-03-20 10:58:43,944 root INFO writing requirements to maturin.egg-info/requires.txt2025-03-20 10:58:43,944 root INFO writing top-level
    names to maturin.egg-info/top_level.txt2025-03-20 10:58:43,944 root INFO writing manifest file 'maturin.egg-info/SOURCES.txt'ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any2025-03-20 10:58:43,966 root INFO
    reading manifest file 'maturin.egg-info/SOURCES.txt'2025-03-20 10:58:43,966 root INFO reading manifest template 'MANIFEST.in'2025-03-20 10:58:43,970 root WARNING warning: no files found matching '*.json' under directory 'src/python_interpreter'2025-03-
    20 10:58:43,972 root INFO writing manifest file 'maturin.egg-info/SOURCES.txt'2025-03-20 10:58:43,973 root WARNING warning: build_py: byte-compiling is disabled, skipping.2025-03-20 10:58:43,983 root INFO installing to /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel2025-03-20 10:58:43,983 root INFO running install2025-03-20 10:58:43,991 root INFO running install_lib2025-03-20 10:58:43,996 root INFO creating /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib2025-03-20 10:58:43,997 root INFO creating /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/
    maturin-1.8.3.data/purelib/maturin2025-03-20 10:58:43,997 root INFO copying /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin/__init__.py -> /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/
    build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib/maturin2025-03-20 10:58:43,997 root INFO copying /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin/__main__.py -> /var/tmp/portage/dev-util/maturin-1.8.3/
    work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib/maturin2025-03-20 10:58:43,997 root WARNING warning: install_lib: byte-compiling is disabled, skipping.2025-03-20 10:58:43,997 root INFO running install_egg_info
    2025-03-20 10:58:44,002 root INFO Copying maturin.egg-info to /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib/maturin-1.8.3-py3.12.egg-info2025-03-20 10:58:44,003 root INFO
    running install_scripts2025-03-20 10:58:44,009 root INFO creating /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.dist-info/WHEEL2025-03-20 10:58:44,010 wheel INFO creating '/var/tmp/
    portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/.tmp-vfz35zl4/maturin-1.8.3-cp312-cp312-linux_aarch64.whl' and adding '/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel' to it2025-03-
    20 10:58:44,010 wheel INFO adding 'maturin-1.8.3.data/purelib/maturin/__init__.py'2025-03-20 10:58:44,010 wheel INFO adding 'maturin-1.8.3.data/purelib/maturin/__main__.py'2025-03-20 10:58:44,011 wheel INFO adding 'maturin-1.8.3.dist-info/METADATA'
    2025-03-20 10:58:44,011 wheel INFO adding 'maturin-1.8.3.dist-info/WHEEL'2025-03-20 10:58:44,011 wheel INFO adding 'maturin-1.8.3.dist-info/top_level.txt'2025-03-20 10:58:44,011 wheel INFO adding 'maturin-1.8.3.dist-info/RECORD'2025-03-20 10:58:44,011
    root INFO removing /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel2025-03-20 10:58:44,012 gpep517 INFO The backend produced /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/
    maturin-1.8.3-cp312-cp312-linux_aarch64.whl * Installing maturin-1.8.3-cp312-cp312-linux_aarch64.whl to /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/installpython3.12 -m gpep517 install-wheel --destdir=/var/tmp/
    portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/install --interpreter=/usr/bin/python3.12 --prefix=/usr --optimize=all /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/maturin-1.8.3-cp312-cp312-linux_aarch64.whl
    2025-03-20 10:58:44,115 gpep517 INFO Installing /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/maturin-1.8.3-cp312-cp312-linux_aarch64.whl into /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/install
    2025-03-20 10:58:44,124 gpep517 INFO Installation complete * Using python3.12 in global scope * python3_12: running distutils-r1_run_phase python_compile_all * /usr/lib/rust/1.85.0/bin/cargo build --release --features full --
    features password-storage --features native-tls --no-default-features Compiling proc-macro2 v1.0.92 Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --edition=2021 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/
    vendor/proc-macro2-1.0.92/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="proc-macro"' --
    check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "nightly", "proc-macro", "span-locations"))' -C metadata=0e81ff72b9187942 -C extra-filename=-888329b5f3018591 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/
    target/release/build/proc-macro2-888329b5f3018591 -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow`error: linker `clang-19` not found | = note: No such file or
    directory (os error 2)error: could not compile `proc-macro2` (build script) due to 1 previous errorCaused by: process didn't exit successfully: `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --edition=2021 /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3/vendor/proc-macro2-1.0.92/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' -
    -cfg 'feature="proc-macro"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "nightly", "proc-macro", "span-locations"))' -C metadata=0e81ff72b9187942 -C extra-filename=-888329b5f3018591 --out-dir /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3/target/release/build/proc-macro2-888329b5f3018591 -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow` (exit status: 1) * ERROR:
    dev-util/maturin-1.8.3::gentoo failed (compile phase): * cargo build failed * * Call stack: * ebuild.sh, line 136: Called src_compile * environment, line 4369: Called distutils-
    r1_src_compile * environment, line 2271: Called _distutils-r1_run_common_phase 'python_compile_all' * environment, line 747: Called multibuild_foreach_variant 'distutils-r1_run_phase' 'python_compile_all' *
    environment, line 3348: Called _multibuild_run 'distutils-r1_run_phase' 'python_compile_all' * environment, line 3346: Called distutils-r1_run_phase 'python_compile_all' * environment, line 2250: Called python_compile_all
    * environment, line 3619: Called cargo_src_compile * environment, line 1913: Called die * The specific snippet of code: * cargo_env "${@}" || die "cargo build failed" * 31;
    01m* If you need support, post the output of `emerge --info '=dev-util/maturin-1.8.3::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-util/maturin-1.8.3::gentoo'`. * The complete build log is located
    at '/var/tmp/portage/dev-util/maturin-1.8.3/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-util/maturin-1.8.3/temp/environment'. * Working directory: '/var/tmp/portage/dev-util/maturin-1.8.3/
    work/maturin-1.8.3' * S: '/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3'
    Thanks again for looking at this.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli Schwartz@21:1/5 to Nate Eldredge on Thu Mar 20 17:50:01 2025
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------UupfymTy76Of0aQgf1ilSTpG
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 3/20/25 11:54 AM, Nate Eldredge wrote:
    On Mar 20, 2025, at 00:07 Eli Schwartz <eschwartz@gentoo.org> wrote:
    You can also pass -C linker=clang if you like. Portage will
    already do this for rust software packaged in ::gentoo.

    Well, not across the board, it seems, because I became aware of the
    issue when dev-util/maturin failed to emerge. In the build.log
    (attached) we can see that some of the rustc commands use -C
    linker=clang but others do not, and they fail. Is that a separate
    bug?


    Your build.log confuses me.


    This works:

    ```
    Compiling once_cell v1.20.2
    Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name once_cell --edition=2021 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/once_cell-1.20.2/src/lib.rs
    --error-format=json
    --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type
    lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no
    --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="race"'
    --cfg 'feature="std"' --check-cfg 'cfg(docsrs,test)' --check-cfg
    'cfg(feature, values("alloc", "atomic-polyfill", "critical-section",
    "default", "parking_lot", "portable-atomic", "race", "std",
    "unstable"))' -C metadata=01b7ec3b26924a89 -C
    extra-filename=-8730246110ac63a2 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/aarch64-unknown-linux-gnu/release/deps
    --target aarch64-unknown-linux-gnu -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/aarch64-unknown-linux-gnu/release/deps
    -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps
    --cap-lints allow -C strip=none -C linker=clang -C
    target-feature=-crt-static -C link-arg=-Wl,-O1 -C
    link-arg=-Wl,--as-needed -C link-arg=-Wl,--as-needed -C opt-level=2 -C target-cpu=apple-m3`
    ```


    This fails:

    ```
    error: linker `clang-19` not found
    |
    = note: No such file or directory (os error 2)

    error: could not compile `proc-macro2` (build script) due to 1 previous
    error

    Caused by:
    process didn't exit successfully: `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --edition=2021 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/vendor/proc-macro2-1.0.92/build.rs
    --error-format=json
    --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type
    bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off
    --cfg 'feature="default"' --cfg 'feature="proc-macro"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default",
    "nightly", "proc-macro", "span-locations"))' -C
    metadata=0e81ff72b9187942 -C extra-filename=-888329b5f3018591 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/build/proc-macro2-888329b5f3018591
    -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps
    --cap-lints allow` (exit status: 1)
    ```


    Same `cargo build` run, but -C linker is not being passed to proc
    macros? or?



    --
    Eli Schwartz

    --------------UupfymTy76Of0aQgf1ilSTpG--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCZ9xGLgUDAAAAAAAKCRCEp9ErcA0vV0xJ AQC1BEufQIwAPmxfV9GqA5YY7LpLTb9cFDLTw8b4UQY4HwEA8O2V9YP5+JPDHz5FXXUlKNJUI8F7 hpu8r5y4o5iYxg0=
    =sZtz
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nate Eldredge@21:1/5 to All on Fri Mar 21 07:40:02 2025
    I see that there's been a fix committed, to have rust not use the value of $CC for its linker. Thanks Sam!

    https://github.com/gentoo/gentoo/commit/f65ef3fddd9ef9cc3d2d172f6da9a39231b1e2d1#diff-dbba975de76b74289aaec5ad12154eaf03e0ce9a8cfd09ff73b8a0d5536a3a9b

    On my system it now calls aarch64-unknown-linux-gnu-cc as its linker, which gives us GNU ld instead of llvm's. Was this intentional and is it supported? I'm not that familiar with rustc. It does seem a little odd to use GNU ld on an llvm profile, but
    maybe it's fine.

    For the record, the setting of CC=clang-19 wasn't my own doing. It seems that this happens with USE=system-llvm. In this case, the rust ebuild calls `llvm-r1_pkg_setup`, which calls `llvm_fix_clang_version CC CPP CXX`, which rewrites those environment
    variables to use the version-numbered clang binary.

    https://github.com/gentoo/gentoo/blob/f65ef3fddd9ef9cc3d2d172f6da9a39231b1e2d1/dev-lang/rust/rust-1.85.1.ebuild#L287
    https://github.com/gentoo/gentoo/blob/f65ef3fddd9ef9cc3d2d172f6da9a39231b1e2d1/eclass/llvm-r1.eclass#L238
    https://github.com/gentoo/gentoo/blob/f65ef3fddd9ef9cc3d2d172f6da9a39231b1e2d1/eclass/llvm-utils.eclass#L63

    Thanks again, everyone.

    On Mar 20, 2025, at 11:04, Nate Eldredge <nate@thatsmathematics.com> wrote:



    On Mar 20, 2025, at 10:45, Eli Schwartz <eschwartz@gentoo.org> wrote:

    On 3/20/25 11:54 AM, Nate Eldredge wrote:
    On Mar 20, 2025, at 00:07 Eli Schwartz <eschwartz@gentoo.org> wrote:
    You can also pass -C linker=clang if you like. Portage will
    already do this for rust software packaged in ::gentoo.

    Well, not across the board, it seems, because I became aware of the
    issue when dev-util/maturin failed to emerge. In the build.log
    (attached) we can see that some of the rustc commands use -C
    linker=clang but others do not, and they fail. Is that a separate
    bug?


    Your build.log confuses me.


    Same `cargo build` run, but -C linker is not being passed to proc
    macros? or?

    They might not be the same run; I have MAKEOPTS="-j6 -l6.2" so it could be two separate `cargo build` in parallel. Sorry for the confusion. Here's a simpler build.log with MAKEOPTS="". Here proc-macro2 is built first, and it fails.


    * Package: dev-util/maturin-1.8.3:0 * Repository: gentoo * Maintainer: ionen@gentoo.org * USE: arm64 elibc_glibc kernel_linux python_targets_python3_12 ssl * 39;49;
    00mFEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox * Checking whether Rust 9999 is suitable ... * Checking for dev-lang/rust:9999 ... * Checking for dev-lang/rust-bin:9999 ... * Checking
    whether Rust 1.86.0 is suitable ... * Checking for dev-lang/rust:1.86.0 ... * Checking for dev-lang/rust-bin:1.86.0 ... * Checking whether Rust 1.85.0 is suitable ... * Checking for dev-lang/rust:1.85.0 ...
    32m* Using Rust 1.85.0 (source)>>> Unpacking source...>>> Unpacking maturin-1.8.3.gh.tar.gz to /var/tmp/portage/dev-util/maturin-1.8.3/work>>> Unpacking maturin-1.8.3-vendor.tar.xz to /var/tmp/portage/dev-util/maturin-1.8.3/work>>> Source
    unpacked in /var/tmp/portage/dev-util/maturin-1.8.3/work>>> Preparing source in /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3 ... * Build system packages: * dev-python/gpep517 : 16 * dev-python/
    installer : 0.7.0 * dev-python/setuptools : 76.1.0 * dev-python/setuptools-rust : 1.10.2-r1 * dev-python/setuptools-scm : 8.2.0 * dev-python/wheel : 0.45.1>>> Source
    prepared.>>> Configuring source in /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3 ... * Configured with: --features full --features password-storage --features native-tls --no-default-features>>> Source configured.>>> Compiling
    source in /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3 ... * python3_12: running distutils-r1_run_phase distutils-r1_python_compile * Building the wheel for maturin-1.8.3 via setuptools.build_metacargo_env python3.12 -
    m gpep517 build-wheel --prefix=/usr --backend setuptools.build_meta --output-fd 3 --wheel-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel2025-03-20 10:58:43,782 gpep517 INFO Building wheel via backend setuptools.build_
    meta2025-03-20 10:58:43,907 root INFO running bdist_wheel2025-03-20 10:58:43,932 root INFO running build2025-03-20 10:58:43,932 root INFO running build_py2025-03-20 10:58:43,937 root INFO creating /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-
    1.8.3-python3_12/build/lib/maturin2025-03-20 10:58:43,937 root INFO copying maturin/__init__.py -> /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin2025-03-20 10:58:43,937 root INFO copying maturin/__main__.py -> /
    var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin2025-03-20 10:58:43,938 root INFO running egg_info2025-03-20 10:58:43,943 root INFO creating maturin.egg-info2025-03-20 10:58:43,943 root INFO writing maturin.egg-
    info/PKG-INFO2025-03-20 10:58:43,944 root INFO writing dependency_links to maturin.egg-info/dependency_links.txt2025-03-20 10:58:43,944 root INFO writing requirements to maturin.egg-info/requires.txt2025-03-20 10:58:43,944 root INFO writing top-level
    names to maturin.egg-info/top_level.txt2025-03-20 10:58:43,944 root INFO writing manifest file 'maturin.egg-info/SOURCES.txt'ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any2025-03-20 10:58:43,966 root INFO
    reading manifest file 'maturin.egg-info/SOURCES.txt'2025-03-20 10:58:43,966 root INFO reading manifest template 'MANIFEST.in'2025-03-20 10:58:43,970 root WARNING warning: no files found matching '*.json' under directory 'src/python_interpreter'2025-03-
    20 10:58:43,972 root INFO writing manifest file 'maturin.egg-info/SOURCES.txt'2025-03-20 10:58:43,973 root WARNING warning: build_py: byte-compiling is disabled, skipping.2025-03-20 10:58:43,983 root INFO installing to /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel2025-03-20 10:58:43,983 root INFO running install2025-03-20 10:58:43,991 root INFO running install_lib2025-03-20 10:58:43,996 root INFO creating /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib2025-03-20 10:58:43,997 root INFO creating /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/
    maturin-1.8.3.data/purelib/maturin2025-03-20 10:58:43,997 root INFO copying /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin/__init__.py -> /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/
    build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib/maturin2025-03-20 10:58:43,997 root INFO copying /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/lib/maturin/__main__.py -> /var/tmp/portage/dev-util/maturin-1.8.3/
    work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib/maturin2025-03-20 10:58:43,997 root WARNING warning: install_lib: byte-compiling is disabled, skipping.2025-03-20 10:58:43,997 root INFO running install_egg_info
    2025-03-20 10:58:44,002 root INFO Copying maturin.egg-info to /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.data/purelib/maturin-1.8.3-py3.12.egg-info2025-03-20 10:58:44,003 root INFO
    running install_scripts2025-03-20 10:58:44,009 root INFO creating /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel/maturin-1.8.3.dist-info/WHEEL2025-03-20 10:58:44,010 wheel INFO creating '/var/tmp/
    portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/.tmp-vfz35zl4/maturin-1.8.3-cp312-cp312-linux_aarch64.whl' and adding '/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel' to it2025-03-
    20 10:58:44,010 wheel INFO adding 'maturin-1.8.3.data/purelib/maturin/__init__.py'2025-03-20 10:58:44,010 wheel INFO adding 'maturin-1.8.3.data/purelib/maturin/__main__.py'2025-03-20 10:58:44,011 wheel INFO adding 'maturin-1.8.3.dist-info/METADATA'
    2025-03-20 10:58:44,011 wheel INFO adding 'maturin-1.8.3.dist-info/WHEEL'2025-03-20 10:58:44,011 wheel INFO adding 'maturin-1.8.3.dist-info/top_level.txt'2025-03-20 10:58:44,011 wheel INFO adding 'maturin-1.8.3.dist-info/RECORD'2025-03-20 10:58:44,011
    root INFO removing /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/build/bdist.linux-aarch64/wheel2025-03-20 10:58:44,012 gpep517 INFO The backend produced /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/
    maturin-1.8.3-cp312-cp312-linux_aarch64.whl * Installing maturin-1.8.3-cp312-cp312-linux_aarch64.whl to /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/installpython3.12 -m gpep517 install-wheel --destdir=/var/tmp/
    portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/install --interpreter=/usr/bin/python3.12 --prefix=/usr --optimize=all /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/maturin-1.8.3-cp312-cp312-linux_aarch64.whl
    2025-03-20 10:58:44,115 gpep517 INFO Installing /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/wheel/maturin-1.8.3-cp312-cp312-linux_aarch64.whl into /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3-python3_12/install
    2025-03-20 10:58:44,124 gpep517 INFO Installation complete * Using python3.12 in global scope * python3_12: running distutils-r1_run_phase python_compile_all * /usr/lib/rust/1.85.0/bin/cargo build --release --features full --
    features password-storage --features native-tls --no-default-features Compiling proc-macro2 v1.0.92 Running `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --edition=2021 /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/
    vendor/proc-macro2-1.0.92/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="proc-macro"' --
    check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "nightly", "proc-macro", "span-locations"))' -C metadata=0e81ff72b9187942 -C extra-filename=-888329b5f3018591 --out-dir /var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/
    target/release/build/proc-macro2-888329b5f3018591 -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow`error: linker `clang-19` not found | = note: No such file or
    directory (os error 2)error: could not compile `proc-macro2` (build script) due to 1 previous errorCaused by: process didn't exit successfully: `/usr/lib/rust/1.85.0/bin/rustc --crate-name build_script_build --edition=2021 /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3/vendor/proc-macro2-1.0.92/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' -
    -cfg 'feature="proc-macro"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "nightly", "proc-macro", "span-locations"))' -C metadata=0e81ff72b9187942 -C extra-filename=-888329b5f3018591 --out-dir /var/tmp/portage/dev-util/
    maturin-1.8.3/work/maturin-1.8.3/target/release/build/proc-macro2-888329b5f3018591 -C strip=debuginfo -L dependency=/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3/target/release/deps --cap-lints allow` (exit status: 1) * ERROR:
    dev-util/maturin-1.8.3::gentoo failed (compile phase): * cargo build failed * * Call stack: * ebuild.sh, line 136: Called src_compile * environment, line 4369: Called distutils-
    r1_src_compile * environment, line 2271: Called _distutils-r1_run_common_phase 'python_compile_all' * environment, line 747: Called multibuild_foreach_variant 'distutils-r1_run_phase' 'python_compile_all' *
    environment, line 3348: Called _multibuild_run 'distutils-r1_run_phase' 'python_compile_all' * environment, line 3346: Called distutils-r1_run_phase 'python_compile_all' * environment, line 2250: Called python_compile_all
    * environment, line 3619: Called cargo_src_compile * environment, line 1913: Called die * The specific snippet of code: * cargo_env "${@}" || die "cargo build failed" * 31;
    01m* If you need support, post the output of `emerge --info '=dev-util/maturin-1.8.3::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-util/maturin-1.8.3::gentoo'`. * The complete build log is located
    at '/var/tmp/portage/dev-util/maturin-1.8.3/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-util/maturin-1.8.3/temp/environment'. * Working directory: '/var/tmp/portage/dev-util/maturin-1.8.3/
    work/maturin-1.8.3' * S: '/var/tmp/portage/dev-util/maturin-1.8.3/work/maturin-1.8.3'

    Thanks again for looking at this.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)