ekmett / rounded

MPFR bindings for Haskell
http://hackage.haskell.org/package/rounded
BSD 3-Clause "New" or "Revised" License
34 stars 13 forks source link

Fix sandbox compatibility #24

Closed davidsd closed 6 years ago

davidsd commented 9 years ago

I just cloned the latest version of rounded and I'm trying to build it with Cabal 1.22 and GHC 7.8.3. After installing dependencies, upon running cabal install I get

--> Configuring MPFR 3.1.2...
--> Building MPFR 3.1.2...
Determining MPFR constants...
Building rounded-0.1...
Preprocessing library rounded-0.1...
Command "ar -x /home/dsd/projects/2015/rounded/dist/build/libHSrounded-0.1.a" failed with exit code: 9
ar: /home/dsd/projects/2015/rounded/dist/build/libHSrounded-0.1.a: No such file or directory
...
rounded-0.1 failed during the building phase. The exception was:
ExitFailure 9
This may be due to an out-of-memory condition.

I'm on a rather large machine -- it has 132 GB of RAM, so I'm confused about how an out-of-memory problem could happen. Any suggestions?

davidsd commented 9 years ago

I figured out that the problem is that I'm using a sandbox, so the build directory is not in the expected place: instead of dist/build, it's at dist/dist-sandbox-d514e406/build. Here's the problematic code in Setup.hs:

getDist = do
  -- let Flag relDistDir = Flag defaultDistPref `mappend` configDistPref flags                                                    
  -- canonicalizePath relDistDir                                                                                                  
  canonicalizePath "dist" -- ugly. There must be a safer way to get the absolute path of the dist dir

How should this work in the case of a sandbox?

claudeha commented 6 years ago

fixed by https://github.com/ekmett/rounded/pull/27 merge