Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a maximum number of modules that can be compiled via Cabal?

Tags:

haskell

ghc

cabal

Is there a maximum number of modules that can be compiled via Cabal / via GHC?

I do have a rather large project (many auto generated modules) which does not compile using cabal, but no error message shows up. Cabal just silently exits with exit code 127 (Mac OS X, happens in 10.6 and 10.8, only these 2 platforms tested; GHC 7.4.2).

EDIT Output of cabal build -v3:

>>> cabal build -v3
Using internal setup method with build-type Simple and args:
["build","--verbose=3"]
creating dist/build
creating dist/build/autogen
Building java-bindings-1.0...
Preprocessing library java-bindings-1.0...
Building library...
creating dist/build
("/usr/bin/ghc",["--make","-package-name","java-bindings-1.0","-v","-hide-all-packages","-fbuilding-cabal-package","-i","-idist/build","-i.","-idist/build/autogen","-Idist/build/autogen","-Idist/build","-optP-include","-optPdist/build/autogen/cabal_macros.h","-odir","dist/build","-hidir","dist/build","-stubdir","dist/build","-package-id","base-4.5.1.0-81d626fb996bc7e140a3fd4481b338cd","-package-id","java-bridge-0.20130602-5cb59a7e71733b25cf4b8a8ae649598b","-O","-XHaskell98","Java.Applet", (references to the other modules)
/usr/bin/ghc returned ExitFailure 127

Now that I see that output I believe it maybe is the number of command line arguments that are being passed to ghc - I believe there is a maximum length imposed by the operating system... Is there a way to circumvent this limitation?

like image 335
scravy Avatar asked Nov 03 '22 20:11

scravy


1 Answers

Yes - the operating system places a limit on the length of a command line, which is used internally for the final linking step.

I'm not sure what to suggest here, other than reporting the bug against Cabal and maybe trying to fix it yourself. Cabal's code is pretty readable, if you go that route. :)

like image 177
Irene Knapp Avatar answered Nov 15 '22 08:11

Irene Knapp