Cabal: New-build fails to find package list

Created on 2 May 2016  路  6Comments  路  Source: haskell/cabal

When I try to build my package using new-build, I get an error about a missing package list. Building using normal build works, however.

$ cabal update
Downloading the latest package list from hackage.haskell.org

$ cabal new-build
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: irc-core-1.1.4 (user goal)
next goal: haskell-lexer (dependency of irc-core-1.1.4)
Dependency tree exhaustively searched.

$ cabal --version
cabal-install version 1.24.0.0
compiled using version 1.24.0.0 of the Cabal library 
nix-local-build bug

All 6 comments

The bug seems to be related to new-build not honoring some aspect of my old .cabal/config as created by an old version of the Haskell Platform somewhen long ago:

remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
remote-repo-cache: /Users/emertens/Library/Haskell/repo-cache

Generating a new .cabal/config gets new-build working, but it would probably be worth figuring out how to look up things correctly in the configuration file because other people are likely to have the same problem who installed Haskell around when I did.

I was just gonna open an issue myself... this is about remote-repo-cache not being propagated into new-build's environment. I'm sure @dcoutts knows right away the place which needs a one-line-fix...

PS: A simple workaround on OSX is to

ln -s ~/Library/Haskell/repo-cache ~/.cabal/packages

Another fix that I found was to delete my ~/.cabal/config file and do cabal update. Then everything worked fine. Note that if you go with this approach you might want to back up the config file first in case you had critical customizations. But this has worked fine for me on two different machines.

The solution given by @hvr is definitely safer, so you may not want to do this one. But I kind of like the idea of getting the latest and greatest ~/.cabal/config defaults.

swapping
remote-repo-cache: /Users/gershom/Library/Haskell/repo-cache
for
remote-repo-cache: /Users/gershom/.cabal/packages

seems to work.

I think this is probably an infelicity in new-build that it can't properly interact with a nonstandard remote-repo-cache location?

Issue subsumed by PR #3796.

Removing the 1.24.0.1 milestone, since people using new-build should be running HEAD at this point, which is more stable than 1.24.

Was this page helpful?
0 / 5 - 0 ratings