Skip to content
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

Stack setup fails #2998

Closed
plneappl opened this issue Feb 11, 2017 · 11 comments
Closed

Stack setup fails #2998

plneappl opened this issue Feb 11, 2017 · 11 comments

Comments

@plneappl
Copy link

General summary/comments (optional)

stack setup fails on Windows 10 Pro x64 Insider Build 15031: GHC fails to compile a sanity check.

Steps to reproduce

> stack setup

Expected

GHC installs

Actual

>stack setup
The GHC located at C:\Users\simon\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.1\bin\ghc.EXE failed to compile a sanity check. Please see:

    http://docs.haskellstack.org/en/stable/install_and_upgrade/

for more information. Exception was:
Running C:\Users\simon\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.1\bin\ghc.EXE C:\Users\simon\AppData\Local\Temp\stack-sanity-check8368\Main.hs -no-user-package-db in directory C:\Users\simon\AppData\Local\Temp\stack-sanity-check8368\ exited with ExitFailure 1

[1 of 1] Compiling Main             ( C:\Users\simon\AppData\Local\Temp\stack-sanity-check8368\Main.hs, C:\Users\simon\AppData\Local\Temp\stack-sanity-check8368\Main.o )

`gcc.exe' failed in phase `Assembler'. (Exit code: -1073741502)


C:\Users\simon\Dropbox\Studium\TreeLanguages\automata>stack setup --verbose
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 x86_64 hpack-0.15.0
2017-02-11 15:32:51.921700: [debug] Checking for project config at: C:\Users\simon\Dropbox\Studium\TreeLanguages\automata\stack.yaml
@(Stack\Config.hs:863:9)
2017-02-11 15:32:51.922702: [debug] Loading project config file stack.yaml
@(Stack\Config.hs:881:13)
2017-02-11 15:32:51.924708: [debug] Trying to decode C:\sr\build-plan-cache\x86_64-windows\lts-7.19.cache
@(Data\Store\VersionTagged.hs:68:5)
2017-02-11 15:32:51.932729: [debug] Success decoding C:\sr\build-plan-cache\x86_64-windows\lts-7.19.cache
@(Data\Store\VersionTagged.hs:72:13)
2017-02-11 15:32:51.936740: [debug] Using standard GHC build
@(Stack\Setup.hs:597:9)
2017-02-11 15:32:51.938745: [debug] Performing a sanity check on: C:\Users\simon\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.1\bin\ghc.EXE
@(Stack\Setup.hs:1495:5)
2017-02-11 15:32:51.939749: [debug] Run process: C:\Users\simon\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.1\bin\ghc.EXE C:\Users\simon\AppData\Local\Temp\stack-sanity-check560\Main.hs -no-user-package-db
@(System\Process\Read.hs:306:3)
The GHC located at C:\Users\simon\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.1\bin\ghc.EXE failed to compile a sanity check. Please see:

    http://docs.haskellstack.org/en/stable/install_and_upgrade/

for more information. Exception was:
Running C:\Users\simon\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.1\bin\ghc.EXE C:\Users\simon\AppData\Local\Temp\stack-sanity-check560\Main.hs -no-user-package-db in directory C:\Users\simon\AppData\Local\Temp\stack-sanity-check560\ exited with ExitFailure 1

[1 of 1] Compiling Main             ( C:\Users\simon\AppData\Local\Temp\stack-sanity-check560\Main.hs, C:\Users\simon\AppData\Local\Temp\stack-sanity-check560\Main.o )

`gcc.exe' failed in phase `Assembler'. (Exit code: -1073741502)

Stack version

>stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 x86_64 hpack-0.15.0

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository
@mgsloan mgsloan added this to the Support milestone Feb 11, 2017
@plneappl
Copy link
Author

I've identified part of the problem I think: MinGW is outdated or something like that. After manually updating, at least realgcc no longer instantly crashes and cabal works again. Still no sanity checks compile though.

@Dessix
Copy link

