Skip to content

Tweaks to package.nix (particularly pertinent in cross-compilation context)#293

Merged
zimbatm merged 2 commits intonumtide:mainfrom
lierdakil:cross-compilation-issues
Dec 10, 2025
Merged

Tweaks to package.nix (particularly pertinent in cross-compilation context)#293
zimbatm merged 2 commits intonumtide:mainfrom
lierdakil:cross-compilation-issues

Conversation

@lierdakil
Copy link
Copy Markdown
Contributor

The first commit solves a very real issue of having to build the whole Rust toolchain for the target system (starting with binutils and llvm) for absolutely no reason (see commit description for details). This issue gives me some amount of grief at the moment, so if we can get it merged that would be absolutely fabulous.

The second commit just fixes a weirdness I've ran into while trying to work around the first one (TL;DR you can't overrideAttrs because buildRustPackage output is hard-coded into runCommand script, arguably for no good reason). This one is optional, we can split it off to a separate PR or drop it altogether if it seems controversial.

In cross-compilation context, ${cargo} refers to target-system cargo,
which means building system-manager forces compilation of llvm, rustc
and cargo for the target architecture, despite none of those ever being
used.

This patch prevents this issue.
With the current setup, despite system-manager exposing `unwrapped`, if
one would like to overrideAttrs, one would have to copy-paste the whole
wrapper invocation.

This patch allows simpler overrides downstream by overriding
`unwrapped`.
@zimbatm zimbatm merged commit a62f411 into numtide:main Dec 10, 2025
3 checks passed
@zimbatm
Copy link
Copy Markdown
Member

zimbatm commented Dec 10, 2025

looks good, thanks!

@lierdakil lierdakil deleted the cross-compilation-issues branch December 10, 2025 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants