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

Support for GitHub/GitLab PR URLs #588

Open
Gabriella439 opened this issue Dec 2, 2022 · 1 comment
Open

Support for GitHub/GitLab PR URLs #588

Gabriella439 opened this issue Dec 2, 2022 · 1 comment

Comments

@Gabriella439
Copy link

One common use case for cabal2nix is using it to fetch a certain pull request for use as a dependency. However, currently one has to manually translate the PR URL to a revision before one can use cabal2nix. It would be nice if one could instead run something like:

$ cabal2nix https://github.com/andrewthad/country/pull/29

… and (at the time of this writing) it would behave the same way as if one had ran:

$ cabal2nix https://github.com/andrewthad/country --revision 4477749919da35e392faf08538f07c4c175b8284

I'd be happy to contribute this change myself if it would be approved. I've already looked into this and seemed like the most idiomatic way to do this would be to first contribute a nix-prefetch-pr utility to Nixpkgs and then make cabal2nix a thin wrapper around that. However, I wouldn't want to open the PR for nix-prefetch-pr if the matching change to cabal2nix would not get approved.

@sternenseemann
Copy link
Member

I was aiming to revisit the fetching code soon in order to find a cleaner solution for #585, so it may not make sense yet to add a new feature in this area at the moment. I.e. it probably makes sense to get a handle on the complexity first to be free to contribute to it later.

In principle I'm not opposed to the change, especially if we can delegate this to a tool in the end. Currently cabal2nix is very stupid and just throws whatever it is getting at a bunch of tools after it has determined that it's not a hackage URL. I'd like to keep it that way, so we don't need to maintain a ton of integrations in cabal2nix or parse URLs etc.

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

No branches or pull requests

2 participants