Installing from separate folder with Custom build type fails #1058

Closed
snoyberg opened this Issue Oct 5, 2012 · 12 comments

Projects

None yet

3 participants

Collaborator
snoyberg commented Oct 5, 2012

This is a new issue with version 1.16 of cabal-install. Steps to reproduce:

  1. cabal unpack lifted-base-0.1.2
  2. cabal install ./lifted-base-0.1.2

The problem is that when the setup executable is called, e.g.:

lifted-base-0.1.2/dist/setup/setup configure --verbose=3 --ghc
--prefix=/home/ubuntu/.cabal --user --constraint=transformers-base ==0.4.1
--constraint=monad-control ==0.3.1.4 --constraint=base-unicode-symbols
==0.2.2.4 --constraint=base ==4.5.0.0 --disable-tests --disable-benchmarks

it is not able to find the cabal file, as it is now in the current subfolder. A theoretical fix would be to change working directory before calling that script.

dag commented Oct 9, 2012

I ran into this trying to install the clckwrks packages. It failed with obscure errors like this:

Last 10 lines of the build log ( /home/dag/.cabal/logs/clckwrks-0.12.2.log ):
Updating documentation index /home/dag/.cabal/share/doc/index.html
cabal: Error: some packages failed to install:
clckwrks-0.12.2 failed during the configure step. The exception was:
ExitFailure 127

And then the build log mentioned in the output is an empty file. I can confirm that it installs fine if I cd to the package directory first, though.

Owner
tibbe commented Oct 11, 2012

@dcoutts You've been working on being able to cabal install <something> where something might be directory. Do you know what broke this?

Owner
tibbe commented Oct 11, 2012

Works for me:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1

$ cabal --version
cabal-install version 1.16.0
using version 1.16.0.1 of the Cabal library

$ cabal unpack lifted-base-0.1.2
Unpacking to lifted-base-0.1.2/

$ cabal install ./lifted-base-0.1.2
Resolving dependencies...
[1 of 1] Compiling Main             ( lifted-base-0.1.2/Setup.hs, lifted-base-0.1.2/dist/setup/Main.o )
Linking ./lifted-base-0.1.2/dist/setup/setup ...
Configuring lifted-base-0.1.2...
Building lifted-base-0.1.2...
Preprocessing library lifted-base-0.1.2...
[1 of 9] Compiling System.Timeout.Lifted ( System/Timeout/Lifted.hs, dist/build/System/Timeout/Lifted.o )
[2 of 9] Compiling Data.IORef.Lifted ( Data/IORef/Lifted.hs, dist/build/Data/IORef/Lifted.o )
[3 of 9] Compiling Control.Concurrent.SampleVar.Lifted ( Control/Concurrent/SampleVar/Lifted.hs, dist/build/Control/Concurrent/SampleVar/Lifted.o )
[4 of 9] Compiling Control.Concurrent.QSemN.Lifted ( Control/Concurrent/QSemN/Lifted.hs, dist/build/Control/Concurrent/QSemN/Lifted.o )
[5 of 9] Compiling Control.Concurrent.QSem.Lifted ( Control/Concurrent/QSem/Lifted.hs, dist/build/Control/Concurrent/QSem/Lifted.o )
[6 of 9] Compiling Control.Concurrent.Chan.Lifted ( Control/Concurrent/Chan/Lifted.hs, dist/build/Control/Concurrent/Chan/Lifted.o )
[7 of 9] Compiling Control.Concurrent.MVar.Lifted ( Control/Concurrent/MVar/Lifted.hs, dist/build/Control/Concurrent/MVar/Lifted.o )
[8 of 9] Compiling Control.Concurrent.Lifted ( Control/Concurrent/Lifted.hs, dist/build/Control/Concurrent/Lifted.o )
[9 of 9] Compiling Control.Exception.Lifted ( Control/Exception/Lifted.hs, dist/build/Control/Exception/Lifted.o )
In-place registering lifted-base-0.1.2...
Running Haddock for lifted-base-0.1.2...
Preprocessing library lifted-base-0.1.2...
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: rts-1.0
Haddock coverage:
 100% (  2 /  2) in 'System.Timeout.Lifted'
 100% (  8 /  8) in 'Data.IORef.Lifted'
 100% (  8 /  8) in 'Control.Concurrent.SampleVar.Lifted'
 100% (  5 /  5) in 'Control.Concurrent.QSemN.Lifted'
 100% (  5 /  5) in 'Control.Concurrent.QSem.Lifted'
 100% (  8 /  8) in 'Control.Concurrent.Chan.Lifted'
 100% ( 15 / 15) in 'Control.Concurrent.MVar.Lifted'
 100% ( 35 / 35) in 'Control.Concurrent.Lifted'
 100% ( 34 / 34) in 'Control.Exception.Lifted'
Documentation created: dist/doc/html/lifted-base/index.html
Installing library in /Users/tibbe/.cabal/lib/lifted-base-0.1.2/ghc-7.4.1
Registering lifted-base-0.1.2...
Installed lifted-base-0.1.2
Updating documentation index /Users/tibbe/.cabal/share/doc/index.html

@snoyberg Could you give me the complete log, including the versions of GHC and cabal please?

Collaborator

Thanks for looking into this @tibbe. Here's the full log:

ubuntu@tealc-precise:~/Desktop$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1
ubuntu@tealc-precise:~/Desktop$ cabal --version
cabal-install version 1.16.0
using version 1.16.0.1 of the Cabal library 
ubuntu@tealc-precise:~/Desktop$ cabal unpack lifted-base-0.1.2
Unpacking to lifted-base-0.1.2/
ubuntu@tealc-precise:~/Desktop$ cabal install ./lifted-base-0.1.2 --force-reinstalls
Resolving dependencies...
Warning: The following packages are likely to be broken by the reinstalls:
yesod-core-1.1.3
yesod-static-1.1.0.1
learning-site-0.0.0
yesod-persistent-1.1.0
yesod-form-1.1.3
yesod-auth-1.1.1.2
yesod-1.1.1.2
jail-warden-0.1.0.0
vhost-manager-0.1.0.0
jail-guard-0.1.0.0
yesod-json-1.1.0
yesod-default-1.1.0.2
yesod-core-1.1.2
yesod-newsfeed-1.1.0
warp-1.3.3.1
http-reverse-proxy-0.1.0.1
keter-0.3.0.1
http-reverse-proxy-0.1.0.0
restapi-0.1.0.0
resourcet-0.4.0.1
yaml-0.8.1
stylish-haskell-0.5.2.0
network-conduit-tls-0.6.0
network-conduit-tls-0.5.0
dita-html-0.2.0.0
xml-conduit-1.0.3.1
yesod-test-0.3.0.1
xml-hamlet-0.4.0.1
dita-1.0.1
xml-catalog-0.8.0
dtd-0.6.1.2
html-conduit-0.1.0.2
classy-prelude-conduit-0.3.0.0
classy-prelude-conduit-0.2.0.0
aws-0.7.2
authenticate-1.3.1.1
wai-extra-1.3.0.2
pool-conduit-0.1.0.3
persistent-1.0.1.2
persistent-template-1.0.0.2
persistent-sqlite-1.0.0
persistent-postgresql-1.0.0
monad-logger-0.2.1
http-conduit-1.6.1.1
conduit-0.5.2.5
zlib-conduit-0.5.0.1
wai-test-1.3.0
wai-1.3.0.1
wai-logger-0.3.0
wai-app-static-1.3.0.2
uri-conduit-0.5.0.2
unix-process-conduit-0.1.0
tagstream-conduit-0.5.3
network-conduit-0.6.1
network-conduit-0.6.0
network-conduit-0.5.1
markdown-0.1.1
imagesize-conduit-0.5.0.1
filesystem-conduit-0.5.0.1
crypto-conduit-0.4.0.1
blaze-builder-conduit-0.5.0.1
attoparsec-conduit-0.5.0.2
conduit-0.5.2.4
Continuing even though the plan contains dangerous reinstalls.
[1 of 1] Compiling Main             ( lifted-base-0.1.2/Setup.hs, lifted-base-0.1.2/dist/setup/Main.o )
Linking ./lifted-base-0.1.2/dist/setup/setup ...
Failed to install lifted-base-0.1.2
cabal: Error: some packages failed to install:
lifted-base-0.1.2 failed during the configure step. The exception was:
ExitFailure 127
Owner
tibbe commented Oct 12, 2012

@snoyberg Very odd. I'm at a loss about what to do. Here's how configure is called in my case:

Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install lifted-base-0.1.2
Waiting for install task to finish...
creating lifted-base-0.1.2/dist/setup
creating lifted-base-0.1.2/dist
creating lifted-base-0.1.2/dist/setup
/usr/bin/ghc --make ./lifted-base-0.1.2/Setup.hs -o ./lifted-base-0.1.2/dist/setup/setup -odir ./lifted-base-0.1.2/dist/setup -hidir ./lifted-base-0.1.2/dist/setup -i -i./lifted-base-0.1.2 -package Cabal-1.14.0
[1 of 1] Compiling Main             ( lifted-base-0.1.2/Setup.hs, lifted-base-0.1.2/dist/setup/Main.o )
Linking ./lifted-base-0.1.2/dist/setup/setup ...
./lifted-base-0.1.2/dist/setup/setup configure --verbose=2 --ghc
--prefix=/Users/tibbe/.cabal --user --constraint=transformers-base ==0.4.1
--constraint=monad-control ==0.3.1.4 --constraint=base-unicode-symbols
==0.2.2.4 --constraint=base ==4.5.0.0 --disable-tests --disable-benchmarks

Could you try to install with -v and get some more context around the invocation of ./lifted-base-0.1.2/dist/setup/setup? Could you get cabal to only install that package, not its dependencies, and then post the complete log with -v of that?

Owner
tibbe commented Oct 12, 2012

I'm working towards a Cabal/cabal-install bug fix release this weekend and this is the last issue on the list of issues to fix, so if someone has some insight about what's going on here that would be great.

Collaborator

Here's my output.

/usr/bin/ghc --make ./lifted-base-0.1.2/Setup.hs -o ./lifted-base-0.1.2/dist/setup/setup -odir ./lifted-base-0.1.2/dist/setup -hidir ./lifted-base-0.1.2/dist/setup -i -i./lifted-base-0.1.2 -package Cabal-1.16.0.1
[1 of 1] Compiling Main             ( lifted-base-0.1.2/Setup.hs, lifted-base-0.1.2/dist/setup/Main.o )
Linking ./lifted-base-0.1.2/dist/setup/setup ...
./lifted-base-0.1.2/dist/setup/setup configure --verbose=2 --ghc
--prefix=/home/ubuntu/.cabal --user --constraint=transformers-base ==0.4.1
--constraint=monad-control ==0.3.1.4 --constraint=base-unicode-symbols
==0.2.2.4 --constraint=base ==4.5.0.0 --disable-tests --disable-benchmarks
Failed to install lifted-base-0.1.2
cabal: Error: some packages failed to install:
lifted-base-0.1.2 failed during the configure step. The exception was:
ExitFailure 127

I noticed that in yours, the setup executable is compiled against Cabal-1.14.0, whereas in mine it's using Cabal-1.16.0.1. I tried unregistering Cabal-1.16.0.1 and starting over, but to no avail:

/usr/bin/ghc --make ./lifted-base-0.1.2/Setup.hs -o ./lifted-base-0.1.2/dist/setup/setup -odir ./lifted-base-0.1.2/dist/setup -hidir ./lifted-base-0.1.2/dist/setup -i -i./lifted-base-0.1.2/ -package Cabal-1.14.0
[1 of 1] Compiling Main             ( lifted-base-0.1.2/Setup.hs, lifted-base-0.1.2/dist/setup/Main.o )
Linking ./lifted-base-0.1.2/dist/setup/setup ...
./lifted-base-0.1.2/dist/setup/setup configure --verbose=2 --ghc
--prefix=/home/ubuntu/.cabal --user --constraint=transformers-base ==0.4.1
--constraint=monad-control ==0.3.1.4 --constraint=base-unicode-symbols
==0.2.2.4 --constraint=base ==4.5.0.0 --disable-tests --disable-benchmarks
Failed to install lifted-base-0.1.2
cabal: Error: some packages failed to install:
lifted-base-0.1.2 failed during the configure step. The exception was:
ExitFailure 127

Then I tried to use the old cabal executable (0.14.0) with the setup executable created by the new cabal (1.16.0), and it seemed to work just fine:

creating lifted-base-0.1.2/dist/setup
./lifted-base-0.1.2/dist/setup/setup configure --verbose=2 --ghc
--prefix=/home/ubuntu/.cabal --user --constraint=transformers-base ==0.4.1
--constraint=monad-control ==0.3.1.4 --constraint=base-unicode-symbols
==0.2.2.4 --constraint=base ==4.5.0.0 --disable-tests --disable-benchmarks
Configuring lifted-base-0.1.2...
Dependency base ==4.5.0.0: using base-4.5.0.0
Dependency base-unicode-symbols ==0.2.2.4: using base-unicode-symbols-0.2.2.4

I'm doing some research myself, I'll put it in a separate comment.

@snoyberg snoyberg added a commit to snoyberg/cabal that referenced this issue Oct 13, 2012
@snoyberg snoyberg Fix installing from custom folder on Linux (#1058) 48082b9
Collaborator

I've send a pull request (#1066) for this. @tibbe I'm going to guess you're testing on Mac, whereas @dag is testing on Linux. Is that correct? My guess is that process works differently for those two systems, though I haven't researched yet.

Owner
tibbe commented Oct 13, 2012

Fixed in 48082b9.

@tibbe tibbe closed this Oct 13, 2012
dag commented Oct 13, 2012

@snoyberg Correct.

Collaborator

@tibbe Could you have a look at http://hackage.haskell.org/trac/ghc/ticket/7327? It seems that Ian is having difficulty reproducing the difference in behavior, and since I've never actually run this code on Mac I can't help.

Owner
tibbe commented Apr 25, 2013

@snoyberg Replied on the GHC Trac. Ian's example segfaults on my machine!

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