buildPythonPackage , buildPythonApplication: take installCheck-related attributes directly#324124
buildPythonPackage , buildPythonApplication: take installCheck-related attributes directly#324124ShamrockLee wants to merge 7 commits intoNixOS:masterfrom
buildPythonPackage , buildPythonApplication: take installCheck-related attributes directly#324124Conversation
buildPythonPackage , buildPythonApplication: take installCheck-related attributes directly
afh
left a comment
There was a problem hiding this comment.
Thanks for continuing the work on this, @ShamrockLee, please find below some minor suggestions…
055d61d to
089cbc9
Compare
167f116 to
b922bfb
Compare
|
I believe to understand the distinction between This decision seems to date back to 2009. |
|
@mweinelt Thank you for finding out the history of the decision. The issue is that we are
It is not about choosing between |
|
Why then not move us into |
The manual notes that checkPhase is used instead of installCheckPhase.
|
|
I get that The frustrating thing here is, that we simplified the lingo to And then there is the matter of nix-community/nix-init#419 🫠 |
Build system and dependencies are essentially another layer on top. The underlying stdenv atttributes will always be needed for all other cases. I think motivation at the time was consistency. Probably it was not given much thought. |
pkgs/development/interpreters/python/python2/mk-python-derivation.nix
Outdated
Show resolved
Hide resolved
8091f9c to
1ca8ebf
Compare
|
After some thought, I'm personally against the migration to Indeed, this change is correct and should be done to ensure consistency with the phase definition. Regarding |
Thank you for sharing your precious experiences about attribute renaming. Your right. The change wouldn't be helpful to the community if the pain caused by the mass renaming outweighs the benefits of the name correctness.
Delegating checks to If this is not the change we want to make now, should we close this pull request or mark it as a draft? |
|
I reopened this PR to prepare for future adoption of fixed-point arguments (
Since the buildPythonPackage (finalAttrs: {
doCheck = false;
checkInputs = lib.optionals finalAttrs.doInstallCheck [
# installCheckInputs elements
];
passthru = {
tests = {
python-check = finalAttrs.finalPackage.overrideAttrs {
doInstallCheck = true;
};
};
};
}); |
…tInstallCheck Goal: Unify the <pkg>.overrideAttrs interface for Python packages. Specify preInstallCheck/postInstallCheck as preCheck/postCheck if the latter is not specified. Use preInstallCheck/postInstallCheck in buildPython* setup hooks. When the checkPhase argument is specified, replace `runHook pre/postCheck` with `runHook pre/postInstallCheck` before assigning it to `installCheckPhase`.
…eckPhase Simplify implementation and ensure that pre/postInstallCheck only run once.
…llCheckPhase Simplify implementation and ensure that pre/postInstallCheck only run once.
Change checkPhase to installCehckPhase, doCheck to doInstallCheck, ..., to reflect the fact that the specification goes to the installCheck-related attributes and that buildPython* build helpers now takes the installCheck-related attributes directly in addition to indirectly specify them thourgh the check-related arguments. Co-authored-by: Alexis Hildebrandt <[email protected]>
In the previous implementation of buildPythonApplication, the doInstallCheck attribute was always specified by the doCheck argument. as `doCheck = false` was specified by this package, there's no effect to specify `doInstallCheck = true`, and the `installCheckPhase` specified doesn't get executed during build. After buildPythonApplication takes `doInstallCheck` directly, `doInstallCheck = true` starts to take effect. The `doCheck` argument, as an alias to `doInstallCheck`, lost its effect when `doInstallCheck` is presented. The setuphookCheckPhase are still supressed due to the fact that installCheckPhase is specified non-empty.
…attributes Co-authored-by: Martin Weinelt <[email protected]>
1ca8ebf to
3f04cf3
Compare
Description of changes
This draft PR enables
buildPythonPackageandbuildPythonApplicaitonto directly take theinstallCheck- related attribute instead of specifying it usingcheck- associated arguments.Following the community consensus to merge
lib.extendMkDerivation, there are ongoing efforts to makebuildPythonPackageandbuildPythonApplicationtake fixed-point arguments ((finalAttrs: { })) and supports the unified overrider<pkg>.overrideAttrs.As the finalAttrs are provided by stdenv.mkDerivation, it contains
doInstallCheckandinstallCheckInputsinstead ofdoCheckandcheckInput. ShouldbuildPythonPackagecontinues to take only thecheckPhase-related arguments and map them to theinstallCheckPhase-related ones, it creates inconsistency between the specification and reference of the same attribute.For example, with fixed-point arguments and
overrideAttrs, there will be package definitions like:This PR will also fulfill the to-do stated in the
mk-python-derivationcomment to deprecate the use ofcheckPhaseto specifyinstallCheckPhase, and useinstallCheckPhasedirectly.This PR depends on
which is a staging change.
After the depending PR merged and this PR rebased, it should create only a few rebuilds.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.