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

Allows for package definition in package.dhall #375

Closed
wants to merge 8 commits into from

Conversation

philderbeast
Copy link
Contributor

@philderbeast philderbeast commented Sep 5, 2018

Fixes #374.

Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mixed feelings about this change. I see why it's useful and arguably it's consistent with all the other features cabal2nix has gotten over the years, i.e. support for hpack, support for fetching git repositories, etc. So from that point of view, I think it's perfectly fine to add that feature.

On the other hand, I feel like all these changes are going into a completely wrong direction. cabal2nix is a tool that converts a Cabal file into a Nix expression. That's its domain. So why should it know about git, and http and hpack and --subpath and whatnot else? None of this has anything to do with converting Cabal files into Nix expressions.

What is happening now feels like feature creep. Meanwhile, the list of dependencies one needs to build cabal2nix is getting crazy long and complicated. We already need regular releases to accomodate API breaking changes in hpack. Now we're adding dhall into the mix, too?

I don't know ... Personally, if I had may way then I'd throw out all of these features in a potential 3.0 release and restrict cabal2nix's functionality to reading a Cabal file from the local disk and writing a Nix expression to the local disk -- nothing else.

If other maintainers of this code feel that this is a useful addition that we should merge, then I'll happily defer to their judgement, but I am probably not going to merge these changes.

@nh2
Copy link
Contributor

nh2 commented Sep 23, 2018

This seems tough:

The cabal file systax was not expressive enough for some users, so alternatives sprung up. As a consequence, one cannot any longer analyse git checkouts directly from git checkouts (as no cabal file exists and is to be generated).

If cabal2nix restricted itself to only cabal files as input, how would we invoke such preprocessors? Also considering other downstream tools, such as stack2nix.

@philderbeast
Copy link
Contributor Author

Being able to point cabal2nix at hackage and code repos is very useful.

With the growing number of alternative ways to describe packages, each as far as I know convertible to cabal package descriptions, perhaps cabal2nix should restrict itself to *.cabal files in the next major release?

  • From package.yaml to <name>.cabal with hpack.
  • From package.dhall to <name>.cabal with hpack-dhall.
  • From <name>.dhall to <name>.cabal with dhall-to-cabal.

As a package maintainer I would prefer a cabal2nix blinkered to only see *.cabal files. I don't want it to run tooling on some upstream file and ignore a *.cabal file.

@peti
Copy link
Member

peti commented Jun 12, 2020

I am sorry, but this pull request goes into the opposite direction of where I want to go. I want to get support for hpack and dhall and stuff out of cabal2nix, not into it. I'll introduce a more modular architecture in the 3.x version that will allow you to implement these features as plugins without touching cabal2nix itself.

@peti peti closed this Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Where hpack goes so does hpack-dhall.
3 participants