Dessix commented Mar 5, 2017

I was having this issue as well. I've attempted plugging a nightly MinGW into it, to no avail. Windows 10 x64 here.

@skeptomai
Copy link

skeptomai commented Mar 12, 2017

I'm just now getting the same, after a fresh install of Haskell Platform 8.0.2 on Windows 10 Pro x64 insider build 15048:

`The GHC located at C:\Program Files\Haskell Platform\8.0.2\bin\ghc.EXE failed to compile a sanity check. Please see:

http://docs.haskellstack.org/en/stable/install_and_upgrade/

for more information. Exception was:
Running C:\Program Files\Haskell Platform\8.0.2\bin\ghc.EXE C:\Users\skept\AppData\Local\Temp\stack-sanity-check3024\Main.hs -no-user-package-db in directory C:\Users\skept\AppData\Local\Temp\stack-sanity-check3024\ exited with ExitFailure 1

[1 of 1] Compiling Main ( C:\Users\skept\AppData\Local\Temp\stack-sanity-check3024\Main.hs, C:\Users\skept\AppData\Local\Temp\stack-sanity-check3024\Main.o )

gcc.exe' failed in phase Assembler'. (Exit code: -1073741502)

C:\Users\skept\Projects\haskparse\haskparse>stack --version
Version 1.3.2, Git revision 3f67514 x86_64 hpack-0.15.0`

UPDATE I downgraded to Windows Insider build 14986.1001 and the crash went away and everything seems to work again

@mands
Copy link

mands commented Mar 13, 2017

Same issue on the Windows 10 Home x64 15048 - reverting to the latest official Win10 release fixed it.

I believe this insider branch will be made official within the next few weeks so will start affecting a larger number of people at that point.

@mgsloan
Copy link
Contributor

mgsloan commented Mar 14, 2017

It'd be great to figure out whether stack, ghc, or mingw needs to be fixed in order to resolve this. Do the same issues occur with cabal-install?

@YellPika
Copy link

YellPika commented Mar 16, 2017

I've run into the same problem. I recompiled gcc.exe (the wrapper, not realgcc.exe) and things seem to be working again.

UPDATE: One possibly important detail that I should have mentioned: the aforementioned wrapper depends on some headers that are not distributed with GHC. I was too lazy to track down the needed dependencies so I just patched in the file. My modified wrapper is here.

UPDATE 2: Seems the problem was a call to FreeConsole() in run() (in cwrapper.c). This has already been fixed in HEAD.

UPDATE 3: Related trac issue.

@mgsloan
Copy link
Contributor

mgsloan commented Mar 16, 2017

Great, thanks for the detailed investigation @YellPika !

Closing this as an upstream issue.

@mgsloan mgsloan closed this as completed Mar 16, 2017
@Porges
Copy link
Contributor

Porges commented Apr 3, 2017

Per the comments on trac #13472, would stack consider patching/fixing GHC 8.0.2? At the moment Haskell is rendered unusable for anyone on insider track...

@skeptomai
Copy link

8.2.1 is supposed to come out in a couple weeks, and it appears to have the fix. At least without add'l patching, the wait shouldn't be horrible. (BTW, I'm in the same boat as you). I'm also applying patches to 8.0.2 locally and building the 8.2 branch locally for comparison. I have access to both Windows insider builds and a normal Windows 10 release track machine for builds.

@MingdaRui
Copy link

MingdaRui commented Apr 7, 2017

I have "ghc-8.0.2" under my "stack" folder, where should I position the fixed "cwapper.c" file? There is also a "msys2-20150512" folder under the "stack" folder. Thanks a lot.

@hmemcpy
Copy link

hmemcpy commented Apr 13, 2017

While we wait for the official 8.2.1 release, here's a repo with gcc binary compiled for Windows 10 that works! Simply replace gcc.exe with the one from the repo: https://github.com/Mistuke/ghc-compat

Big thanks to @Porges for linking it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants