2014-10-09 17 views
7

Moja instalacja ghc była nieaktualna, więc postanowiłem ponownie zainstalować ghc i cabal, aby poprawić niektóre problemy. Rozpocząłem następujące kroki: here. GHC jest teraz w wersji 7.8.3.Instalacja Cabala ma brakujące moduły

Następnie usunąłem ~/.cabal i próbowałem zainstalować za pomocą kroków, ale się nie udało. Więc usunąłem .cabal ponownie i próbowali kroki here ale gdy uruchamiam sh bootstrap.sh biegnie do brakujących modułów:

Using local tarball for parsec-3.1.6. 
[1 of 1] Compiling Main    (Setup.hs, Setup.o) 
Linking Setup ... 
Configuring parsec-3.1.6... 
Building parsec-3.1.6... 
Preprocessing library parsec-3.1.6... 

Text/Parsec/Prim.hs:80:8: 
Could not find module ‘Control.Monad.Trans’ 
There are files missing in the ‘mtl-2.2.1’ package, 
try running 'ghc-pkg check'. 
Use -v to see a list of the files searched for. 

Text/Parsec/Prim.hs:81:8: 
Could not find module ‘Control.Monad.Identity’ 
There are files missing in the ‘mtl-2.2.1’ package, 
try running 'ghc-pkg check'. 
Use -v to see a list of the files searched for. 

Text/Parsec/Prim.hs:83:8: 
Could not find module ‘Control.Monad.Reader.Class’ 
There are files missing in the ‘mtl-2.2.1’ package, 
try running 'ghc-pkg check'. 
Use -v to see a list of the files searched for. 

Text/Parsec/Prim.hs:84:8: 
Could not find module ‘Control.Monad.State.Class’ 
There are files missing in the ‘mtl-2.2.1’ package, 
try running 'ghc-pkg check'. 
Use -v to see a list of the files searched for. 

Text/Parsec/Prim.hs:85:8: 
Could not find module ‘Control.Monad.Cont.Class’ 
There are files missing in the ‘mtl-2.2.1’ package, 
try running 'ghc-pkg check'. 
Use -v to see a list of the files searched for. 

Text/Parsec/Prim.hs:86:8: 
Could not find module ‘Control.Monad.Error.Class’ 
There are files missing in the ‘mtl-2.2.1’ package, 
try running 'ghc-pkg check'. 
Use -v to see a list of the files searched for. 

Text/Parsec/Text.hs:19:18: 
Could not find module ‘Data.Text’ 
There are files missing in the ‘text-1.2.0.0’ package, 
try running 'ghc-pkg check'. 
Use -v to see a list of the files searched for. 

Text/Parsec/Text/Lazy.hs:19:18: 
Could not find module ‘Data.Text.Lazy’ 
There are files missing in the ‘text-1.2.0.0’ package, 
try running 'ghc-pkg check'. 
Use -v to see a list of the files searched for. 

Error during cabal-install bootstrap: 
Building the parsec package failed. 

Kiedy biegnę ghc-pkg check dostaję mnóstwo rzeczy tak:

cannot find any of ["libHSOpenGLRaw-1.5.0.0.a","libHSOpenGLRaw-1.5.0.0.p_a","libHSOpenGLRaw-1.5.0.0-ghc7.8.3.so","libHSOpenGLRaw-1.5.0.0-ghc7.8.3.dylib","HSOpenGLRaw-1.5.0.0-ghc7.8.3.dll"] on library path 
Warning: haddock-interfaces: /usr/local/share/doc/x86_64-linux-ghc-7.8.3/Cabal-1.21.1.0/html/Cabal.haddock doesn't exist or isn't a file 
Warning: haddock-html: /usr/local/share/doc/x86_64-linux-ghc-7.8.3/Cabal-1.21.1.0/html doesn't exist or isn't a directory 

a następnie to:

The following packages are broken, either because they have a problem 
listed above, or because they depend on a broken package. 
text-1.1.0.1 
Cabal-1.20.0.2 
zlib-0.5.4.1 
contravariant-1.2 
void-0.6.1 
netwire-5.0.0 
semigroups-0.15.3 
unordered-containers-0.2.5.0 
transformers-compat-0.3.3.4 
exceptions-0.6.1 
MonadRandom-0.3 
mtl-2.2.1 
transformers-0.4.1.0 
cpphs-1.18.5 
polyparse-1.9 
nats-0.2 
hashable-1.2.2.0 
OpenGL-2.9.2.0 
text-1.2.0.0 
tagged-0.7.2 
stb-image-0.2.1 
split-0.2.2 
reflection-1.5.1 
random-1.0.1.1 
primitive-0.5.3.0 
prelude-extras-0.4 
parallel-3.2.0.4 
bitmap-0.0.2 
bindings-DSL-1.0.21 
GLURaw-1.4.0.1 
OpenGLRaw-1.5.0.0 
+0

Co się stanie, jeśli uruchomisz 'ghc-pkg check' zgodnie z sugestią? –

+0

@GaneshSittampalam zaktualizowane pytanie z wynikiem sprawdzania ghc-pkg –

+0

Najpierw wyczyść pakiety ghc. Praca w piaskownicach jest najbardziej niezawodnym sposobem, tak czy inaczej, pakiety globalne mają tendencję do częstych złamań. –

Odpowiedz

7

można użyć ghc-pkg unregister na każdym z rozbitych opakowań, aby oczyścić je odpowiednio, o może zepsuć cały folder ~/.ghc i zacząć od nowa. Może być konieczne użycie --force, aby uniknąć konieczności przestrzegania kolejności zależności pakietów.

+0

Myślę, że powinien również usunąć swój folder .cabal przed rozpoczęciem pracy nad – Arnon

+0

Nie usunąłem mojego .ghc dir. Żeby było jasne, czy muszę usunąć .ghc i .cabal, a następnie ponownie zainstalować ghc i cabal, czy po prostu usunąć te katalogi i zainstalować cabal? –

+1

usunięto .ghc i .cabal i spróbowałem ponownie, cabal jest zainstalowana i aktualna. Dzięki, Ganesh. –

3

Usunąłeś także ~/.ghc po usunięciu ~/.cabal? Jeśli nie, sugeruję, abyś to wypróbował, ponieważ jeśli dobrze rozumiem, pierwszy może zawierać odniesienia do pakietów zainstalowanych w drugim.

Powiązane problemy