Skip to content

treewide: fix inappropriate usage of rust.envVars.setEnv#430368

Merged
LeSuisse merged 1 commit intoNixOS:masterfrom
alois31:push-kxosozrvlksm
Nov 9, 2025
Merged

treewide: fix inappropriate usage of rust.envVars.setEnv#430368
LeSuisse merged 1 commit intoNixOS:masterfrom
alois31:push-kxosozrvlksm

Conversation

@alois31
Copy link
Contributor

@alois31 alois31 commented Aug 2, 2025

It was designed for the Cargo build hook, which goes into nativeBuildInputs. Direct usage leads to an incorrect platform offset, which can for example be observed by the package pkgsStatic.buildPackages differing from the native one due to accidentally receiving the wrong environment variables. Fix the issue by using buildPackages as nativeBuildInputs would.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

It was designed for the Cargo build hook, which goes into `nativeBuildInputs`.
Direct usage leads to an incorrect platform offset, which can for example be
observed by the package `pkgsStatic.buildPackages` differing from the native
one due to accidentally receiving the wrong environment variables. Fix the
issue by using `buildPackages` as `nativeBuildInputs` would.
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Aug 2, 2025
@qweered qweered closed this Nov 8, 2025
@qweered qweered reopened this Nov 8, 2025
@nixpkgs-ci nixpkgs-ci bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Nov 8, 2025
@illdefined
Copy link
Contributor

I can confirm that this fixes static builds of rusttls-ffi and libimagequant on x86_64-linux.

Copy link
Member

@LeSuisse LeSuisse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LeSuisse LeSuisse added this pull request to the merge queue Nov 9, 2025
Merged via the queue into NixOS:master with commit 1c95309 Nov 9, 2025
54 of 55 checks passed
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: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants