[Haskell-cafe] cabal install oddities
Manuel Gómez
targen at gmail.com
Wed Mar 13 00:12:21 CET 2013
On Tue, Mar 12, 2013 at 3:10 PM, Tycho Andersen <tycho at tycho.ws> wrote:
> 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.
More information about the Haskell-Cafe
mailing list