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
I have a Haskell library that uses extra-libraries: glog.
When I try to build it I get:
Setup: Missing dependencies on foreign libraries:
* Missing C libraries: glog
This is a lie; the dependency exists.
The problem is that because in the eventual gcc invocation that Cabal creates to check whether the dependency really exists (I suspect it compiles a small C file to check if it can really use glog, similar to how autoconf does it), the amount of arguments passed to GCC turns out to be very long (further inflated by the fact that I use nix, but in general that's just a small constant factor difference).
execve("cc1", [arguments here], [env vars here, "COLLECT_GCC_OPTIONS='-fno-stack-protector -L... 150KB of -L flags here'"] = -1 E2BIG (Argument list too long)
E2BIG (Argument list too long), in this case because COLLECT_GCC_OPTIONS is longer than 128 KB (32 * 4 KB pages, see here).
But cabal doesn't correctly propagate the E2BIG failure; instead of telling me that some internal invocaiton failed, it claims Missing dependencies on foreign libraries.
The text was updated successfully, but these errors were encountered:
I think that this should be easy to fix: just check the exit code and tweak the error message. The relevant code is in Distribution.Simple.Configure.checkForeignDeps.
I have a Haskell library that uses
extra-libraries: glog
.When I try to build it I get:
This is a lie; the dependency exists.
The problem is that because in the eventual
gcc
invocation that Cabal creates to check whether the dependency really exists (I suspect it compiles a small C file to check if it can really useglog
, similar to howautoconf
does it), the amount of arguments passed to GCC turns out to be very long (further inflated by the fact that I usenix
, but in general that's just a small constant factor difference).Strace confirms:
E2BIG (Argument list too long)
, in this case becauseCOLLECT_GCC_OPTIONS
is longer than 128 KB (32 * 4 KB pages, see here).But cabal doesn't correctly propagate the
E2BIG
failure; instead of telling me that some internal invocaiton failed, it claimsMissing dependencies on foreign libraries
.The text was updated successfully, but these errors were encountered: