New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdenv: implement most of #33599 #39464
Conversation
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
@GrahamcOfBorg build hello |
Success on aarch64-linux (full log) Attempted: hello Partial log (click to expand)
|
checkTarget
and installCheckTarget
autodetectioncheckTarget
and installCheckTarget
autodetection
d0148bb
to
488c023
Compare
checkTarget
and installCheckTarget
autodetectioncheckTarget
and installCheckTarget
autodetection
488c023
to
57f5653
Compare
57f5653
to
324a476
Compare
Since #39463 got merged I pushed the rest of the infrastructure here. Feel free to play with this. |
checkTarget
and installCheckTarget
autodetection
Do I understand correctly that for Python packages it unconditionally changes the default to true? |
Given «nobody» reads the afterglow of merged PRs: |
I generally like it, but will try to read it again. |
Failure on aarch64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the python default doCheck
value change that doesn't depend on config.doCheckByDefault
, I think this shouldn't break anything when config.doCheckByDefault
is set to false, and that it's a good path forward. That said I don't know much about some parts of the code touched here, so… :)
@@ -53,7 +53,7 @@ | |||
|
|||
, passthru ? {} | |||
|
|||
, doCheck ? false | |||
, doCheck ? true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a bit violent? The rest of the PR appears harmless, but wouldn't this set doCheck
default to true
regardless of config.doCheckByDefault
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. Will fix.
@@ -85,6 +84,7 @@ toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [ | |||
# Python packages don't have a checkPhase, only an installCheckPhase | |||
doCheck = false; | |||
doInstallCheck = doCheck; | |||
installCheckInputs = checkInputs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this be wrapped in a lib.optionals
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could, but it doesn't matter, the mkDerivation
takes care of it.
@@ -36,6 +36,9 @@ rec { | |||
, depsTargetTarget ? [] # 1 -> 1 | |||
, depsTargetTargetPropagated ? [] # 1 -> 1 | |||
|
|||
, checkInputs ? [] | |||
, installCheckInputs ? [] | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs documentation in nixpkgs manual §3.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Will do.
} // lib.optionalAttrs (outputs' != [ "out" ]) { | ||
outputs = outputs'; | ||
} // lib.optionalAttrs (attrs ? doCheck) { | ||
# TODO(@Ericson2314): Make unconditional / resolve #33599 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you lost this TODO comment when moving this code upwards: I don't think with this PR #33599 would be solved yet? As it would require at least turning config.doCheckByDefault
to default to true
, which isn't coming until at least hydra has performed a world-rebuild with it and checked it failed no additional package, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. Will fix.
${installCheckTarget:-installcheck} | ||
) | ||
if [[ -z "${foundMakefile:-}" ]]; then | ||
echo "no Makefile or custom buildPhase, doing nothing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you meant installCheckPhase here?
${checkTarget:-check} | ||
) | ||
if [[ -z "${foundMakefile:-}" ]]; then | ||
echo "no Makefile or custom buildPhase, doing nothing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you meant checkPhase here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the previous one. No. Custom buildPhase
implies custom checkPhase
(or else it will run no tests): since you don't use make
to build, this can't use make
to test (in general).
9ee061a
to
03a55ff
Compare
Note that a bunch of non-python packages use this attribute already. Some of those are clearly unaware of the fact that this attribute does not exists in stdenv because they define it but don't to add it to their `bulidInputs` :) Also note that I use `buildInputs` here and only handle regular builds because python and haskell builders do it this way and I'm not sure how to properly handle the cross-compilation case.
03a55ff
to
87651b3
Compare
Rebase done. |
Success on aarch64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Heh. I think we just witnessed a bug in This then suggests a way to force @GrahamcOfBorg to make long rebuilds multiple times: you can push several dependent changes one-by-one and all but the very first one would hang waiting for lock, but then the first one timeouts the next one immediately picks up where the previous one left and extends the timeout. /cc @grahamc |
I think this should be merged and doCheckByDefault set by default ASAP, look what bugs it can find: #28029 (comment)
|
ping!
|
Motivation for this change
#33599. This PR implements the main feature needed to implement #33599:
checkTarget
autodetection.Set
config.doCheckByDefault = true
and behold how many failed tests there are. I will PR a huge bunch of fixes for those bugs later (after I rebuild everything myself on top of this version), see #39463 and linked PRs.Things done