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-modules: add callCabal2nixWithOptions. #44424

Merged
merged 1 commit into from Sep 11, 2018
Merged

haskell-modules: add callCabal2nixWithOptions. #44424

merged 1 commit into from Sep 11, 2018

Conversation

dhess
Copy link
Contributor

@dhess dhess commented Aug 3, 2018

Fixes #44377.

Motivation for this change

haskellSrc2nix supports calling cabal2nix with extra options, but there is no way to do this via callCabal2nix. This adds a new function, callCabal2nixWithOptions, which supports those extra options.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@cocreature
Copy link
Contributor

Looks related to #42658 (I’m not in the position to judge whether it’s better or worse than that).

@dhess
Copy link
Contributor Author

dhess commented Aug 11, 2018

Bumping for review, please.

@basvandijk
Copy link
Member

@peti @ryantm @roberth like @cocreature mentions this is indeed an alternative to #42658.

Advantages of #42658 compared to this PR:

Disadvantages #42658 compared to this PR:

I would go for #42658 if it introduces some documentation. What do you think?

@dhess
Copy link
Contributor Author

dhess commented Aug 14, 2018

It's fine with me, as long as one of them gets merged soon :)

@ryantm
Copy link
Member

ryantm commented Aug 21, 2018

I have no preference.

@srhb
Copy link
Contributor

srhb commented Sep 10, 2018

I prefer this one, becuase it seems the least path of resistance to actually get moving with this, and this has already sat for quite a while. 😃

@srhb
Copy link
Contributor

srhb commented Sep 10, 2018

@dhess @basvandijk I think we should bite the bullet on this, but also rewrite the function to take an argset instead of multiple arguments, such that next time, we can hide the addition of some field from the user without introducing YetAnotherCallCabal2nixWithFeatureX

@basvandijk
Copy link
Member

@srhb I agree we should bite the bullet and I also think we should backport this to release-18.09.

With regards to your point about the argset argument, do you mean something like:

callCabal2nixWithOptions = name: src: { extraCabal2nixOptions ? "" }: args: ...

@srhb
Copy link
Contributor

srhb commented Sep 10, 2018

@basvandijk I was actually considering

callCabal2nixWithOptions = { name, src, args, extraCabal2nixOptions ? "" }: ...

This way it becomes a uniform invocation no matter what we add in the future. But if it's too radical a change, I don't feel strongly about it. I just thought it could help future-proof a bit.

@basvandijk basvandijk merged commit d05a8bb into NixOS:master Sep 11, 2018
@basvandijk
Copy link
Member

@srhb I think all callSomething functions in Nix use multiple arguments instead of taking a set. I don't want to be inconsistent here. I've bitten the bullet and merged this.

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

6 participants