Skip to content

rustc: use llvmPackages_23 - #578990

Merged
mdaniels5757 merged 1 commit into
NixOS:stagingfrom
mdaniels5757:fix-rustc-llvm-version
Oct 28, 2026
Merged

mdaniels5757 merged 1 commit into
NixOS:stagingfrom
mdaniels5757:fix-rustc-llvm-version

Conversation

@mdaniels5757

Copy link
Copy Markdown
Member

See item number 2 at the top of the file, and https://github.com/rust-lang/rust/blob/1.99.1/.gitmodules#L28.

Fixes cargo-binstall 1.26.1, which failed to compile its adler32furious dependency because of the following error (caused by the LLVM version mismatch):

intrinsic signature mismatch for `llvm.x86.avx512.vpdpbusd.256`: expected signature `<8 x i32> (<8 x i32>, <8 x i32>, <8 x i32>)`, found `<8 x i32> (<8 x i32>, <32 x i8>, <32 x i8>)`

Things done

See item number 2 at the top of the file, and
https://github.com/rust-lang/rust/blob/1.99.1/.gitmodules#L28.

Fixes cargo-binstall 1.26.1, which failed to compile its `adler32furious`
dependency because of the following error (caused by the LLVM version mismatch):

```
intrinsic signature mismatch for `llvm.x86.avx512.vpdpbusd.256`:
expected signature `<8 x i32> (<8 x i32>, <8 x i32>, <8 x i32>)`,
found `<8 x i32> (<8 x i32>, <32 x i8>, <32 x i8>)`
```
@nixpkgs-ci
nixpkgs-ci Bot requested review from a team and alyssais October 25, 2026 21:59
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. labels Oct 25, 2026
@winterqt

Copy link
Copy Markdown
Member

Will build on Darwin today. ccing @whispersofthedawn (can you just become a maintainer already?) for visibility as they did the rustc bump.

@whispersofthedawn

whispersofthedawn commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

can try to take a closer look later, but given that this looks avx512-related from that error, is this the same failure that led to folks wanting #544495? i think the consensus then was we want to push the global llvm bump (then #524570, now #562683) through, but i don't know if that position has changed given that bump will be delayed (and won't make 26.11).

in principle it would suck to have to reseparate the default and rustc's, after work in the past to align them (#407738), though if it's just a temporary measure while we advance to a non-fucked llvm it might be okay. or if we want to just decide to always align with upstream that may also be fine; just probably worth tracing back closer why we decided to switch away from explicit specification.

(and i mean, I'm not opposed to becoming a maintainer or something, might as well get pings if we keep staring at rust stuff anyway)

@mdaniels5757

mdaniels5757 commented Oct 25, 2026 •

Copy link
Copy Markdown
Member Author

Same sort of error, yes. The top of the file I edited (pkgs/development/compilers/rust/1_99.nix) says that "[t]he LLVM version used for building should match with rust upstream", so the idea that it shouldn't surprises me. (Upstream says that "[t]he latest released major version [of LLVM] is always supported. The one or two preceding major versions are usually supported in the sense that they are expected to build successfully and pass most tests. However, fixes for miscompilations often do not get backported to past LLVM versions, so using rustc with older versions of LLVM comes with an increased risk of soundness bugs. We strongly recommend using the latest version of LLVM."; I presume that this means the latest version of LLVM at the time of the compiler's release (as opposed to subsequently released LLVM versions).)

If the bump were imminent, I could be persuaded to go with that instead (although I'd still argue against it, as I dont think there's a guarantee rustc would work with newer LLVM versions than it supports). But it isn't (and seemingly won't happen soon), so I think we should fix this now.

Regarding the reasoning for rust using our default version of LLVM, I don't see a reason presented here, at least. Perhaps @alyssais remembers?

