The dreaded windows path length issue

Tamar Christina tamar at zhox.com
Wed May 30 11:08:31 UTC 2018


Hi Erik,



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.





Cheers,

Tamar


---- On Wed, 30 May 2018 00:09:14 +0000 Erik de Castro Lopo <mle+hs at mega-nerd.com> wrote ----




Hi all, 

 

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 

to debug. 

 

Anyone have any solutions for this? I'm willing to backport patches 

if needed. 

 

I've managed to find a VirtualBox evaluation image on the Microsoft 

site. Hopefully that will give me enough to debug this issue. 

 

Cheers, 

Erik 

 

 

[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_2.0.1.0_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] 

[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 

http://www.mega-nerd.com/ 






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20180530/8fb699f3/attachment.html>


More information about the Glasgow-haskell-users mailing list