New-build fails to find package list #3392

Closed
glguy opened this Issue May 2, 2016 · 6 comments

Projects

None yet

7 participants

@glguy
glguy commented May 2, 2016

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 
@glguy
glguy commented May 2, 2016

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.

@hvr
Member
hvr commented May 2, 2016 edited

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
@hvr hvr assigned hvr and dcoutts and unassigned hvr May 2, 2016
@hvr hvr added this to the cabal-install 1.24.0.1 milestone May 2, 2016
@mightybyte
Collaborator
mightybyte commented May 2, 2016 edited

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.

@gbaz
Collaborator
gbaz commented May 11, 2016

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?

@ezyang ezyang modified the milestone: cabal-install 1.24.0.1, Soon Sep 6, 2016
@ezyang ezyang added a commit to ezyang/cabal that referenced this issue Sep 6, 2016
@ezyang ezyang 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 <ezyang@cs.stanford.edu>
b5f9dac
@ezyang
Contributor
ezyang commented Sep 6, 2016

Issue subsumed by PR #3796.

@ezyang ezyang closed this Sep 6, 2016
@23Skidoo 23Skidoo removed this from the 1.24.0.1 milestone Oct 8, 2016
@23Skidoo
Member
23Skidoo commented Oct 8, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment