Trouble building xmobar: Argument list too long

With GHC 9.4.5 on NixOS 24.05, it seems I am encountering this issue when trying to build xmobar:

/ghc-bignum-1.3/include -I/nix/store/k2nxkk1glg5blqjpak6incqyjyhgdnlm-elfutils-0.191-dev/include -I/nix/store/1xcnwyx7pdmdq66xdz20fbl2q0arjzrl-libffi-3.4.6-dev/include -I/nix/store/lnp12bydmfwjf19wbnw0xzynq1xx86ad-ghc-9.6.4/lib/ghc-9.6.4/lib/../lib/x86_64-linux-ghc-9.6.4/rts-1.0.2/include -I/nix/store/lnp12bydmfwjf19wbnw0xzynq1xx86ad-ghc-9.6.4/include/
xmobar> error: gcc: fatal error: cannot execute ‘/nix/store/14c6s4xzhy14i2b05s00rjns2j93gzz4-gcc-13.2.0/libexec/gcc/x86_64-unknown-linux-gnu/13.2.0/cc1’: execv: Argument list too long
xmobar> compilation terminated.

Quite possibly, I’m going about this the wrong way - I have detailed instructions and all the relevant files at GitHub - bbarker/dotxmonad at 0fdc2c9f4efb2895350474c2ceb7784cbf1c919f - any suggestions would be welcome.

I’ve seen various posts with possible fixes, though most of these should have been upstreamed and released prior to the release of Nix and GHC I’m using (I think).


I run into the same problem with wxdirect from the wxHaskell git repository.

1 Like

You may possibly be running into GCC fails because argument list created by nix is too long · Issue #41340 · NixOS/nixpkgs · GitHub.

An easy workaround to try to is to set __propagatePkgConfigDepends = false; on your Haskell derivation.