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

haskell: Make haskellPackages.callPackage overridable #90271

Draft
wants to merge 16 commits into
base: haskell-updates
Choose a base branch
from

Conversation

Aver1y
Copy link
Contributor

@Aver1y Aver1y commented Jun 14, 2020

Motivation for this change

Currently nh2/static-haskell-nix overrides every executable package to add the required options for static compilation. This works, but it would be much nicer to just override callPackage to add these options, so that users can just use callPackage, callCabal2nix and developPackage from the resulting package set and have them work as expected (i.e. generate statically linked executables).

Previously self.callPackage was used in some places and callPackage in others. This patch makes it so that self.callPackage is used consistently, so we can override callPackage and have the overriden version be used everywhere.

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.

@maralorn
Copy link
Member

That looks very reasonable to me.

@cdepillabout
Copy link
Member

@Aver1y I apologize for basically missing this PR and #88841.

Are you still interested in working on these two PRs?

When reviewing this sort of stuff, it is somewhat hard to know what the exact effect of using things like self, or changing the way extend is handled (#88841). (Well, I guess this PR is significantly easier to eye-ball than #88841.)

Would you also be willing to come up some sort of example that only works when the changes from these two PRs are applied?

@peti peti force-pushed the haskell-updates branch 3 times, most recently from 2c7ad11 to 0e5f7e8 Compare December 18, 2020 19:28
@peti peti force-pushed the haskell-updates branch 3 times, most recently from ba32886 to c9e5a3f Compare January 2, 2021 18:58
@peti peti force-pushed the haskell-updates branch 2 times, most recently from a0a57d7 to 952ebcf Compare January 22, 2021 19:34
@peti peti force-pushed the haskell-updates branch 4 times, most recently from 4c606a9 to 3ae580b Compare February 12, 2021 19:36
@peti peti force-pushed the haskell-updates branch 3 times, most recently from 56fa6fc to f3cb253 Compare February 19, 2021 19:56
@maralorn maralorn closed this May 7, 2021
@maralorn maralorn deleted the branch NixOS:haskell-updates May 7, 2021 21:55
@maralorn maralorn reopened this May 7, 2021
@sternenseemann sternenseemann deleted the branch NixOS:haskell-updates May 19, 2021 01:53
@Aver1y Aver1y requested a review from expipiplus1 as a code owner June 19, 2021 12:27
@stale
Copy link

stale bot commented Jan 3, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 3, 2022
@wegank wegank marked this pull request as draft March 20, 2024 15:34
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

8 participants