-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlong command line arguments on Windows WAS Could not execute: .../gcc.exe #795
Comments
Happened to me also, after upgrading stack. Now I'm trying to revert to 0.1.1.0 and can't find x64 version, strange... |
That's definitely related to the command length limitations discussed in #466. I could get all the dependencies mentioned by @rubenmoor compiled and linked in a smaller project. However, adding them to our project which already has quite many dependencies results in the exact same error. |
I've changed the title of this issue to reflect the core issue. As I can see it, there are four different places where this problem could be resolved:
I'd prefer (2) to be the approach taken, as it's the right one and most resilient, but I don't know how feasible it is. |
GHC trac ticket opened: https://ghc.haskell.org/trac/ghc/ticket/10777#ticket |
Agree that (1) or (2) are preferable since reducing path or argument length is only a solution until you get a project with even more dependencies. At the beginning, moving our project to C:\ helped, but now we're stuck again. For the time being though, I'd be happy with any hack... |
@themoritz One thing you could try is applying this patch to the Cabal library: https://ghc.haskell.org/trac/ghc/ticket/10777#comment:2 Then you can install that library globally and stack will use it. |
How should I install it? I tried |
The following should work:
We have code in Stack.Setup for doing this, but it's not generalized (at least yet) for local directories. |
Is there another way to install the patched cabal version so that stack will use it? The above command does not work because of #813. |
How about:
|
Okay, I just tested the patched cabal version and still get the same error:
For anyone who wants to try it, here is the patched cabal: https://github.com/themoritz/cabal/tree/rsp-files As a side note: With stack 0.1.3.1 x86_64, I ran into the |
I'm not terribly surprised by that. I do think this will need to be fixed in GHC itself, not Cabal. |
Any ideas how could I work around that? Dropping windows is not an option for me and I already reduced my dependencies to minimum and even shortened paths. |
I'm surprised that cabal is working in that case... did you try the hack of moving your project directory to C:? And when you build with cabal, are you using sandboxes? You may have to temporarily go back to cabal in this case, at least until GHC is patched for this. |
A thought: even if the project is moved to C:, the stack root (the equivalent to |
FYI, I just pushed a commit to my GHC fork on the 7.10 branch to hopefully fix this: I'm trying to rebuild GHC on Windows now. If that works, I can upload a bindist for others to test/use. |
I've sent a Phabricator diff for this: https://phabricator.haskell.org/D1158 Unfortunately, I have not been successful at building on Windows, so if someone else wants to take a crack at it, I'd appreciate it. |
I tried moving project root and it didn't help. I'm building without sandbox, using stack's package dbs:
I'm using patched version of latest cabal. |
It's not surprising that 7.10 fails. 7.10 added a bunch of new stuff for Backpack, which caused file paths to become significantly longer. This is not the first Windows bug due to it. |
Alright, current status:
My suggested steps forward:
|
I'll check it after the weekend. On Fri, 21 Aug 2015 at 15:00 Michael Snoyman notifications@github.com
|
:(
I hope I'm doing something wrong and someone will confirm this patch works. Any ideas? |
Can you paste the output of ghc --info? On Tue, Aug 25, 2015, 9:57 PM Marcin Goliński notifications@github.com
|
|
Also, is the project you're trying to build open source by any chance? If On Tue, Aug 25, 2015, 9:59 PM Michael Snoyman michael@snoyman.com wrote:
|
It's closed, I'll have to get a green light from my team. I don't believe anyone will object, but rules are rules |
@snoyberg I've added you |
Alright, I just reproduced the problem, which I suppose is a good sign. |
Well, here's an interesting data point: now gcc itself is printing this error:
This looks like gcc itself is unable to call out to other processes, because the arguments are too large. In fact, I can verify this by playing around with the response file enough and eventually getting an error message about being unable to call |
OK, seems like we're not the first people to run into this, see: http://sourceforge.net/p/mingw-w64/mailman/message/29339395/ So now the problem is that the gcc.exe shipped with GHC does not include this fix, which was introduced in 4.7.0 by the MinGW team. In theory, upgrading the gcc toolchain to something more recent will solve this problem. |
Well, naively replacing |
You'd need to do the mingw in /c/Users/marcin/dev/ghc/mingw to make it have an effect here. |
You mean I need both updated gcc and patched ghc? |
Yes, both are required. We need GHC to use the response file to pass arguments to GCC, and GCC to use the response file for passing arguments to itself and to collect2. |
In my testing, replacing the mingw directory with the one you linked to from Sourceforge does solve this problem. Can you confirm? |
Also, it appears that GHC HEAD already has an updated version of GCC included, which presumably also has this fix in place. Backporting that change to the 7.10 branch will both be difficult and unlikely to be accepted upstream, so most likely our best bet at this point is to create an alternative bindist that has a modified mingw. |
Yeah, I confirm. I looked at ghc repo too :) Why do you think it won't be backported? |
Because it's a big change in a point release. I'd recommend you raise an issue on the GHC trac and put a link back here. It would be ideal to get that in for GHC 7.10.3. |
I'll get that going. Thanks for helping me out! |
I've submitted task in ghc trac: https://ghc.haskell.org/trac/ghc/ticket/10795 |
Cool. Looks like I may have been mistaken and that patch can be back ported. It's probably worth adding a comment explaining why On Wed, Aug 26, 2015, 2:35 AM Marcin Goliński notifications@github.com
|
Once these two patches are merged to the 7.10 branch, I'm going to close this issue. Leaving open until then just in case the changes do not make it in 7.10.3, in which case we should provide an official way of getting an alternate bindist to users. |
The patches are merged to both the 7.10 branch and HEAD, so I'm going to close this as resolved. However, there are not currently plans for a 7.10.3 release. I would recommend that those affected by this speak up on this thread: http://mail.haskell.org/pipermail/glasgow-haskell-users/2015-September/026034.html |
I have been unsuccessful building and running the ghc 7.10 branch with the patches in place. Compiling ghc works without issues, but when running it, I get the following error message:
Here is what I did: I followed this guide on building ghc on Windows 64bit using MSYS2: https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows After cloning the repo, I ran Here is the output of
Here is the output of
Any ideas what I may have done wrong? / Can you give me hints on how you compiled ghc (which git commit, etc.)? |
Sorry, I currently don't have time for full response, but I do remember On Mon, 21 Sep 2015 at 12:04 Moritz Drexl notifications@github.com wrote:
|
I have
Where do I check that they are compatible? |
Current status of this issue from my perspective:
I would be very interested, if anyone else was more successful. |
Seeing that GHC 7.10.3 RC 1 has been released, how do I go about testing stack with this version of GHC? https://mail.haskell.org/pipermail/ghc-devs/2015-November/010310.html |
@kejace It should literally be as easy as installing it to your system, such that it's on the PATH. Stack will then default to prefering it over |
Maybe related to #466, however I don't run into the
CreateProcess
problem described there, anymore.During
stack build
on Win7 I get the following error, no executable being created. This only happened after adding dependencies to the librariesI'll revisit once I identified the culprit.
The text was updated successfully, but these errors were encountered: