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

file:// will ignore a cabal file #542

Open
Profpatsch opened this issue Mar 4, 2022 · 1 comment
Open

file:// will ignore a cabal file #542

Profpatsch opened this issue Mar 4, 2022 · 1 comment
Labels

Comments

@Profpatsch
Copy link
Member

When I run

> cabal2nix file://./yarn2nix/yarn2nix.cabal > yarn2nix/yarn2nix.nix
error: unable to download 'https://hackage.haskell.org/package/yarn2nix-0.9.0.tar.gz': HTTP error 404 ('Not Found')

       response body:

       Package not found: No such package version for yarn2nix
*** cannot compute hash. (Not a hackage project?)
 If your project is not on hackage, please supply the path to the root directory of
 the project, not to the cabal file.

 If your project is on hackage but you still want to specify the hash manually, you
 can use the --sha256 option.

cabal2nix starts downloading things and complains.

I expect it to use the .cabal file and convert it to a nix file.

@leungbk
Copy link
Member

leungbk commented Apr 27, 2022

cabal2nix starts downloading things and complains.

Isn't this expected, since it needs to get the hash of a clean tarball? The README states:

Alternatively [...] a file:///local/path/pkg.cabal URI that doesn't depend on network access.
However, if the source hash is not already in cabal2nix's cache or provided
using the --sha256 option, cabal2nix still needs to download the source
code to compute the hash, which still causes network traffic.

In 0.9.0 of yarn2nix, which is not released on hackage, specifying the path to the root directory of the project as mentioned in the error behaves as expected; cabal2nix file://./yarn2nix/. outputs a Nix expression, whereas cabal2nix file://./yarn2nix/yarn2nix.cabal gives me the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants