Skip to content

versionCheckHook: add versionCheckKeepEnvironment parameter#411609

Merged
drupol merged 5 commits intoNixOS:stagingfrom
Defelo:push-oovqxlxzwltw
Jun 2, 2025
Merged

versionCheckHook: add versionCheckKeepEnvironment parameter#411609
drupol merged 5 commits intoNixOS:stagingfrom
Defelo:push-oovqxlxzwltw

Conversation

@Defelo
Copy link
Member

@Defelo Defelo commented May 28, 2025

This allows specifying a list of environment variables to pass to the version command. In contrast to versionCheckDontIgnoreEnvironment (added in #403971) --ignore-environment is still used and only the specified environment variables are passed to the command.

cc @drupol @piotrkwiecinski

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label May 28, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin 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-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels May 28, 2025
@Defelo Defelo force-pushed the push-oovqxlxzwltw branch 2 times, most recently from 044f8a9 to 81ac87e Compare May 28, 2025 17:57
@Defelo Defelo marked this pull request as ready for review May 28, 2025 17:59
@Defelo Defelo requested review from doronbehar and drupol May 29, 2025 15:06
Copy link
Contributor

@wcarlsen wcarlsen left a comment

Choose a reason for hiding this comment

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

I can successfully build ec2-instance-selector too, so all good from me.

@Aleksanaa Aleksanaa mentioned this pull request Jun 1, 2025
13 tasks
Defelo added 5 commits June 1, 2025 19:38
This replaces the `versionCheckDontIgnoreEnvironment` parameter. Keeping
all environment variables is still possible by using
`versionCheckKeepEnvironment = "*";`.
@Defelo Defelo force-pushed the push-oovqxlxzwltw branch from 81ac87e to 3daa8fd Compare June 1, 2025 17:38
@nix-owners nix-owners bot requested a review from eihqnh June 1, 2025 17:45
Copy link
Contributor

@drupol drupol left a comment

Choose a reason for hiding this comment

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

💯 !

@drupol drupol merged commit 53da0c8 into NixOS:staging Jun 2, 2025
15 of 18 checks passed
@Defelo Defelo deleted the push-oovqxlxzwltw branch June 2, 2025 05:50
@antonmosich antonmosich mentioned this pull request Jun 27, 2025
13 tasks
dotlambda added a commit that referenced this pull request Oct 16, 2025
We'd have to set `versionCheckProgram` manually.
But even then, running `bw` requires `$HOME` to be writable but we
cannot pass environment variables to the hook.

Not-cherry-picked-because: #412768 and #411609 were not backported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: documentation This PR adds or changes documentation 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants