
Hi all, I'm having some strange issues with cabal install. Some packages installed via `cabal install $foo` are failing for strange (and seemingly unrelated) reasons, but install just fine when I do something like: cabal unpack network cd network cabal configure cabal install Below is some sample output from a failing package: ps168825:~/playground$ cabal install network Resolving dependencies... Configuring network-2.4.1.2... configure: WARNING: unrecognized options: --with-compiler, --with-gcc checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in `/tmp/network-2.4.1.2-28534/network-2.4.1.2': configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details Failed to install network-2.4.1.2 cabal: Error: some packages failed to install: network-2.4.1.2 failed during the configure step. The exception was: ExitFailure 1 ps168825:~/playground 1$ cabal --version cabal-install version 1.16.0.2 using version 1.16.0 of the Cabal library ps168825:~/playground$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.6.2 /tmp/network-* doesn't exist (which is why I tried unpack, but unfortunately that succeeds). Any thoughts on how I can debug this? Thanks, \t

On Tue, Mar 12, 2013 at 3:21 PM, Tycho Andersen
Below is some sample output from a failing package:
ps168825:~/playground$ cabal install network Resolving dependencies... Configuring network-2.4.1.2... configure: WARNING: unrecognized options: --with-compiler, --with-gcc checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in `/tmp/network-2.4.1.2-28534/network-2.4.1.2': configure: error: cannot run C compiled programs.
"cabal install" unpacks a package into /tmp in order to build it. My guess is your OS has /tmp mounted noexec. I don't know offhand how you override this in cabal. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Tue, Mar 12, 2013 at 03:28:08PM -0400, Brandon Allbery wrote:
"cabal install" unpacks a package into /tmp in order to build it. My guess is your OS has /tmp mounted noexec. I don't know offhand how you override this in cabal.
Yep, you're exactly right. Thank you! I also couldn't figure out a way to override it. \t

On Tue, Mar 12, 2013 at 3:10 PM, Tycho Andersen
On Tue, Mar 12, 2013 at 03:28:08PM -0400, Brandon Allbery wrote:
"cabal install" unpacks a package into /tmp in order to build it. My guess is your OS has /tmp mounted noexec. I don't know offhand how you override this in cabal.
Yep, you're exactly right. Thank you! I also couldn't figure out a way to override it.
I ran into this once. I suppose it’s a bit of a dirty workaround, but you can patch `Cabal` or `directory` to avoid this problem by either hard-coding a different path for temporary files. `System.Directory.getTemporaryDirectory` in the `directory` package has `/tmp` kind-of hardcoded in UNIX. Or you could hack the places where it’s used in `Cabal`. It’s used in these locations in the latest version: * `./Distribution/Simple/GHC.hs`, line 342 * `./Distribution/Simple/Utils.hs`, line473 * `./Distribution/Simple/Configure.hs`, line 945 * `./Distribution/Simple/LHC.hs`, line 203 I say it’s kind-of hardcoded because it actually seems to try taking the value of the environment variable `TMPDIR`, so you may be able to override that path quite simply by defining that in your environment. I have not tested this, though — I didn’t notice it when I faced this problem a few months ago. This, of course, would be the best solution.
participants (3)
-
Brandon Allbery
-
Manuel Gómez
-
Tycho Andersen