-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
haskellSrc2Nix: Use wrapped cabal2nix #108248
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
Conversation
Previously haskellSrc2Nix would inexplicably use the unwrapped cabal2nix derivation, meaning that nix-prefetch-url wouldn't be present in PATH.
Cc @peti |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff LGTM
I mentioned in #108246 (comment), but I don't think this is the correct solution. We explicitly switched to using However, I don't know why @bgamari would be seeing this error. |
I agree with @cdepillabout that it's surprising that cabal2nix calls nix-prefetch-url, and that this solution is not great, since we loose all the benefits of I'm wondering what the nix-prefetch-url call is exactly, if it is legitimate, and if so, if it is possible to make another wrapper that has just nix-prefetch-url without the many other prefetch scripts. |
It's unfortunately quite hard to know why That is, the |
@bgamari Thanks for looking into this. If anyone is willing to debug the |
There might be other occasions where this command is called, but if I remember correctly then all of those occasions have to do with people trying to generate build instructions for remote git and/or darcs repositories. The code that implements those features is quite complicated, unfortunately, so no-one knows for sure what is going on. :-/ |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/hakyll-nix-starter-template/9111/3 |
I marked this as stale due to inactivity. → More info |
@sternenseemann If I remember correctly, we were thinking that this error was originally caused by I think recently we got a PR to cabal2nix that made it show more errors (instead of falling back to looking for This can probably be closed? |
This issue should be fixed with cabal2nix 2.18.0 indeed (NixOS/cabal2nix#489). To be precise it was a mistake in the fetching logic where the file “fetcher” would signal it was not applicable to the given URL/path instead of failing because it was able to access the path, but missing the cabal file. Now the failure looks like this:
|
Okay great, I'll go ahead and close this PR then. |
Motivation for this change
Previously haskellSrc2Nix would inexplicably use the unwrapped cabal2nix
derivation, meaning that nix-prefetch-url wouldn't be present in PATH.
Fixes #108246.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)