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

Export haskellSrc2nix, hackage2nix. Prefer local builds. Name arg optional. #22471

Closed
wants to merge 1 commit into from

Conversation

k0001
Copy link
Contributor

@k0001 k0001 commented Feb 5, 2017

Motivation for this change

See issue #22427 and #22469

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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/)
  • Fits CONTRIBUTING.md.

cc @peti @3noch

@mention-bot
Copy link

@k0001, thanks for your PR! By analyzing the history of the files in this pull request, we identified @peti, @oxij and @3noch to be potential reviewers.

@peti
Copy link
Member

peti commented Feb 5, 2017

I am not fond of the notion of exporting hackage2nix et al as-is. First of all, there is a Haskell program called hackage2nix which may very well get it's own package on Hackage, too, so would definitely have to think about other appropriate names for this function (and probably the other, too). Secondly, I have the impression that the architecture of those functions is not well though-out yet and I planned to make quite a few changes to them (which is why I did not expose them in the first place).

I guess we can expose those functions now and just break backwards-compatibility in the future if we want to. There's probably only a handful of people in the world who care about them, so it's not that big a deal. If we do, then we should definitely choose better names though.

@k0001
Copy link
Contributor Author

k0001 commented Feb 5, 2017

@peti good points, and I agree that there are some naming issues, and we should definitely avoid name collisions. nixFromHackage and nixFromCabal maybe (c.f., builtins.fromJSON)?

I think these functions are useful, though. I've used variants of the one currently called haskellSrc2nix in many of my Haskell projects, and it would be nice if it was exported here so that I don't have to redefine it over and over again.

I can take a stab at those changes, if you care to share your concerns with me.

@peti
Copy link
Member

peti commented Feb 5, 2017

nixFromHackage and nixFromCabal

Yes, I like those names much better than the ones we currently have. I'd be fine with exporting those.

@peti
Copy link
Member

peti commented Feb 5, 2017

I can take a stab at those changes, if you care to share your concerns with me.

The most important improvement is that I want to get rid of the dependency on the all-cabal-hashes repository. Instead of downloading all Cabal and JSON files for all versions of all Hackage packages at once, I'd rather download that one particular Cabal and JSON file that is needed to run cabal2nix. I'm not sure whether it's possible to pull that off, but it would be great if it were.

Another issue is that the cabal2nix binary used by these derivations is pkgs.cabal2nix, which has dependencies on stuff that we don't need in this context, like nix-prefetch-scripts, and I'd like to see a different cabal2nix used here that has a smaller closure. Maybe there should be a cabal2nix-mini or something.

@3noch
Copy link
Contributor

3noch commented Feb 6, 2017

I like all your proposed changes. Go for it.

@mmahut
Copy link
Member

mmahut commented Aug 1, 2019

Any update on this pull request?

@mmahut
Copy link
Member

mmahut commented Aug 19, 2019

Closing due to lack of activity, feel free to reopen this if needed.

@mmahut mmahut closed this Aug 19, 2019
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