Skip to content

postgresqlPackages.vectorchord: fix build with rustc 1.96 - #537113

Closed
CertainLach wants to merge 1 commit into
NixOS:staging-nextfrom
CertainLach:push-wpmxkyvyvxkv
Closed

postgresqlPackages.vectorchord: fix build with rustc 1.96#537113
CertainLach wants to merge 1 commit into
NixOS:staging-nextfrom
CertainLach:push-wpmxkyvyvxkv

Conversation

@CertainLach

Copy link
Copy Markdown
Member

Build fails on rustc 1.96, fix submitted upstream: supervc-stack/VectorChord#467

Things done

@nixpkgs-ci
nixpkgs-ci Bot requested review from a team and diogotcorreia June 30, 2026 16:26
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Jun 30, 2026
@CertainLach
CertainLach marked this pull request as draft June 30, 2026 16:36
@CertainLach

Copy link
Copy Markdown
Member Author

Something is wrong here, it still fails to build as a part of nixpkgs

@CertainLach

Copy link
Copy Markdown
Member Author

LLVM does some weird things with hardenings used by nixpkgs...

@CertainLach

Copy link
Copy Markdown
Member Author

Patch I submitted to VectorChord fixes the individual crate build, but then fat lto during the full extension build breaks it back
Disabling hardening works fine here, so I believe some of them are causing a miscompilation

@CertainLach

Copy link
Copy Markdown
Member Author

Ok, this was hard, but seems like I found the source of the problem :D
Described this in #staging:nixos.org matrix:

There is a mismatch in versions of llvm we bundle with rustc in nixpkgs, and upstream rustc (e.g oxalica rust-overlay) expects

rustc packaged at staging-next expects llvm to be built with this fix: rust-lang/llvm-project@94e2c19
It is included in official release of rustc 1.96, but is missing from nixpkgs rustc 1.96 as it is using system llvm without this fix

Simple reproducer I found is:

use std::arch::x86_64::{_mm512_dpbusd_epi32,__m512i};
#[target_feature(enable = "avx512vnni")]
pub unsafe fn dp(a:__m512i,b:__m512i,c:__m512i)->__m512i{_mm512_dpbusd_epi32(a, b, c)}

You can build this code on godbolt's rustc 1.96/with oxalica's rust-overlay, but nixpkgs rustc fails to build it with "rustc-LLVM ERROR: Cannot select: intrinsic %llvm.x86.avx512.vpdpbusd.512" error"

@diogotcorreia

Copy link
Copy Markdown
Member

@CertainLach Do you have a PR/issue that tracks that problem? I'm interested in knowing if there is still something we need to do on the vectorchord package itself

diogotcorreia added a commit to diogotcorreia/nixpkgs that referenced this pull request Jul 6, 2026
Due to a bug in LLVM 21, build fails on x86_64 with:
`rustc-LLVM ERROR: Cannot select: intrinsic %llvm.x86.avx512.vpdpbusd.512`.
This has been fixed in Rust's build of LLVM and LLVM 22 [1]
but this is not reflected in nixpkgs' packaging of rustc.
For this reason, we temporarily disable avx512vnni support until this is fixed in nixpkgs.
This might cause a performance penalty, but should not affect correctness.

See NixOS#537113 (comment)

[1]: rust-lang/llvm-project@94e2c19
diogotcorreia added a commit to diogotcorreia/nixpkgs that referenced this pull request Jul 6, 2026
Due to a bug in LLVM 21, build fails on x86_64 with:
`rustc-LLVM ERROR: Cannot select: intrinsic %llvm.x86.avx512.vpdpbusd.512`.
This has been fixed in Rust's build of LLVM and LLVM 22 [1]
but this is not reflected in nixpkgs' packaging of rustc.
For this reason, we temporarily disable avx512vnni support until this is fixed in nixpkgs.
This might cause a performance penalty, but should not affect correctness.

See NixOS#537113 (comment)

[1]: rust-lang/llvm-project@94e2c19
diogotcorreia added a commit to diogotcorreia/nixpkgs that referenced this pull request Jul 6, 2026
Due to a bug in LLVM 21, build fails on x86_64 with:
`rustc-LLVM ERROR: Cannot select: intrinsic %llvm.x86.avx512.vpdpbusd.512`.
This has been fixed in Rust's build of LLVM and LLVM 22 [1]
but this is not reflected in nixpkgs' packaging of rustc.
For this reason, we temporarily disable avx512vnni support until this is fixed in nixpkgs.
This might cause a performance penalty, but should not affect correctness.

See NixOS#537113 (comment)

[1]: rust-lang/llvm-project@94e2c19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants