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
libhugetlbfs: init at 2.22 #93888
libhugetlbfs: init at 2.22 #93888
Conversation
''; | ||
|
||
installPhase = '' | ||
make install install-docs $makeFlags |
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.
When overriding installPhase
, you should also provide runHook preInstall
and runHook postInstall
. Though, in this case, why not rely on the default installPhase
and specify installTargets = [ "install" "install-docs" ];
?
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.
When overriding
installPhase
, you should also providerunHook preInstall
andrunHook postInstall
.
Why? As I understand it, the hooks are stdenv hooks, not derivation hooks, and are for the derivation to use if it wants to. It’s not like the hooks are a generic, consistent way to allow users of packages to insert extra commands, because if I had used preInstall
here, somebody overriding that would break the package.
Though, in this case, why not rely on the default
installPhase
and specifyinstallTargets = [ "install" "install-docs" ];
?
Because I didn’t know about those! Thanks!
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.
You would use pkg.overrideAttrs (attrs: {postInstall = (attrs.postInstall or "") + ''foo'';})
. I keep recommending adding hooks because I have seen their lack of confuse nixpkgs users several times. Granted, nine times out of ten it was about fixupPhase
hooks, but installPhase
was there too. I think consistency is useful for reducing the amount of head scratchers.
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 — thanks for explaining!
# Default target builds tests as well, and the tests want a static | ||
# libc. | ||
make libs tools $makeFlags |
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.
Same here. buildFlags = [ "libs" "tools" ];
should work, please add an explanation comment otherwise.
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.
Weird that there’s no buildTargets
, defaulting to []
…
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)