You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cabal install should change directory before building a local package #1236
cd tmp/foo && cabal install && cd -
cabal install tmp/foo
The former succeeds; the latter fails.
This is biting me in gtk2hs, where I sometimes wish to re-install several packages with a command like "cabal install ./cairo ./gtk" rather than the more unwieldy and fragile "cd cairo && cabal install --force-reinstalls && cd ../gtk && cabal install && cd ..".
Hm. It doesn't work here. Transcript enclosed below. I'll try fresh from git and report back.
crabgrass:~% cabal --version
cabal-install version 1.16.0
using version 1.16.0 of the Cabal library
crabgrass:~% ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.1
crabgrass:~% wget http://dmwit.com/tmp.tar.gz
--2013-03-15 09:52:04-- http://dmwit.com/tmp.tar.gz
Resolving dmwit.com (dmwit.com)... 69.90.123.70
Connecting to dmwit.com (dmwit.com)|69.90.123.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 584 [application/x-gzip]
Saving to: ‘tmp.tar.gz’
100%[=====================================================================================>] 584 --.-K/s in 0s
2013-03-15 09:52:04 (77.0 MB/s) - ‘tmp.tar.gz’ saved [584/584]
crabgrass:~% tar xf tmp.tar.gz
crabgrass:~% cabal install tmp/foo
Warning: The package list for 'hackage.haskell.org' is 17 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
In order, the following will be installed:
foo-0.0 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
[1 of 1] Compiling Main ( tmp/foo/Setup.hs, tmp/foo/dist/setup/Main.o )
Linking tmp/foo/dist/setup/setup ...
Failed to install foo-0.0
cabal: Error: some packages failed to install:
foo-0.0 failed during the configure step. The exception was:
ExitFailure 127
zsh: exit 1 cabal install tmp/foo
Hm. I can't build the given package at all with cabal-install from git, though it seems to be a different problem.
crabgrass:~/tmp/foo% cabal --version
cabal-install version 1.17.0
using version 1.17.0 of the Cabal library
crabgrass:~/tmp/foo% cabal install
Warning: The package list for 'hackage.haskell.org' is 17 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
In order, the following will be installed:
foo-0.0 (latest: 1.0) (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
[1 of 1] Compiling Main ( Setup.hs, dist/setup/Main.o )
Linking ./dist/setup/setup ...
Configuring foo-0.0...
Building foo-0.0...
Preprocessing library foo-0.0...
In-place registering foo-0.0...
setup: foo-0.0: Warning: haddock-interfaces:
/home/dmwit/tmp/foo/dist/doc/html/foo/foo.haddock doesn't exist or isn't a
file
foo-0.0: Warning: haddock-html: /home/dmwit/tmp/foo/dist/doc/html/foo doesn't
exist or isn't a directory
foo-0.0: cannot find libHSfoo-0.0.a on library path (use --force to override)
Failed to install foo-0.0
cabal: Error: some packages failed to install:
foo-0.0 failed during the building phase. The exception was:
ExitFailure 1
zsh: exit 1 cabal install
I have changed from "documentation: True" to "documentation: False" in ~/.cabal/config and added --disable-documentation, but this error persists. I'll try again in a few days, and when I can build the package from within the directory, I'll let you know if I can build from outside the directory.
Strange. Maybe it's a configuration issue? I tried toggling various settings (like split-objs, documentation, jobs etc), but the package still builds fine. Can you post your ~/.cabal/config? And by the way, which OS are you on?
For the record, I can't reproduce either -- it installs fine for me with both 1.16 and HEAD cabal-install. Can you try running cabal install -v3? It might give us more clues about what is failing.
Okay, I've split off the discussion of the problem I'm having with the most recent version from git into issue 1241. For the following, I'll report what happens with non-git cabal-install.
crabgrass:~/tmp% cabal --version
cabal-install version 1.16.0
using version 1.16.0 of the Cabal library
crabgrass:~/tmp% cabal install -v3 foo/
searching for ghc in path.
found ghc at /usr/local/bin/ghc
("/usr/local/bin/ghc",["--numeric-version"])
/usr/local/bin/ghc is version 7.6.1
looking for tool "ghc-pkg" near compiler in /usr/local/bin
found ghc-pkg in /usr/local/bin/ghc-pkg
("/usr/local/bin/ghc-pkg",["--version"])
/usr/local/bin/ghc-pkg is version 7.6.1
("/usr/local/bin/ghc",["--supported-languages"])
("/usr/local/bin/ghc",["--info"])
Reading installed packages...
("/usr/local/bin/ghc-pkg",["dump","--global","-v0"])
("/usr/local/bin/ghc-pkg",["dump","--user","-v0"])
("/usr/local/bin/ghc",["--print-libdir"])
Reading available packages...
Warning: The package list for 'hackage.haskell.org' is 18 days old.
Run 'cabal update' to get the latest list of available packages.
Choosing modular solver.
Resolving dependencies...
[__0] rejecting: foo-1.0 (global constraint requires ==0.0)
[__0] trying: foo-0.0
[__1] done
In order, the following will be installed:
foo-0.0 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Ready to install foo-0.0
Waiting for install task to finish...
Using external setup method with build-type Custom
creating foo/dist/setup
Using Cabal library version 1.16.0
Using foo/Setup.hs as setup script.
foo/dist/setup/setup configure --verbose=3 --ghc
--prefix=/home/dmwit/.cabal/$arch --enable-library-profiling --user
--disable-tests --disable-benchmarks
Failed to install foo-0.0
cabal: Error: some packages failed to install:
foo-0.0 failed during the configure step. The exception was:
ExitFailure 127
zsh: exit 1 cabal install -v3 foo/
Hmm, odd how the output just stops after calling foo/dist/setup/setup configure .... When I run the same command (cabal install foo/ -v3) the
output I see is
...
Using foo/Setup.hs as setup script.
foo/dist/setup/setup configure --verbose=3 --ghc
--prefix=/home1/b/byorgey/local --user --disable-tests --disable-benchmarks
Redirecting build log to {handle: /home1/b/byorgey/.cabal/logs/foo-0.0.log}
Building foo-0.0...
...
Note also that if I try running this command directly, I get an error about bar:
LVN513-9 :: ~/tmp/tmp » foo/dist/setup/setup configure --verbose=3 --ghc
--prefix=/home1/b/byorgey/local --user --disable-tests --disable-benchmarks
setup: bar: openFile: does not exist (No such file or directory)
so it seems like cabal really is setting the current directory to foo
before calling the setup script.
I wonder if the $arch bit in your command line (from your prefix field)
is getting interpreted in some funny way by your shell? Note that directly
running the setup script like this is triggered by having build-type: Custom, so I wonder what happens if you make a package with build-type: Custom but nothing in the Setup script that actually depends on the
current directory, just main = defaultMain?
Just sat down with Brent. Some things we discovered:
top order bit: this bug doesn't appear in 1.16.0.2, so may be worth closing this issue
it has nothing to do with the working directory: the compiled setup program just never runs
in the log, cabal claims to run the program "foo/dist/...", so we thought perhaps the extra "foo/" was a problem -- but by symlinking "foo/foo" to "foo/dist", we discovered this was not it
the $arch thing is probably a red herring as well: we changed this to a literal directory, and the same problem happened
Activity
23Skidoo commentedon Mar 15, 2013
Couldn't reproduce (both 0.14 and the git version work fine):
dmwit commentedon Mar 15, 2013
Hm. It doesn't work here. Transcript enclosed below. I'll try fresh from git and report back.
23Skidoo commentedon Mar 15, 2013
Maybe it was just a 1.16 bug?
dmwit commentedon Mar 15, 2013
Hm. I can't build the given package at all with cabal-install from git, though it seems to be a different problem.
I have changed from "documentation: True" to "documentation: False" in ~/.cabal/config and added --disable-documentation, but this error persists. I'll try again in a few days, and when I can build the package from within the directory, I'll let you know if I can build from outside the directory.
dmwit commentedon Mar 15, 2013
Oh, and I just noticed the "use --force to override" suggestion; --force doesn't fix it, either.
23Skidoo commentedon Mar 15, 2013
Strange. Maybe it's a configuration issue? I tried toggling various settings (like
split-objs,documentation,jobsetc), but the package still builds fine. Can you post your~/.cabal/config? And by the way, which OS are you on?dmwit commentedon Mar 15, 2013
byorgey commentedon Mar 15, 2013
For the record, I can't reproduce either -- it installs fine for me with both 1.16 and HEAD cabal-install. Can you try running
cabal install -v3? It might give us more clues about what is failing.dmwit commentedon Mar 15, 2013
Okay, I've split off the discussion of the problem I'm having with the most recent version from git into issue 1241. For the following, I'll report what happens with non-git cabal-install.
byorgey commentedon Mar 15, 2013
Hmm, odd how the output just stops after calling
foo/dist/setup/setup configure .... When I run the same command (cabal install foo/ -v3) theoutput I see is
Note also that if I try running this command directly, I get an error about
bar:so it seems like
cabalreally is setting the current directory tofoobefore calling the setup script.
I wonder if the
$archbit in your command line (from yourprefixfield)is getting interpreted in some funny way by your shell? Note that directly
running the setup script like this is triggered by having
build-type: Custom, so I wonder what happens if you make a package withbuild-type: Custombut nothing in the Setup script that actually depends on thecurrent directory, just
main = defaultMain?dmwit commentedon Mar 15, 2013
Just sat down with Brent. Some things we discovered:
byorgey commentedon Mar 15, 2013
Looks like this was fixed in 1.16.0.2 by 48082b9. Closing as duplicate of #1058.