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.
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 184.108.40.206
compiled using version 220.127.116.11 of the Cabal library
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:
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.
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?
Axe cabalPackageCacheDirectory, use projectConfigCacheDir, fixing #3392
I am not sure why the original code did something insane,
which may indicate a lurking bug.
Signed-off-by: Edward Z. Yang <email@example.com>
Issue subsumed by PR #3796.
Removing the 18.104.22.168 milestone, since people using new-build should be running HEAD at this point, which is more stable than 1.24.