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 7.8.4 fails sanity check on Windows #3213

Closed
ygale opened this issue Jun 12, 2017 · 5 comments
Closed

stack setup 7.8.4 fails sanity check on Windows #3213

ygale opened this issue Jun 12, 2017 · 5 comments

Comments

@ygale
Copy link

ygale commented Jun 12, 2017

General summary/comments (optional)

stack setup 7.8.4 on Windows fails with the following error message (sanitized by replacing the actual AppData path with %AppData%):

The GHC located at %AppData%\Local\Programs\stack\x86_64-windows\ghc-7.8.4\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 %AppData%\Local\Programs\stack\x86_64-windows\ghc-7.8.4\bin\ghc.EXE %AppData%\Local\Temp\stack-sanity-check4848\Main.hs -no-user-package-db in directory %AppData%\Local\Temp\stack-sanity-check4848\ exited with ExitFailure 1

[1 of 1] Compiling Main             ( %AppData%\Local\Temp\stack-sanity-check4848\Main.hs, %AppData%\Local\Temp\stack-sanity-check4848\Main.o )


<no location info>:
    Warning: Couldn't figure out linker information!
             Make sure you're using GNU gcc, or clang
Unable to start %AppData%\Local\Programs\stack\x86_64-windows\ghc-7.8.4\mingw\bin/realgcc.exe (error code: 2

Workaround: Copy the file

%APPDATA%\Local\Programs\stack\x86_64-windows\ghc-7.8.4\mingw\bin\x86_64-w64-mingw32-gcc.exe

to realgcc.exe in the same folder.

Steps to reproduce

stack setup 7.8.4

Expected

Successful installation of GHC version 7.8.4.

Actual

The error message above. After performing the above workaround, GHC version 7.8.4 then works fine.

Stack version

Version 1.4.0, Git revision e714f1dd3fade19496d91bd6a017e435a96a6bcd x86_64 hpack-0.17.0

Method of installation

  • Official Windows 64-bit MSI, downloaded from stackage.org
@mgsloan
Copy link
Contributor

mgsloan commented Aug 7, 2017

Likely related to #3189 / #2998 . Thanks for the report and workaround, but I don't think there's anything to be done here within stack. Would probably require backporting a fix to ghc 7.8

@mgsloan mgsloan closed this as completed Aug 7, 2017
@mgsloan mgsloan added this to the Support milestone Aug 7, 2017
@Rufflewind
Copy link
Contributor

I'm not sure this is actually related to either of those other issues.

If we look at the official https://downloads.haskell.org/~ghc/7.8.4/ghc-7.8.4-x86_64-unknown-mingw32.tar.xz we find that it is indeed missing realgcc. However, ghc and gcc run just fine.

This is not true for Stack's GHC distribution. I did a diff between the two GHC trees and the only difference is that Stack's gcc is different. It is in fact much smaller, which suggests it is a thin wrapper to another executable.

Therefore, it looks to me that somewhere down the line the official GHC tarball was patched to replace gcc without the necessary realgcc, and that is the cause of the error we're seeing.

@mgsloan
Copy link
Contributor

mgsloan commented Sep 15, 2017

Hmm, that's weird that the two tarballs are different, not sure which should be preferred, or why there is a different. Pinging @borsboom

@mgsloan mgsloan reopened this Sep 15, 2017
@behaghel
Copy link

I encountered the same issue today with 7.10.2 installed via Haskell Platform 8.6.5 on Windows 10. The workaround worked.

@mpilgrem
Copy link
Member

I am closing the issue given the passage of time.

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

5 participants