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: add runPhase function #21060
Conversation
# function named $phase. | ||
eval "${!phase:-$phase}" | ||
|
||
if [ "$curPhase" = unpackPhase ]; then |
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 this should be checking for $phase
instead of $curPhase
.
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.
oh I missed that one, pretty strange that I didn't notice any build issues.
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 $curPhase
is global and this is only called from a single place (where $phase == $curPhase
)..
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.
right, it's not a local
fi | ||
|
||
stopNest | ||
runPhase $curPhase |
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.
Maybe add quotes here.
this is useful for running phases inside a nix-shell
Another solution for this behaviour would be to do this in the functions for each phase, that way we would get the expected behaviour without having to use the |
9c290b3
to
5f5d181
Compare
I think it's better if this is fixed in the phases, that way it will work as expected. |
Motivation for this change
This is useful for running phases inside a nix-shell, using
buildPhase
for example will always execute make even when a derivation has a custom buildPhase.Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
stdenv.mkDerivation