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

"Could not read the output of 'nix-prefetch-url'. This is a bug." #330

Open
TheOddler opened this issue Sep 6, 2021 · 2 comments
Open
Labels

Comments

@TheOddler
Copy link

When trying out Niv and following the example from the readme to add GHC:

$ niv add ghc   \
    -v 8.4.3    \
    -t 'https://downloads.haskell.org/~ghc/<version>/ghc-<version>-i386-deb8-linux.tar.xz'

But instead using the latest ghc version (9.0.1 as of writing), I get the following error:

$ niv add ghc -v 9.0.1 -t 'https://downloads.haskell.org/~ghc/<version>/ghc-<version>-i386-deb8-linux.tar.xz'
Adding package ghc
  FATAL: Could not read the output of 'nix-prefetch-url'. This is a bug. Please create a
  ticket:
  
    https://github.com/nmattia/niv/issues/new
  
  Thanks! I'll buy you a beer.
  command: 
  nix-prefetch-urlhttps://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-i386-deb8-linux.tar.xz --name ghc-9.0.1-i386-deb8-linux.tar.xz
  stdout: 
  
  stderr: 
  error: unable to download 'https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-i386-deb8-linux.tar.xz': HTTP error 404
  
  FATAL: One or more packages failed to update:
  ghc: ExitFailure 1
ERROR: ExitFailure 1

The solution is quite simple, simply change deb8 to deb9, as no deb8 file exists. However, the error asked me to post this so I did.

The command that does work:

niv add ghc -v 9.0.1 -t 'https://downloads.haskell.org/~ghc/<version>/ghc-<version>-i386-deb9-linux.tar.xz'

I got the same problem when I tried version 8.10.6, for the same reason and with same fix.

@nmattia
Copy link
Owner

nmattia commented Sep 7, 2021

@TheOddler Right, the file https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-i386-deb8-linux.tar.xz indeed doesn't exit. The error message is a bit dramatic though, it's not really a bug, but a 404.

@TheOddler
Copy link
Author

@nmattia I thought so too that it's not really a bug. Well, maybe it's a bug that the code thinks that it's a bug.

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