Commit Graph

243 Commits

Author SHA1 Message Date
Jonas Chevalier
f23e8ad032 cargo: remove runtime references to cargo-bootstrap (#510169) 2026-07-01 06:51:44 +00:00
zowoq
0e0373a060 rust: 1.94.1 -> 1.95.0 (#510674) 2026-04-22 21:58:40 +00:00
Alyssa Ross
b22e919f17 pkgsCross.wasi32.buildPackages.rustc: fix build (#463720) 2026-04-20 11:33:52 +00:00
Diogo Correia
45e3996b16 pkgsCross.wasi32.buildPackages.rustc: fix build
Fixes #463589
2026-04-20 11:31:27 +01:00
Hythera
6534ba3f79 rust: 1.94.1 -> 1.95.0
Building the crate tikv-jemalloc-sys is causing some trouble with our build flags when building on x86_64-darwin. Switching to rust-jemalloc-sys from nixpkgs resolves this issue.
Adding this change across all platforms as this may address some other issues.

blog: https://blog.rust-lang.org/2026/04/16/Rust-1.95.0

diff: https://github.com/rust-lang/rust/compare/1.94.1...1.95.0
2026-04-18 12:43:44 +02:00
Lily Ballard
19d080de23 rustc-unwrapped: disallow references to build rustc/cargo 2026-04-15 23:51:45 -07:00
Mynacol
9df667c84a rustc-unwrapped: Add meta.mainProgram 2026-02-26 23:45:32 +01:00
Stefan Frijters
182bcd0c1f rustc: fix build with structuredAttrs 2025-12-15 11:14:55 +01:00
Wolfgang Walther
46c0c0eae7 Merge branch 'staging-next' into staging 2025-12-10 18:42:31 +01:00
Ihar Hrachyshka
567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
Jörg Thalheim
65037cffdb rustc, cargo-llvm-cov: enable profiler runtime on Darwin
Enable the LLVM profiler runtime on macOS by passing `--enable-profiler`
to rustc's configure. This allows cargo-llvm-cov and other coverage tools
to work on Darwin platforms.

The profiler is explicitly disabled for wasm and bpf targets which don't
support it.
2025-11-29 15:21:57 +01:00
Leona Maroni
5c9b757f6b Merge remote-tracking branch 'origin/master' into staging-next 2025-11-15 09:51:23 +01:00
Wolfgang Walther
55f496d0eb maintainers: drop various inactive maintainers (#459104) 2025-11-14 22:18:34 +00:00
Wolfgang Walther
215c5bf597 maintainers: drop havvy
Inactive since 2023.
2025-11-06 10:58:08 +01:00
Luka Blašković
6dc97c4c87 rust: 1.90.0 -> 1.91.0
Co-authored-by: winston <hey@winston.sh>
2025-11-04 07:29:58 +00:00
Marie Ramlow
72155d28e2 rust: 1.89.0 -> 1.90.0 2025-10-12 13:24:19 +02:00
Alyssa Ross
03738e5632 rustc: fix rust-gdb, rust-gdbgui and rust-lldb on cross compilers (#440482) 2025-09-15 04:37:35 +00:00
Marie Ramlow
b8fa8e32b0 rustc: fix rust-gdb, rust-gdbgui and rust-lldb on cross compilers
Since cross compilers can also build code for the build platform, we
should also install these debug scripts so they are available just like
in our non-cross rustc.
2025-09-08 18:29:01 +02:00
nixpkgs-ci[bot]
28a77664bb Merge master into staging-next 2025-08-31 18:04:38 +00:00
Alyssa Ross
5b48b63e28 rustc: fix misnamed "tier1TargetPlatforms"
Link: https://github.com/NixOS/nixpkgs/pull/437113#pullrequestreview-3156043129
2025-08-31 18:16:05 +02:00
nixpkgs-ci[bot]
33bedf3c25 Merge master into staging-next 2025-08-31 12:06:11 +00:00
Tristan Ross
27fcc80c3a rustc: fix pkgsLLVM
Fixes `libunwind` from not being included due to improper usage of
`lib.optional` by passing a list instead of a single item. Drops the
hack for `llvmPackages` since just passing it through works now.
2025-08-31 11:57:55 +05:30
nixpkgs-ci[bot]
664c1d7072 Merge staging-next into staging 2025-08-15 00:18:56 +00:00
K900
b5531da4b1 Merge remote-tracking branch 'origin/master' into staging-next 2025-08-14 21:21:33 +03:00
Marie Ramlow
7f494c2b23 rustc: also symlink libexec when doing fastCross
We also need to symlink libexec when doing fastCross.
It contains rust-analyzer-proc-macro-srv which rust-analyzer needs for proc macro expansion to work.
2025-08-14 18:39:24 +02:00
dramforever
39aef90642 rustc: Fix configure flags for custom target JSON
For custom target JSON, rustc bootstrap expects config to be set for
target."/path/to/target.json", so use that.
2025-08-13 16:13:10 +02:00
nixpkgs-ci[bot]
6a5e5fa747 Merge staging-next into staging 2025-07-29 18:07:08 +00:00
Tristan Ross
9093a19b61 rustc: un-mark broken for LLVM stdenv
Essentially reverts ebbcb003f9 since
6814b2f572 fixes it.
2025-07-28 07:56:17 -07:00
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
Wolfgang Walther
90604d95bc Merge branch 'staging-next' into staging 2025-07-24 14:33:09 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Alyssa Ross
abc50135a4 rustc: unset PKG_CONFIG_*
This hasn't been required to cross compile rustc since
20e24e42d4 ("rustc: 1.67.1 -> 1.68.0").
2025-07-22 19:04:10 +02:00
dramforever
30f7a22432 rustc: Set rust.frame-pointers if !isx86_32
We want -Cforce-frame-pointers=yes when building rustc itself, but the
bootstrap process does not use cargoSetupHook, so set the bootstrap
config option rust.frame-pointers = true if target is not x86_32.

Note that std is unconditionally compiled with frame pointers. See code
comment for elaboration.

See also #399014 for discussion when we enabled frame pointers for C.
2025-07-02 21:10:48 +02:00
Emily
2f9b7c6c97 rustc: put the linker for the target platform first (#408710) 2025-05-22 21:38:45 +01:00
Emily
1cb94639f5 rustc: pass the linker for the target platform first
Fix `pkgsStatic.buildPackages.rustc` on Darwin.

Closes: #405969
2025-05-22 10:01:45 +01:00
Winter
4efa2ff7a1 rustc: remove redundant libiconv dependency on darwin
libiconv is included in the SDK now.
2025-05-15 15:43:26 -04:00
Niklas Korz
ffbfd9c828 rustc: ensure standard library docs are installed
Fixes #405914

Upstream's installation script installs the `docs` component
for every target that is built.
Unfortunately, installing the docs for a target removes the
previous target's docs, ultimately leaving only the docs
of the last target in the list.
In our case, that is a `no_std` target, for which no `alloc`
or `std` docs are built, thus leaving `rustc.doc` without any
standard library docs.
Moving stdenv's `targetPlatform` to the end of the list ensures
we get standard library docs.
2025-05-13 17:54:17 +02:00
K900
f96ac2dcd6 Merge remote-tracking branch 'origin/master' into staging-next 2025-04-26 09:07:48 +03:00
Fernando Rodrigues
05580f4b44 treewide: switch instances of lib.teams.*.members to the new meta.teams attribute
Follow-up to #394797.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2025-04-25 22:20:17 -03:00
Ihar Hrachyshka
dd0f03a56c treewide: remove usage of deprecated apple_sdk framework stubs
They are not doing anything right now. This is in preparation for their
complete removal from the tree.

Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.

Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-04-19 20:28:20 -04:00
K900
a832ea381b rustc: fix fastCross
1.86 changed the naming scheme of the stamp files.
2025-04-04 21:57:57 +03:00
André Silva
b8de2d206a rustc: add wasm32v1-none target 2025-02-24 14:03:08 +01:00
Niklas Korz
0289aa115c rustc: enable bpfe library targets 2025-02-19 11:09:42 +01:00
Niklas Korz
5d808d3150 rustc: use indented string for buildPhase 2025-02-19 11:09:42 +01:00
Seth Flynn
397e5bb5a7 rustc: mark broken for LLVM stdenv 2025-01-20 02:32:47 -05:00
Silvan Mosberger
84d4f874c2 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev 78e9caf153
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:23:58 +01:00
Gaetan Lepage
464187c486 rustc: patch the path to llvm-strip instead of using /usr/bin/strip on darwin 2024-12-06 13:35:12 +01:00
Audrey Dutcher
7f179a1b12 rustc: do not force compilation with libunwind on FreeBSD
FreeBSD's unwind libs are named "libgcc" despite being llvm in origin
and come from the FreeBSD source tree.
2024-11-02 05:39:17 +00:00
Artturin
f0e657f3b1 Merge branch 'master' into staging-next 2024-09-25 06:05:01 +03:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00