SourceGraph icon indicating copy to clipboard operation
SourceGraph copied to clipboard

stack reports: "The package index or index cache is probably corrupt."

Open JeffreyBenjaminBrown opened this issue 8 years ago • 1 comments

This looks beautiful. Thanks for building it.

I ran stack new (using resolver: lts-9.4) to make a sandbox called sg for trying SourceGraph. I added SourceGraph to the build-depends in sg.cabal, and then tried stack ghci. It told me to add - SourceGraph-0.7.0.7 to the extra-deps in stack.yaml, so I did, and retried stack ghci. It told me to add something else, and I imagined that process might iterate a lot, so I tried running stack solver. I got this error:

jeff@jbb-lenovo:~/code/studies/source-graph/sg$ stack solver
Using configuration file: stack.yaml
Using cabal packages:
- sg.cabal

Using resolver: lts-9.4

Warning: Installed version of cabal-install (1.22.6.0) doesn't support custom-setup clause, and so may not yield correct results.
To resolve this, install a newer version via 'stack install cabal-install'.

Using compiler: ghc-8.0.2
Asking cabal to calculate a build plan...
Trying with packages from lts-9.4 and 1 external packages as hard constraints...
Attempt failed.

>>>> Cabal errors begin
cabal: Could not resolve dependencies:
trying: sg-0.1.0.0 (user goal)
trying: SourceGraph-0.7.0.7 (dependency of sg-0.1.0.0)
next goal: haskell-src-exts (dependency of SourceGraph-0.7.0.7)
rejecting: haskell-src-exts-1.19.1, 1.19.0 (global constraint requires
==1.18.2)
rejecting: haskell-src-exts-1.18.2 (conflict: SourceGraph =>
haskell-src-exts==1.16.*)
rejecting: haskell-src-exts-1.18.1, 1.18.0, 1.17.1, 1.17.0, 1.16.0.1, 1.16.0,
1.15.0.1, 1.15.0, 1.14.0.1, 1.14.0, 1.13.5, 1.13.4, 1.13.3, 1.13.2, 1.13.1,
1.13.0, 1.12.0, 1.11.1, 1.10.2, 1.10.1, 1.10.0, 1.9.6, 1.9.5, 1.9.4, 1.9.3,
1.9.0, 1.8.2, 1.8.1, 1.8.0, 1.7.2, 1.7.1, 1.7.0, 1.6.1, 1.6.0, 1.5.3, 1.5.2,
1.5.1, 1.5.0, 1.4.0, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.0, 1.1.4,
1.1.3.1, 1.1.3, 1.1.1, 1.1.0, 1.0.1, 1.0.0, 0.5.7, 0.5.6, 0.5.5, 0.5.4, 0.5.3,
0.5.2, 0.4.8, 0.4.6, 0.4.5, 0.4.4.1, 0.4.4, 0.4.3.1, 0.4.3, 0.4.2, 0.4.1,
0.3.12, 0.3.11, 0.3.10, 0.3.9, 0.3.7, 0.3.5, 0.3.4, 0.3.3, 0.3.2, 0.2.1
(global constraint requires ==1.18.2)
Dependency tree exhaustively searched.
<<<< Cabal errors end

Retrying with packages from lts-9.4 and 1 external packages as preferences...
Could not parse cabal-install errors:

>>>> Cabal errors begin
cabal: internal error when reading package index: failed to parse .cabal
fileThe package index or index cache is probably corrupt. Running cabal update
might fix it.
<<<< Cabal errors end

CallStack (from HasCallStack):
  error, called at src/Stack/Solver.hs:144:25 in stack-1.5.1-8L0HpUwgvNa7pLuInyRw8N:Stack.Solver

I tried running cabal update, but after that, running stack ghci gave me the same error.

For comparison, to make sure there wasn't a problem with my global cabal instalation, I made a folder called pipes-test, added pipes to the build-depends in pipes-test.cabal, and ran stack ghci. It worked. (Maybe it's not a great comparison, though, because I never had to add anything to stack.yaml.)

JeffreyBenjaminBrown avatar Sep 13 '17 08:09 JeffreyBenjaminBrown

Yeah, I haven't touched this for a while, so don't know if it still builds or not.

That said, you shouldn't have tried to use it within your existing project. Build SourceGraph seperately, copy the resulting executable into your $PATH and then run it in your project.

ivan-m avatar Sep 13 '17 09:09 ivan-m