Skip to content

treewide: correct versionCheckHook use#376275

Merged
philiptaron merged 10 commits intoNixOS:masterfrom
pbsds:fix-versionCheckHooks-1737677407
Jan 26, 2025
Merged

treewide: correct versionCheckHook use#376275
philiptaron merged 10 commits intoNixOS:masterfrom
pbsds:fix-versionCheckHooks-1737677407

Conversation

@pbsds
Copy link
Member

@pbsds pbsds commented Jan 24, 2025

Lots of packages don't put versionCheckHook in nativeInstallCheckInputs, or forget to enable the phase.

Candidates where located using rg versionCheckHook -l | xargs grep doInstallCheck -L | xargs grep buildPythonApplication -L

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (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.

@pbsds pbsds marked this pull request as ready for review January 24, 2025 01:20
@pbsds pbsds force-pushed the fix-versionCheckHooks-1737677407 branch from dfb8723 to e170449 Compare January 24, 2025 01:21
@github-actions github-actions bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Jan 24, 2025
@pbsbot
Copy link

pbsbot commented Jan 24, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 376275


x86_64-linux

✅ 19 packages built:
  • astroterm
  • chirpstack-concentratord
  • cloudpan189-go
  • deepsource
  • envision
  • envision-unwrapped
  • gcalcli
  • gcalcli.dist
  • gollama
  • kcl
  • mergiraf
  • nix-update
  • nix-update.dist
  • nixpkgs-review
  • nixpkgs-review.dist
  • nvitop
  • nvitop.dist
  • upbound
  • upbound-main

1 similar comment
@philiptaron
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 376275


x86_64-linux

✅ 19 packages built:
  • astroterm
  • chirpstack-concentratord
  • cloudpan189-go
  • deepsource
  • envision
  • envision-unwrapped
  • gcalcli
  • gcalcli.dist
  • gollama
  • kcl
  • mergiraf
  • nix-update
  • nix-update.dist
  • nixpkgs-review
  • nixpkgs-review.dist
  • nvitop
  • nvitop.dist
  • upbound
  • upbound-main

@NickCao
Copy link
Member

NickCao commented Jan 24, 2025

Be careful with python packages: #375320 (comment)

Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

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

Suggestion on the HOME-desiring ones

Comment on lines 89 to 91
Copy link
Contributor

Choose a reason for hiding this comment

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

So this one is not converted over, correct?

Copy link
Member Author

@pbsds pbsds Jan 26, 2025

Choose a reason for hiding this comment

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

correct, it is no longer a silent no-op, but also it doesn't work due to requiring HOMe

Copy link
Contributor

Choose a reason for hiding this comment

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

Do these work if you add this?

preInstallCheckPhase = ''
  export HOME=$(mktemp -d)
'';

Copy link
Member Author

Choose a reason for hiding this comment

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

Not due to env --ignore-environment

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, the -i flag went into the noise but --ignore-environment really says what it does.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 25, 2025
@pbsds pbsds force-pushed the fix-versionCheckHooks-1737677407 branch from e170449 to d71e753 Compare January 26, 2025 16:07
@pbsds
Copy link
Member Author

pbsds commented Jan 26, 2025

I looked into whether i could set HOME in versionCheckHook or testers.testVersion, but neither allow for adding environ variables. testers.testVersion should be trivial to add a preCheck or env argument to, but versionCheckHook is more involved and must go via staging

@philiptaron
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 376275


x86_64-linux

✅ 19 packages built:
  • astroterm
  • chirpstack-concentratord
  • cloudpan189-go
  • deepsource
  • envision
  • envision-unwrapped
  • gcalcli
  • gcalcli.dist
  • gollama
  • kcl
  • mergiraf
  • nix-update
  • nix-update.dist
  • nixpkgs-review
  • nixpkgs-review.dist
  • nvitop
  • nvitop.dist
  • upbound
  • upbound-main

@philiptaron philiptaron merged commit 5dc5ff2 into NixOS:master Jan 26, 2025
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants