<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'><div>Hi Erik,<br></div><div><br></div><div>With GHC 8.6 we removed the MAX_PATH limit for normal Haskell programs but GCC and binutils are still<br></div><div>a problem so GHC itself isn't yet fully immune.<br></div><div><br></div><div>This issue looks like it's your GHC installation that is on a very deep path. If you're using stack that would<br></div><div>explain it since stack installs it's GHC's in your profile which is quite deeply nested already. You can confirm<br></div><div>this by running ghc --info, and look at the path for the C compiler and add 4 to get the path length of realgcc.</div><div><br></div><div>You could modify <a href="https://github.com/ghc/ghc/blob/master/driver/gcc/gcc.c#L25" target="_blank">https://github.com/ghc/ghc/blob/master/driver/gcc/gcc.c#L25</a> and remove the "%s",<br></div><div>that would get GCC working, (note you have to use the bundled gcc compiled with the toolchain for this<br></div><div>so the CPP macros expand to the correct versions). I suspect though that you have libraries that are on<br></div><div>a path too long for binutils now too.<br></div><div><br></div><div>Alternatuvely, if you're using stack try installing the compiler manually on a short path and tell it to use the<br></div><div>system compiler. If using cabal just move your system compiler to a shorter path.<br></div><div><br></div><div>Unfortunately there are no easy solutions for GCC and Binutils. The changes that they would require to<br></div><div>remove MAX_PATH are small (in fact the code for GHC can be re-used as is) but FSF copyright assignment<br></div><div>issues prevent me from submitting them myself.<br></div><div><br></div><div><br></div><div>Cheers,<br></div><div>Tamar</div><div class="zmail_extra"><div id="Zm-_Id_-Sgn1"><div><br></div><div>---- On Wed, 30 May 2018 00:09:14 +0000 <b>Erik de Castro Lopo <mle+hs@mega-nerd.com></b> wrote ----<br></div></div><div><br></div><blockquote style="border-left: 1px solid #cccccc; padding-left: 6px; margin:0 0 0 5px"><div><div>Hi all, <br></div><div> <br></div><div>I'm now working for IOHK on the Cardano project. The Cardano code <br></div><div>base is large and we are hitting the dreaded windows path length <br></div><div>bug. We have already shortned build paths as much as possible <br></div><div>but are still hitting this <br></div><div> <br></div><div>We're currently using ghc-8.0.2 but even ghc-8.2.2 has this <br></div><div>issue. A snippet of the logs in included below. <br></div><div> <br></div><div>I took the liberty of including Tamar on this since he is the known <br></div><div>Windows expert. Not having a local Window makes this really difficult <br></div><div>to debug. <br></div><div> <br></div><div>Anyone have any solutions for this? I'm willing to backport patches <br></div><div>if needed. <br></div><div> <br></div><div>I've managed to find a VirtualBox evaluation image on the Microsoft <br></div><div>site. Hopefully that will give me enough to debug this issue. <br></div><div> <br></div><div>Cheers, <br></div><div>Erik <br></div><div> <br></div><div> <br></div><div>[01:27:27] --  While building custom Setup.hs for package csl-wallet-new-1.1.1 using: <br></div><div>[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" <br></div><div>[01:27:27]     Process exited with code: ExitFailure 1 <br></div><div>[01:27:27]     Logs have been written to: C:\w\.w\logs\csl-wallet-new-1.1.1.log <br></div><div>[01:27:27] <br></div><div>[01:27:27]     Configuring csl-wallet-new-1.1.1... <br></div><div>[01:27:27]     Preprocessing library for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Building library for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Preprocessing test suite 'wallet-new-specs' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Building test suite 'wallet-new-specs' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Preprocessing executable 'cardano-node' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Building executable 'cardano-node' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Preprocessing executable 'csl-gen-swagger' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Building executable 'csl-gen-swagger' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Preprocessing test suite 'wallet-unit-tests' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Building test suite 'wallet-unit-tests' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Preprocessing executable 'csl-integ-test' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Building executable 'csl-integ-test' for csl-wallet-new-1.1.1.. <br></div><div>[01:27:27]     Linking .w\dist\5c8418a7\build\csl-integ-test\csl-integ-test.exe ... <br></div><div>[01:27:27]     realgcc.exe: error: CreateProcess: No such file or directory <br></div><div>[01:27:27]     `gcc.exe' failed in phase `Linker'. (Exit code: 1) <br></div><div>[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 <br></div><div> <br></div><div> <br></div><div> <br></div><div>-- <br></div><div>---------------------------------------------------------------------- <br></div><div>Erik de Castro Lopo <br></div><div><a href="http://www.mega-nerd.com/" target="_blank">http://www.mega-nerd.com/</a> <br></div></div></blockquote></div><div><br></div></div><br></body></html>