Skip to content

various: simplify handling of some *Phases in setup hooks#360450

Merged
wolfgangwalther merged 4 commits intoNixOS:stagingfrom
wolfgangwalther:structured-attrs-pre-fixup-dist-phases-staging
Dec 14, 2024
Merged

various: simplify handling of some *Phases in setup hooks#360450
wolfgangwalther merged 4 commits intoNixOS:stagingfrom
wolfgangwalther:structured-attrs-pre-fixup-dist-phases-staging

Conversation

@wolfgangwalther
Copy link
Contributor

This is to unblock #352709 and remove all the special cases of preFixupPhases and preDistPhases.

My reasoning can be found in #352709 (review) and following. I did not move pytestCheckHook to the installCheckPhase - we don't need that and can still use postInstallHooks in pytest-forked and pytest-xdist.

I'm very sure that this works - but I couldn't verify against a broken case. Just removing the if etc. didn't show any obvious breakage in the few random packages that I looked at.

cc @ShamrockLee @emilazy

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.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Nov 30, 2024
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 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. labels Dec 1, 2024
@wolfgangwalther wolfgangwalther force-pushed the structured-attrs-pre-fixup-dist-phases-staging branch from e546221 to 9b3f7db Compare December 8, 2024 11:49
@wolfgangwalther
Copy link
Contributor Author

I addressed the feedback. Once CI / ofborg has run through, this should be good to go.

@github-actions github-actions bot removed 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Dec 8, 2024
This avoids complicated logic to make sure the preFixupPhase is in the
right place relative to gappsWrapperArgsHook. What glib's hook is doing
here ultimately belons to the install phase anyway.
We need to make sure that pytest-forked's setup hook runs before the
pytestCheckPhase. Instead of mangling the preDistPhases in a complex
way, we can just set our environment variables in postInstallCheckHook,
which is run right before all preDistPhases.
Same reasoning as commit before.
@wolfgangwalther wolfgangwalther force-pushed the structured-attrs-pre-fixup-dist-phases-staging branch from 9b3f7db to 0cd7dfa Compare December 9, 2024 20:40
@wolfgangwalther
Copy link
Contributor Author

Rebased to fix ofborg-eval failure.

@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Dec 10, 2024
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.

I built a few of these (glib, gobject-introspection, python3Packages.pytest-forked, python3Packages.pytest-xdist). ✅.

@wolfgangwalther wolfgangwalther merged commit 5d27de1 into NixOS:staging Dec 14, 2024
4 of 5 checks passed
@wolfgangwalther wolfgangwalther deleted the structured-attrs-pre-fixup-dist-phases-staging branch December 14, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 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-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 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.

4 participants