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
haskell generic-builder: add doHpack (defaults to false) #40557
Conversation
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 am not a fan of this addition. I am not aware of any single package in Nixpkgs that actually needs this feature, and user packages that do need it can easily achieve this functionality by calling hpack
in the preConfigure
hook. Therefore. I'd rather not add this feature to our generic builder.
I would prefer to have this feature as a re-usable combinator function in haskell.lib
.
There is at least one nixpkgs/pkgs/development/tools/haskell/vaultenv/default.nix Lines 15 to 16 in 0127cf0
|
I understand @peti’s concern and to be fair, adding a line to |
The reason it's exposed as a flag to the generic builder is that cabal2nix (or any other tool using generic builder) could support hpack detection and enable the switch for packages that use hpack (for haksell development). If we use the combinator approach we lose composability due to stringly-typed abstraction of This change adds two lines and introduces no recompilations. |
Yes, it is true that the implementation is very straightforward. I'm not so much concerned by code complexity here but rather by "featureritis", i.e. we're adding specialized capabilities to our generic builder here that (a) Nixpkgs doesn't need and that (b) can be easily accomplished by other means. Therefore, I'd I would prefer not to commit to this API. It's just not necessary. |
@domenkozar You are not the first to propose this change. :P |
@domenkozar you are not the first to propose this change. :P |
@domenkozar you are not the first to propose this change, I think I did at least once. :) |
Huh, I seem to have made the last one (three) comments on a flaky internet connection. :) |
I'd like to add how this is biting me, in slight hope that it changes our minds.
|
Probably best to discuss in cabal2nix. |
Follow up on #25010
I've verified that
nix-build -A haskellPackages.mtl
is a noop with this change.