Skip to content
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

Merged
merged 1 commit into from Aug 8, 2020
Merged

libhugetlbfs: init at 2.22 #93888

merged 1 commit into from Aug 8, 2020

Conversation

alyssais
Copy link
Member

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

'';

installPhase = ''
make install install-docs $makeFlags
Copy link
Contributor

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" ];?

Copy link
Member Author

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.

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 specify installTargets = [ "install" "install-docs" ];?

Because I didn’t know about those! Thanks!

Copy link
Contributor

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.

Copy link
Member Author

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!

Comment on lines 41 to 43
# Default target builds tests as well, and the tests want a static
# libc.
make libs tools $makeFlags
Copy link
Contributor

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.

Copy link
Member Author

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 []

pkgs/development/libraries/libhugetlbfs/default.nix Outdated Show resolved Hide resolved
@alyssais alyssais merged commit 5e7d581 into NixOS:master Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants