Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal-install-1.20.0.3 failed during the building phase. The exception was: ExitFailure 1 #2193

Closed
Dangthrimble opened this issue Oct 30, 2014 · 9 comments
Assignees

Comments

@Dangthrimble
Copy link

I am trying to build a Haskell IDE around Sublime Text on a Windows platform and have had a number of issues (some of my own making!), including working out how to successfully update and install cabal after installing Haskell Platform. In an attempt to prove I had found the solution I uninstalled Haskell Platform in order to start again. I then discovered the %AppDapa%\cabal and %AppData%\ghc folders were not getting deleted. I deleted those after an uninstall, then reinstalled Haskell Platform. I performed a cabal update followed by cabal install --global cabal-install but cabal failed to build, as it did again when I performed cabal install cabal-install for a user install. Consequently, I edited %AppData%\cabal\config to perform a global install:

32 - | -- user-install: True
32 + | user-install: False

cabal install cabal-install still failed to build.

The output from cabal install cabal-install -v is:

>cabal install cabal-install -v
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install cabal-install-1.20.0.3
Waiting for install task to finish...
Extracting
%AppData%\cabal\packages\hackage.haskell.org\cabal-install\1.20.0.3\cabal-install-1.20.0.3.tar.gz
to %Temp%\cabal-install-1.20.0.3-3632...
Updating cabal-install.cabal with the latest revision from the index.
Configuring cabal-install-1.20.0.3...
creating
%Temp%\cabal-install-1.20.0.3-3632\cabal-install-1.20.0.3\dist\setup
creating
%Temp%\cabal-install-1.20.0.3-3632\cabal-install-1.20.0.3\dist
creating
%Temp%\cabal-install-1.20.0.3-3632\cabal-install-1.20.0.3\dist\setup
%AppData%\cabal\setup-exe-cache\setup-Cabal-1.18.1.3-i386-windows-ghc-7.8.3.exe
configure --verbose=2 --ghc --prefix=%ProgramFiles%\Haskell
--bindir=%ProgramFiles%\Haskell\bin --libdir=%ProgramFiles%\Haskell
--libsubdir=i386-windows-ghc-7.8.3\cabal-install-1.20.0.3
--libexecdir=%ProgramFiles%\Haskell\cabal-install-1.20.0.3
--datadir=%ProgramFiles%\Haskell
--datasubdir=i386-windows-ghc-7.8.3\cabal-install-1.20.0.3 --docdir=%ProgramFiles%\Haskell\doc\i386-windows-ghc-7.8.3\cabal-install-1.20.0.3
--htmldir=%ProgramFiles%\Haskell\doc\i386-windows-ghc-7.8.3\cabal-install-1.20.0.3\html
--haddockdir=%ProgramFiles%\Haskell\doc\i386-windows-ghc-7.8.3\cabal-install-1.20.0.3\html
--sysconfdir=%ProgramFiles%\Haskell\etc --global --flags=-old-directory
--extra-prog-path=%AppData%\cabal\bin --constraint=zlib
==0.5.4.1 --constraint=time ==1.4.2 --constraint=stm ==2.4.2
--constraint=random ==1.0.1.1 --constraint=process ==1.2.0.0
--constraint=pretty ==1.1.1.1 --constraint=network ==2.4.2.3 --constraint=mtl
==2.1.3.1 --constraint=filepath ==1.3.0.2 --constraint=directory ==1.2.1.0
--constraint=containers ==0.5.5.1 --constraint=bytestring ==0.10.4.0
--constraint=base ==4.7.0.1 --constraint=array ==0.5.0.0 --constraint=Win32
==2.3.0.2 --constraint=HTTP ==4000.2.10 --constraint=Cabal ==1.20.0.2
--disable-tests --disable-benchmarks
Redirecting build log to {handle:
%AppData%\cabal\logs\cabal-install-1.20.0.3.log}
Building cabal-install-1.20.0.3...
creating
%Temp%\cabal-install-1.20.0.3-3632\cabal-install-1.20.0.3\dist\setup
%AppData%\cabal\setup-exe-cache\setup-Cabal-1.18.1.3-i386-windows-ghc-7.8.3.exe
build --verbose=2
Redirecting build log to {handle:
%AppData%\cabal\logs\cabal-install-1.20.0.3.log}
Failed to install cabal-install-1.20.0.3
Last 10 lines of the build log ( %AppData%\cabal\logs\cabal-install-1.20.0.3.log ):
Building cabal-install-1.20.0.3...
Preprocessing executable 'cabal' for cabal-install-1.20.0.3...
Building executable cabal...
creating dist\build\cabal
creating dist\build\cabal\cabal-tmp
"%ProgramFiles%\Haskell Platform\2014.2.0.0\bin\ghc.exe" "--info"
"%ProgramFiles%\Haskell Platform\2014.2.0.0\bin\ghc.exe" "--info"
%ProgramFiles%\Haskell Platform\2014.2.0.0\bin\ghc.exe --make -no-link -fbuilding-cabal-package -O -static -outputdir dist\build\cabal\cabal-tmp -odir dist\build\cabal\cabal-tmp -hidir dist\build\cabal\cabal-tmp -stubdir dist\build\cabal\cabal-tmp -i -idist\build\cabal\cabal-tmp -i. -idist\build\autogen -Idist\build\autogen -Idist\build\cabal\cabal-tmp -optP-DWIN32 -optP-include -optPdist\build\autogen\cabal_macros.h -hide-all-packages -no-user-package-db -package-db dist\package.conf.inplace -package-id Cabal-1.20.0.2-a16388bcb008734a1fcd511e545a5444 -package-id HTTP-4000.2.10-987800e8b0c6d40f66bb99afe447f40d -package-id Win32-2.3.0.2-d56c4f098954acca048f4bc5e4a2dfac -package-id array-0.5.0.0-98fe9c08a812a9c7cc1f850abbc1e156 -package-id base-4.7.0.1-b8b519b4c88e723e19a6e0b09e657c9c -package-id bytestring-0.10.4.0-3ac5767dbef80caf4351e9a7659b1514 -package-id containers-0.5.5.1-90fc7ef640bd5e2731140e1fbf95388b -package-id directory-1.2.1.0-8683b51e2f5cf0f2ee71e7410e07382f -package-id filepath-1.3.0.2-5c3cb415b85617527a5cdd5e8d2cdaa7 -package-id mtl-2.1.3.1-b302a49efefb9da50c7e82fda6cad861 -package-id network-2.4.2.3-6312f7d17328f63ad124c9a8ed585201 -package-id pretty-1.1.1.1-c9506cc4f3785a37401342fbd951ee65 -package-id process-1.2.0.0-6756d1f0b295bf0910537627b7cca92a -package-id random-1.0.1.1-45f3a37f12f47b83616e5a6f8138ea9b -package-id stm-2.4.2-2e36688a62070b28018fb04f6deb2a19 -package-id time-1.4.2-29f80b96bef8468cd764ebf6261249d5 -package-id zlib-0.5.4.1-3053a0562e16f53f591449c6d5aef910 -X Haskell98 .\Main.hs -Wall -fwarn-tabs -threaded
<command line>: cannot satisfy -package-id Cabal-1.20.0.2-a16388bcb008734a1fcd511e545a5444
    (use -v for more information)
World file is already up to date.
cabal: Error: some packages failed to install:
cabal-install-1.20.0.3 failed during the building phase. The exception was:
ExitFailure 1

>

Is there a way to carry out a complete uninstall of Haskell Platform, cabal, ghc, etc. so that a new install will work? And can anyone advise what is preventing cabal to install?

Thanks

@23Skidoo
Copy link
Member

What's the output of ghc-pkg list?

@Dangthrimble
Copy link
Author

>ghc-pkg list
WARNING: cache is out of date: C:/Program Files/Haskell Platform/2014.2.0.0\lib\package.conf.d\package.cache
Use 'ghc-pkg recache' to fix.
C:/Program Files/Haskell Platform/2014.2.0.0\lib\package.conf.d:
    Cabal-1.18.1.3
    Cabal-1.20.0.2
    GLURaw-1.4.0.1
    GLUT-2.5.1.1
    HTTP-4000.2.10
    HUnit-1.2.5.2
    OpenGL-2.9.2.0
    OpenGLRaw-1.5.0.0
    QuickCheck-2.6
    Win32-2.3.0.2
    array-0.5.0.0
    async-2.0.1.5
    attoparsec-0.10.4.0
    base-4.7.0.1
    bin-package-db-0.0.0.0
    binary-0.7.1.0
    rts-1.0
    bytestring-0.10.4.0
    case-insensitive-1.1.0.3
    containers-0.5.5.1
    deepseq-1.3.0.2
    directory-1.2.1.0
    fgl-5.5.0.1
    filepath-1.3.0.2
    (ghc-7.8.3)
    ghc-prim-0.3.1.0
    hashable-1.2.2.0
    haskeline-0.7.1.2
    haskell-src-1.0.1.6
    (haskell2010-1.1.2.0)
    (haskell98-2.0.0.3)
    hoopl-3.10.0.1
    hpc-0.6.0.1
    hscolour-1.20.3
    html-1.0.1.2
    integer-gmp-0.5.1.0
    mtl-2.1.3.1
    network-2.4.2.3
    old-locale-1.0.0.6
    old-time-1.1.0.2
    parallel-3.2.0.4
    parsec-3.1.5
    pretty-1.1.1.1
    primitive-0.5.2.1
    process-1.2.0.0
    random-1.0.1.1
    regex-base-0.93.2
    regex-compat-0.95.1
    regex-posix-0.95.2
    split-0.2.2
    stm-2.4.2
    syb-0.4.1
    template-haskell-2.9.0.0
    text-1.1.0.0
    time-1.4.2
    transformers-0.3.0.0
    unordered-containers-0.2.4.0
    vector-0.10.9.1
    xhtml-3000.2.1
    xhtml-3000.2.1
    zlib-0.5.4.1

