The dreaded windows path length issue
tamar at zhox.com
Wed May 30 11:08:31 UTC 2018
With GHC 8.6 we removed the MAX_PATH limit for normal Haskell programs but GCC and binutils are still
a problem so GHC itself isn't yet fully immune.
This issue looks like it's your GHC installation that is on a very deep path. If you're using stack that would
explain it since stack installs it's GHC's in your profile which is quite deeply nested already. You can confirm
this by running ghc --info, and look at the path for the C compiler and add 4 to get the path length of realgcc.
You could modify https://github.com/ghc/ghc/blob/master/driver/gcc/gcc.c#L25 and remove the "%s",
that would get GCC working, (note you have to use the bundled gcc compiled with the toolchain for this
so the CPP macros expand to the correct versions). I suspect though that you have libraries that are on
a path too long for binutils now too.
Alternatuvely, if you're using stack try installing the compiler manually on a short path and tell it to use the
system compiler. If using cabal just move your system compiler to a shorter path.
Unfortunately there are no easy solutions for GCC and Binutils. The changes that they would require to
remove MAX_PATH are small (in fact the code for GHC can be re-used as is) but FSF copyright assignment
issues prevent me from submitting them myself.
---- On Wed, 30 May 2018 00:09:14 +0000 Erik de Castro Lopo <mle+hs at mega-nerd.com> wrote ----
I'm now working for IOHK on the Cardano project. The Cardano code
base is large and we are hitting the dreaded windows path length
bug. We have already shortned build paths as much as possible
but are still hitting this
We're currently using ghc-8.0.2 but even ghc-8.2.2 has this
issue. A snippet of the logs in included below.
I took the liberty of including Tamar on this since he is the known
Windows expert. Not having a local Window makes this really difficult
Anyone have any solutions for this? I'm willing to backport patches
I've managed to find a VirtualBox evaluation image on the Microsoft
site. Hopefully that will give me enough to debug this issue.
[01:27:27] -- While building custom Setup.hs for package csl-wallet-new-1.1.1 using:
[01:27:27] C:\s\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_22.214.171.124_ghc-8.2.2.exe --builddir=.w\dist\5c8418a7 build lib:csl-wallet-new exe:cardano-node exe:csl-gen-swagger exe:csl-integ-test test:wallet-new-specs test:wallet-unit-tests --ghc-options " -ddump-hi -ddump-to-file"
[01:27:27] Process exited with code: ExitFailure 1
[01:27:27] Logs have been written to: C:\w\.w\logs\csl-wallet-new-1.1.1.log
[01:27:27] Configuring csl-wallet-new-1.1.1...
[01:27:27] Preprocessing library for csl-wallet-new-1.1.1..
[01:27:27] Building library for csl-wallet-new-1.1.1..
[01:27:27] Preprocessing test suite 'wallet-new-specs' for csl-wallet-new-1.1.1..
[01:27:27] Building test suite 'wallet-new-specs' for csl-wallet-new-1.1.1..
[01:27:27] Preprocessing executable 'cardano-node' for csl-wallet-new-1.1.1..
[01:27:27] Building executable 'cardano-node' for csl-wallet-new-1.1.1..
[01:27:27] Preprocessing executable 'csl-gen-swagger' for csl-wallet-new-1.1.1..
[01:27:27] Building executable 'csl-gen-swagger' for csl-wallet-new-1.1.1..
[01:27:27] Preprocessing test suite 'wallet-unit-tests' for csl-wallet-new-1.1.1..
[01:27:27] Building test suite 'wallet-unit-tests' for csl-wallet-new-1.1.1..
[01:27:27] Preprocessing executable 'csl-integ-test' for csl-wallet-new-1.1.1..
[01:27:27] Building executable 'csl-integ-test' for csl-wallet-new-1.1.1..
[01:27:27] Linking .w\dist\5c8418a7\build\csl-integ-test\csl-integ-test.exe ...
[01:27:27] realgcc.exe: error: CreateProcess: No such file or directory
[01:27:27] `gcc.exe' failed in phase `Linker'. (Exit code: 1)
[01:27:27] Command "call stack --dump-logs install cardano-sl cardano-sl-tools csl-wallet csl-wallet-new -j 2 --no-terminal --local-bin-path c:\w --test --no-haddock-deps --flag cardano-sl-core:-asserts --flag cardano-sl-tools:for-installer --flag csl-wallet:for-installer --extra-include-dirs="C:\OpenSSL-Win64-v102\include" --extra-lib-dirs="C:\OpenSSL-Win64-v102" --extra-include-dirs="C:\xz_extracted\include" --extra-lib-dirs="C:\xz_extracted\bin_x86-64" --extra-include-dirs="c:\w\rocksdb\include" --extra-lib-dirs="c:\w"" failed with exit code 1. Retrying 4 of 5
Erik de Castro Lopo
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glasgow-haskell-users