Kamil Zaripov 859c24dfc8 rustc: Fix cross-compilation for the targets with dot in name
When you are trying to cross-compile rustc to the target platform with
the dot in name, e.g. "thumb8vm.main-none-eabi", rustc compilation fails
with this error during configuration:

    armv8m-unknown-none-eabi-rustc> Running phase: configurePhase
    armv8m-unknown-none-eabi-rustc> patching script interpreter paths in ./configure
    armv8m-unknown-none-eabi-rustc> ./configure: interpreter directive changed from "#!/bin/sh" to "/nix/store/ih68ar79msmj0496pgld4r3vqfr7bbin-bash-5.2p37/bin/sh"
    armv8m-unknown-none-eabi-rustc> configure flags: --prefix=/nix/store/wscr78z0s5v2hxx3p1n4qjgjnds8dm0g-armv8m-unknown-none-eabi-rustc-1.86.0 --sysconfdir=/nix/store/wscr78z0s5v2hxx3p1n4qjgjnds8dm0g-armv8m-unknown-none-eabi-rustc-1.86.0/etc --release-channel=stable --set=build.rustc=/nix/store/f9zdz15l2zd408yq7a3bgrj593kpwjqx-rustc-wrapper-1.86.0/bin/rustc --set=build.cargo=/nix/store/ygri5mmqmril5ll9lhawa01faa2qhdvd-cargo-1.86.0/bin/cargo --tools=rustc\,rustdoc\,rust-analyzer-proc-macro-srv --enable-rpath --enable-vendor --disable-lld --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=thumbv8m.main-none-eabi --set=target.x86_64-unknown-linux-gnu.cc=/nix/store/a0d7m3zn9p2dfa1h7ag9h2wzzr2w25sn-gcc-wrapper-14.2.1.20250322/bin/cc --set=target.x86_64-unknown-linux-gnu.cc=/nix/store/a0d7m3zn9p2dfa1h7ag9h2wzzr2w25sn-gcc-wrapper-14.2.1.20250322/bin/cc --set=target.thumbv8m.main-none-eabi.cc=/nix/store/wnnwk5vknch7d8jy3cdykbsnn5qrmjj3-armv8m-unknown-none-eabi-gcc-wrapper-14.2.1.20250322/bin/armv8m-unknown-none-eabi-cc --set=target.thumbv8m.main-none-eabi.linker=/nix/store/wnnwk5vknch7d8jy3cdykbsnn5qrmjj3-armv8m-unknown-none-eabi-gcc-wrapper-14.2.1.20250322/bin/armv8m-unknown-none-eabi-cc --set=target.x86_64-unknown-linux-gnu.linker=/nix/store/a0d7m3zn9p2dfa1h7ag9h2wzzr2w25sn-gcc-wrapper-14.2.1.20250322/bin/cc --set=target.x86_64-unknown-linux-gnu.linker=/nix/store/a0d7m3zn9p2dfa1h7ag9h2wzzr2w25sn-gcc-wrapper-14.2.1.20250322/bin/cc --set=target.x86_64-unknown-linux-gnu.cxx=/nix/store/a0d7m3zn9p2dfa1h7ag9h2wzzr2w25sn-gcc-wrapper-14.2.1.20250322/bin/c++ --set=target.x86_64-unknown-linux-gnu.cxx=/nix/store/a0d7m3zn9p2dfa1h7ag9h2wzzr2w25sn-gcc-wrapper-14.2.1.20250322/bin/c++ --set=target.thumbv8m.main-none-eabi.cxx=/nix/store/wnnwk5vknch7d8jy3cdykbsnn5qrmjj3-armv8m-unknown-none-eabi-gcc-wrapper-14.2.1.20250322/bin/armv8m-unknown-none-eabi-c++ --set=target.x86_64-unknown-linux-gnu.crt-static=false --set=target.x86_64-unknown-linux-gnu.crt-static=false --set=target.thumbv8m.main-none-eabi.crt-static=false --enable-llvm-link-shared --set=target.x86_64-unknown-linux-gnu.llvm-config=/nix/store/bw1i8r1ilp79xyybr2n633aq3jj1wrrd-llvm-19.1.7-dev/bin/llvm-config --set=target.x86_64-unknown-linux-gnu.llvm-config=/nix/store/bw1i8r1ilp79xyybr2n633aq3jj1wrrd-llvm-19.1.7-dev/bin/llvm-config --set=target.thumbv8m.main-none-eabi.llvm-config=/nix/store/bw1i8r1ilp79xyybr2n633aq3jj1wrrd-llvm-19.1.7-dev/bin/llvm-config --disable-llvm-bitcode-linker --disable-docs
    armv8m-unknown-none-eabi-rustc> configure: processing command line
    armv8m-unknown-none-eabi-rustc> configure:
    armv8m-unknown-none-eabi-rustc> configure: build.configure-args := ['--prefix=/nix/store/wscr78z0s5v2hxx3p1n4qjgj ...
    armv8m-unknown-none-eabi-rustc> configure: install.prefix       := /nix/store/wscr78z0s5v2hxx3p1n4qjgjnds8dm0g-ar ...
    armv8m-unknown-none-eabi-rustc> configure: install.sysconfdir   := /nix/store/wscr78z0s5v2hxx3p1n4qjgjnds8dm0g-ar ...
    armv8m-unknown-none-eabi-rustc> configure: rust.channel         := stable
    armv8m-unknown-none-eabi-rustc> configure: build.rustc          := /nix/store/f9zdz15l2zd408yq7a3bgrj593kpwjqx-ru ...
    armv8m-unknown-none-eabi-rustc> configure: build.cargo          := /nix/store/ygri5mmqmril5ll9lhawa01faa2qhdvd-ca ...
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.cc := /nix/store/a0d7m3zn9p2dfa1h7ag9h ...
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.cc := /nix/store/a0d7m3zn9p2dfa1h7ag9h ...
    armv8m-unknown-none-eabi-rustc> configure: target.thumbv8m.main-none-eabi.cc := /nix/store/wnnwk5vknch7d8jy3cdykb ...
    armv8m-unknown-none-eabi-rustc> configure: target.thumbv8m.main-none-eabi.linker := /nix/store/wnnwk5vknch7d8jy3c ...
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.linker := /nix/store/a0d7m3zn9p2dfa1h7 ...
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.linker := /nix/store/a0d7m3zn9p2dfa1h7 ...
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.cxx := /nix/store/a0d7m3zn9p2dfa1h7ag9 ...
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.cxx := /nix/store/a0d7m3zn9p2dfa1h7ag9 ...
    armv8m-unknown-none-eabi-rustc> configure: target.thumbv8m.main-none-eabi.cxx := /nix/store/wnnwk5vknch7d8jy3cdyk ...
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.crt-static := False
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.crt-static := False
    armv8m-unknown-none-eabi-rustc> configure: target.thumbv8m.main-none-eabi.crt-static := False
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.llvm-config := /nix/store/bw1i8r1ilp79 ...
    armv8m-unknown-none-eabi-rustc> configure: target.x86_64-unknown-linux-gnu.llvm-config := /nix/store/bw1i8r1ilp79 ...
    armv8m-unknown-none-eabi-rustc> configure: target.thumbv8m.main-none-eabi.llvm-config := /nix/store/bw1i8r1ilp79x ...
    armv8m-unknown-none-eabi-rustc> configure: build.tools          := ['rustc', 'rustdoc', 'rust-analyzer-proc-macro ...
    armv8m-unknown-none-eabi-rustc> configure: rust.rpath           := True
    armv8m-unknown-none-eabi-rustc> configure: build.vendor         := True
    armv8m-unknown-none-eabi-rustc> configure: rust.lld             := False
    armv8m-unknown-none-eabi-rustc> configure: build.build          := x86_64-unknown-linux-gnu
    armv8m-unknown-none-eabi-rustc> configure: build.host           := ['x86_64-unknown-linux-gnu']
    armv8m-unknown-none-eabi-rustc> configure: build.target         := ['thumbv8m.main-none-eabi']
    armv8m-unknown-none-eabi-rustc> configure: llvm.link-shared     := True
    armv8m-unknown-none-eabi-rustc> configure: rust.llvm-bitcode-linker := False
    armv8m-unknown-none-eabi-rustc> configure: build.docs           := False
    armv8m-unknown-none-eabi-rustc> configure: profile              := dist
    armv8m-unknown-none-eabi-rustc> Traceback (most recent call last):
    armv8m-unknown-none-eabi-rustc>   File "/build/rustc-1.86.0-src/./src/bootstrap/configure.py", line 762, in <module>
    armv8m-unknown-none-eabi-rustc>     section_order, sections, targets = parse_args(sys.argv[1:])
    armv8m-unknown-none-eabi-rustc>                                        ^^^^^^^^^^^^^^^^^^^^^^^^
    armv8m-unknown-none-eabi-rustc>   File "/build/rustc-1.86.0-src/./src/bootstrap/configure.py", line 446, in parse_args
    armv8m-unknown-none-eabi-rustc>     return parse_example_config(known_args, config)
    armv8m-unknown-none-eabi-rustc>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    armv8m-unknown-none-eabi-rustc>   File "/build/rustc-1.86.0-src/./src/bootstrap/configure.py", line 622, in parse_example_config
    armv8m-unknown-none-eabi-rustc>     configure_file(sections, top_level_keys, targets, config)
    armv8m-unknown-none-eabi-rustc>   File "/build/rustc-1.86.0-src/./src/bootstrap/configure.py", line 709, in configure_file
    armv8m-unknown-none-eabi-rustc>     configure_section(targets[target], section_config[target])
    armv8m-unknown-none-eabi-rustc>   File "/build/rustc-1.86.0-src/./src/bootstrap/configure.py", line 683, in configure_section
    armv8m-unknown-none-eabi-rustc>     raise RuntimeError("failed to find config line for {}".format(key))
    armv8m-unknown-none-eabi-rustc> RuntimeError: failed to find config line for main-none-eabi

This is probably related to
https://github.com/rust-lang/rust/issues/130602 and thus target string
should be double-quotted so bootstrap/configure.py can parse it
correctly.

Changes tested on x86_64-linux build machine with rustc built for
"thumb8vm.main-none-eabi" target.
2025-07-25 15:49:40 +02:00
2025-07-25 06:06:56 +00:00
2025-06-29 21:14:32 +02:00
2025-04-01 20:09:44 +02:00

NixOS logo

Contributors badge Open Collective supporters

Nixpkgs is a collection of over 120,000 software packages that can be installed with the Nix package manager. It also implements NixOS, a purely-functional Linux distribution.

Manuals

  • NixOS Manual - how to install, configure, and maintain a purely-functional Linux distribution
  • Nixpkgs Manual - contributing to Nixpkgs and using programming-language-specific Nix expressions
  • Nix Package Manager Manual - how to write Nix expressions (programs), and how to use Nix command line tools

Community

Other Project Repositories

The sources of all official Nix-related projects are in the NixOS organization on GitHub. Here are some of the main ones:

  • Nix - the purely functional package manager
  • NixOps - the tool to remotely deploy NixOS machines
  • nixos-hardware - NixOS profiles to optimize settings for different hardware
  • Nix RFCs - the formal process for making substantial changes to the community
  • NixOS homepage - the NixOS.org website
  • hydra - our continuous integration system
  • NixOS Artwork - NixOS artwork

Continuous Integration and Distribution

Nixpkgs and NixOS are built and tested by our continuous integration system, Hydra.

Artifacts successfully built with Hydra are published to cache at https://cache.nixos.org/. When successful build and test criteria are met, the Nixpkgs expressions are distributed via Nix channels.

Contributing

Nixpkgs is among the most active projects on GitHub. While thousands of open issues and pull requests might seem a lot at first, it helps consider it in the context of the scope of the project. Nixpkgs describes how to build tens of thousands of pieces of software and implements a Linux distribution. The GitHub Insights page gives a sense of the project activity.

Community contributions are always welcome through GitHub Issues and Pull Requests.

For more information about contributing to the project, please visit the contributing page.

Donations

The infrastructure for NixOS and related projects is maintained by a nonprofit organization, the NixOS Foundation. To ensure the continuity and expansion of the NixOS infrastructure, we are looking for donations to our organization.

You can donate to the NixOS foundation through SEPA bank transfers or by using Open Collective:

License

Nixpkgs is licensed under the MIT License.

Note: MIT license does not apply to the packages built by Nixpkgs, merely to the files in this repository (the Nix expressions, build scripts, NixOS modules, etc.). It also might not apply to patches included in Nixpkgs, which may be derivative works of the packages to which they apply. The aforementioned artifacts are all covered by the licenses of the respective packages.

S
Description
No description provided
Readme 5 GiB
Languages
Nix 95%
Shell 2%
Python 1.8%
Rust 0.3%
JavaScript 0.2%
Other 0.4%