Did a ghc-pkg recache as suggested above followed by a cabal install --global cabal-install and got the following:

C:\>cabal install --global cabal-install
Resolving dependencies...
Configuring cabal-install-1.20.0.3...
Building cabal-install-1.20.0.3...
Failed to install cabal-install-1.20.0.3
Last 10 lines of the build log ( %AppData%\cabal\logs\cabal-install-1.20.0.3.log ):
    Could not find module `Distribution.Verbosity'
    There are files missing in the `Cabal-1.20.0.2' package,
    try running 'ghc-pkg check'.
    Use -v to see a list of the files searched for.

Main.hs:137:8:
    Could not find module `Distribution.Version'
    There are files missing in the `Cabal-1.20.0.2' package,
    try running 'ghc-pkg check'.
    Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
cabal-install-1.20.0.3 failed during the building phase. The exception was:
ExitFailure 1

@23Skidoo
Copy link
Member

C:/Program Files/Haskell Platform/2014.2.0.0\lib\package.conf.d:
    Cabal-1.18.1.3
    Cabal-1.20.0.2

So you have Cabal-1.20 installed globally, but it's in a broken state. I suggest:

  • Uninstalling HP.
  • Removing %AppDapa%\cabal, %AppDapa%\ghc and C:/Program Files/Haskell Platform directories.
  • Reinstalling HP.

I also recommend building cabal-install in a sandbox:

$ mkdir sandbox
$ cd sandbox
$ cabal sandbox init
$ cabal install cabal-install

This way, if anything goes wrong, your system won't be borked. You can later copy the cabal executable from .cabal-sandbox/bin to %PROGRAMFILES%/bin.

@Dangthrimble
Copy link
Author

I'm making a right mess of this, but I guess it's the best way to learn! Thanks for the advice. I presume I will have to be in the sandbox directory to use that version of cabal.

@23Skidoo
Copy link
Member

If you run cabal install cabal-install when in sandbox, it will install the cabal exe to ./.cabal-sandbox/bin. You can then copy the exe to %PROGRAMFILES%/bin and delete the sandbox.

And BTW, we have binary downloads available on the website: https://www.haskell.org/cabal/download.html

@23Skidoo
Copy link
Member

Optimistically closing.

@Dangthrimble
Copy link
Author

If only I'd known about the binary! So the easiest way to install cabal is from a binary after installing Haskell Platform? Are there any limitations to doing it that way?

I'll tidy it all up as you suggest and give it another go, this time with the binary.

@23Skidoo
Copy link
Member

Are there any limitations to doing it that way?

We only provide a 32-bit version ATM.

@Dangthrimble
Copy link
Author

For the record, I uninstalled Haskell Platform, deleted the %AppDapa%\cabal, %AppDapa%\ghc and ProgramFiles%/Haskell Platform directories and reinstalled Haskell Platform. Tried cabal install --global cabal-install but HP's cabal didn't recognise --global so I ran cabal update. This created %AppData%\cabal\config which I updated as follows to force a global install:

32 - | -- user-install: True
32 + | user-install: False

cabal install cabal-install then successfully updated HP's version of cabal.

@23Skidoo's optimism was well placed.

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

No branches or pull requests

2 participants