@mdaniels5757 mdaniels5757 mentioned this pull request Oct 25, 2026
2 of 13 tasks
@mdaniels5757 mdaniels5757 added the 1.severity: blocker This is preventing another PR or issue from being completed label Oct 25, 2026
@whispersofthedawn

whispersofthedawn commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

in principle this seems fine; if we need it to unblock failures, i'd rather we go into 26.11 with a good state rather than a slightly broken rustc. tis a shame we couldn't globally adopt llvm 23, but oh well. consider this a +½ from us.

main thing we'd want before a full +1 is some broader testing. we've kicked some test builds of mostly-rust tools on x86_64-linux, and they seems completely fine. some darwin would be good as always, though. we'd also like for someone to get through a firefox build + a little bit of runtime testing before stamping this, as that involves heavy mixing of rustc and clang and we want to make sure there are no perverse interactions there. we'll throw our laptop at it, though since we can only do that at night it may be a day or three to get through that closure.

(edit: oh woops, i'm seeing now that firefox explicitly selects the llvm from rustc, so we shouldn't expect anything from mismatched llvm versions here. still going to run tests, though; that's a fairly important to get right and is a good test.)

we mostly brought up the concern about unifying the LLVMs because we recalled alyssa mentioning it on matrix at some point, but we do not have enough context nor the memory to recall details, so if someone who has the context can't come by and leave thoughts, we think this is fine.

(though building more than one llvm in typical staging builds for rustc and clang will be sad, plus adding an llvm that's outside of darwin stdenv. oh well, we do what we must.)

also cc @NixOS/llvm in case anyone over there has thoughts, though this is mostly a rust thing

@wegank wegank mentioned this pull request Oct 27, 2026
2 of 13 tasks
@jxcl

jxcl commented Oct 27, 2026 •

Copy link
Copy Markdown

LLVM 23 changed their profiling output. Rust 1.99 expects the newer profiling output and so will segfault if it's been built with an older LLVM: https://hydra.nixos.org/build/350182570/step/4/log

This is currently causing the nixpkg cargo-llvm-cov to fail to build, but that package will also need updating as well. Fixing this but not that package stops the segfaults but causes the error:

raw profile version mismatch: Profile uses raw profile format version = 11; expected version = 10

Teebor-Choka added a commit to Teebor-Choka/skills that referenced this pull request Oct 27, 2026
…ches LLVM

rustc 1.99 in nixpkgs is built with LLVM 21 but its profiler runtime
expects the LLVM 23 raw profile format. Every coverage-instrumented
binary SIGSEGVs at exit (initializeValueProfRuntimeRecord), so
cargo llvm-cov fails. Take cargo, rustc, cargo-llvm-cov and llvm for the
tests check from a second nixpkgs input pinned at 55bfb4d. This replaces
the doCheck override.

Tracked upstream in NixOS/nixpkgs#578990.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@mdaniels5757

Copy link
Copy Markdown
Member Author

npb · 00c30e6 → aa0cf49

Expand this for a reproducible command.
npb --base 00c30e69273f1242704d2da56dea6b77eda45d69 --head aa0cf492b8fbf63b2bfb5ad0fbe070c5a85ba1fb -p stdenv -p cargo-binstall -p firefox -s aarch64-darwin
Expand this for a legend of all symbols below.
  • ✅ = successfully built
  • ❌ = failed to build
  • 🚫 = dependency failed to build
  • ❔ = couldn't try to build
  • ⏩ = failed to evaluate
  • ➖ = doesn't exist

aarch64-darwin

✅ → ✅ · 5 packages
  • cargo-binstall
  • firefox
  • stdenv.tests.inputDerivationRequiredSystemFeatures
  • stdenv.tests.succeedOnFailure
  • stdenv

@mdaniels5757

Copy link
Copy Markdown
Member Author

@whispersofthedawn (or anyone else with a Darwin machine and community builder access): the path of the new Firefox on the Darwin community builder is /nix/store/4zhk4k2fkia5zqk6axy6jkgc88wmp99g-firefox-158.0.1, if you'd like to nix-copy-closure/nix copy it.

@mdaniels5757

Copy link
Copy Markdown
Member Author

Merging now: I'd really like this to be included in the next staging cycle, which will begin shortly.

@mdaniels5757
mdaniels5757 added this pull request to the merge queue Oct 28, 2026
@whispersofthedawn

whispersofthedawn commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

fine with me. sorry, i don't actually have a graphical darwin machine and was almost done with my own ff build for x86_64-linux, but if it builds along with the other things in its chain it's probably good enough along with the other testing that was done. we can handle fallout in staging-next if necessary

Merged via the queue into NixOS:staging with commit af7d400 Oct 28, 2026
34 checks passed
@mdaniels5757
mdaniels5757 deleted the fix-rustc-llvm-version branch October 28, 2026 21:22
kleinbem added a commit to kleinbem/nix-detour-fleet that referenced this pull request Nov 1, 2026
First use of nix-detour's fixes (kleinbem-dev/nix-detour#23). qdrant
fails to build on nixos-unstable because rustc's stdarch and nixpkgs'
LLVM disagree on an AVX-512 VNNI intrinsic (NixOS/nixpkgs#553191). It
was held on stable (1.17.1) since 10-13; now it runs the current 1.18.2
with the source patch from NixOS/nixpkgs#553347, which disables those
VNNI code paths, pinned by hash. The fix ends like a hold: once nixpkgs'
own qdrant builds again (NixOS/nixpkgs#578990 on master, plus a zstd
input that staging-next now needs), the release action removes it.

- `held-packages.json`: qdrant from `current` with the patch
(`nix-detour fix add`).
- Lock and release action move to nix-detour main (ce248312), which has
fixes; `overlay.nix` is the only file that changed for the holds.

Test (nixos-nvme, qdrant as nix-config gets it: this flake's nixpkgs,
nix-packages' overlay, `mkOverlay`): built in 91 min, 138 tests passed,
version 1.18.2; the server started, created a collection with int8
quantization, took points and answered a query. The other four holds are
unchanged.

Cost: qdrant isn't on cache.nixos.org with the patch, so nix-config's
first build-all after this builds it once (about 1.5 h here, more on a
runner); then it's in Attic. Trade-off: CPUs with AVX-512 VNNI lose that
quantization fast path until the fix ends.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Updated the Qdrant package hold to track the current package source,
with a start date of 1 November 2026. A compatibility patch disables
affected AVX-512 VNNI code paths. The hold now identifies a rustc/LLVM
compilation failure involving `vpdpbusd` and records the conditions for
ending the hold, making the package’s build status and hold criteria
clearer.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@mdaniels5757 mdaniels5757 mentioned this pull request Nov 1, 2026
4 of 13 tasks
@ipetkov ipetkov mentioned this pull request Nov 4, 2026
4 of 13 tasks
ryoppippi added a commit to ccusage/ccusage that referenced this pull request Nov 9, 2026
The lock file maintenance moves nixpkgs to 4fe25e1, where cargo-llvm-cov
0.9.0 no longer builds: 14 of its integration tests fail because the
coverage-instrumented binaries they build segfault at exit. nixpkgs'
rustc is built against LLVM 21 but bundles an LLVM 23 profiler runtime
(NixOS/nixpkgs#576588, reproduced on Hydra for x86_64-linux and here on
aarch64-darwin). With the package unbuildable and not cached, the dev
shell fails to build, so direnv and the generated git hooks go stale.

The defect is in nixpkgs' rustc, not in cargo-llvm-cov, and only its
own test suite compiles with that rustc. The dev shell runs
`cargo llvm-cov` with the rust-overlay toolchain from
rust-toolchain.toml, whose profiler runtime matches its LLVM, so
skipping the package's checks yields a working tool. This is applied on
every platform because the cause is not Darwin-specific.

The fix (NixOS/nixpkgs#578990, rustc: use llvmPackages_23) is on staging;
drop the override once it reaches the pinned nixpkgs.
ryoppippi added a commit to ccusage/ccusage that referenced this pull request Nov 9, 2026
* chore(deps): lock file maintenance

* chore: format

* style(nu): apply nufmt 0.1.6 formatting to scripts merged from main

The lock file maintenance bumps nixpkgs from 8edc0c7 to 4fe25e1, which
moves nufmt from 0-unstable-2026-09-28 to 0.1.6-unstable-2026-10-21. The
new nufmt wraps long records and calls across lines (for example
multi-line `error make {msg: ...}` records), so treefmt-check fails on
every .nu file still in the old style.

autofix-ci had already reformatted the one script present on this
branch, but CI checks the merge with main, and main has since gained
contribution-gate and other scripts formatted by the old nufmt. That
single treefmt-check failure broke both the `security & lint preflight`
job and `nix flake check` in the `test` job; the Rust, JS, Nushell, and
Babashka tests themselves passed.

Merge main and rerun `nix fmt` so every script matches the formatter the
lock now pins.

* fix(nix): skip cargo-llvm-cov checks so the dev shell builds

The lock file maintenance moves nixpkgs to 4fe25e1, where cargo-llvm-cov
0.9.0 no longer builds: 14 of its integration tests fail because the
coverage-instrumented binaries they build segfault at exit. nixpkgs'
rustc is built against LLVM 21 but bundles an LLVM 23 profiler runtime
(NixOS/nixpkgs#576588, reproduced on Hydra for x86_64-linux and here on
aarch64-darwin). With the package unbuildable and not cached, the dev
shell fails to build, so direnv and the generated git hooks go stale.

The defect is in nixpkgs' rustc, not in cargo-llvm-cov, and only its
own test suite compiles with that rustc. The dev shell runs
`cargo llvm-cov` with the rust-overlay toolchain from
rust-toolchain.toml, whose profiler runtime matches its LLVM, so
skipping the package's checks yields a working tool. This is applied on
every platform because the cause is not Darwin-specific.

The fix (NixOS/nixpkgs#578990, rustc: use llvmPackages_23) is on staging;
drop the override once it reaches the pinned nixpkgs.

* fix(perf): read hyperfine 2.0 results by command name

The lock file maintenance moves nixpkgs to 4fe25e1, which upgrades
hyperfine from 1.21.0 to 2.0.0. The PR performance comparison then fails
before measuring anything: hyperfine 2.0 removed `--sort` without a
replacement, so `--sort command` is rejected as an unexpected argument.

Dropping the flag alone is not enough. hyperfine 2.0 also switched
`--export-json` to schema version 2: statistics moved to
`summary.time_wall_clock`, per-run times to `measurements`, and the
`--command-name` label to `name`. The parser still read the 1.x top-level
`median`/`min`/`max`/`times`, so it would have produced nil measurements.
The script also relied on `--sort command` to keep results in input
order, destructuring them by position into base/PR and pairing them with
runtime variants by index.

Match each result to its requested `--command-name` and return them in
the requested order, failing on a missing or duplicated name instead of
silently pairing the wrong measurement. Read wall-clock statistics from
the v2 summary, rejecting an unexpected schema version or unit. Remove
the unused `hyperfine-common` definition that also carried `--sort`.

The malformed-output test passed a java.nio Path to `slurp`, which
failed to open it, so it passed on the wrong exception. The test helper
now passes the string path the script itself uses.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: ryoppippi <[email protected]>
eldios added a commit to eldios/dotfiles that referenced this pull request Nov 12, 2026
nixos-unstable rustc builds against LLVM 23 since nixpkgs#578990, so
the check that kept gitbutler below 0.23 no longer triggers.

NixOS/nixpkgs#578990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.severity: blocker This is preventing another PR or issue from being completed 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants