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

Compilation of any project fails with "cc1.exe: error: /mingw64/include: Invalid argument" #5668

Closed
mnn opened this issue Jan 6, 2022 · 4 comments

Comments

@mnn
Copy link

mnn commented Jan 6, 2022

General summary/comments (optional)

It's Windows 10 run in Virtual Box (the official MS image). I didn't change any localization settings, so #1448 should not be relevant (to be sure I tried setting LANG, but it had not effect).

Steps to reproduce

  1. run in Windows 10 for VirtualBox from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
  2. stack new test
  3. cd test
  4. stack run

Expected

Compiles and prints someFunc.

Actual

2022-01-06 01:57:05.163539: [debug] Run process within \\VBOXSVR\Shared\test\: C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.7.exe --builddir=.stack-work\dist\274b403a configure --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\91e04983\pkgdb --package-db=Z:\test\.stack-work\install\45dbe780\pkgdb --libdir=Z:\test\.stack-work\install\45dbe780\lib --bindir=Z:\test\.stack-work\install\45dbe780\bin --datadir=Z:\test\.stack-work\install\45dbe780\share --libexecdir=Z:\test\.stack-work\install\45dbe780\libexec --sysconfdir=Z:\test\.stack-work\install\45dbe780\etc --docdir=Z:\test\.stack-work\install\45dbe780\doc\test-0.1.0.0 --htmldir=Z:\test\.stack-work\install\45dbe780\doc\test-0.1.0.0 --haddockdir=Z:\test\.stack-work\install\45dbe780\doc\test-0.1.0.0 --dependency=base=base-4.14.3.0 --extra-include-dirs=C:\Users\IEUser\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\include --extra-lib-dirs=C:\Users\IEUser\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\lib --extra-lib-dirs=C:\Users\IEUser\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\bin --exact-configuration --ghc-option=-fhide-source-paths
2022-01-06 01:57:10.830035: [info] Configuring test-0.1.0.0...
2022-01-06 01:57:11.738202: [warn] cc1.exe: error: /mingw64/include: Invalid argument
2022-01-06 01:57:11.738202: [warn] `gcc.exe' failed in phase `C Compiler'. (Exit code: 1)
2022-01-06 01:57:11.752342: [error]
--  While building package test-0.1.0.0 (scroll up to its section to see the error) using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.7.exe --builddir=.stack-work\dist\274b403a configure --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\91e04983\pkgdb --package-db=Z:\test\.stack-work\install\45dbe780\pkgdb --libdir=Z:\test\.stack-work\install\45dbe780\lib --bindir=Z:\test\.stack-work\install\45dbe780\bin --datadir=Z:\test\.stack-work\install\45dbe780\share --libexecdir=Z:\test\.stack-work\install\45dbe780\libexec --sysconfdir=Z:\test\.stack-work\install\45dbe780\etc --docdir=Z:\test\.stack-work\install\45dbe780\doc\test-0.1.0.0 --htmldir=Z:\test\.stack-work\install\45dbe780\doc\test-0.1.0.0 --haddockdir=Z:\test\.stack-work\install\45dbe780\doc\test-0.1.0.0 --dependency=base=base-4.14.3.0 --extra-include-dirs=C:\Users\IEUser\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\include --extra-lib-dirs=C:\Users\IEUser\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\lib --extra-lib-dirs=C:\Users\IEUser\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\bin --exact-configuration --ghc-option=-fhide-source-paths
    Process exited with code: ExitFailure 1

I tried to run the failed long command manually, but I guess it relies on stack providing something in the environment:

Configuring test-0.1.0.0...
Cabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.7.exe: The program 'ghc' version
>=7.0.1 is required but it could not be found.

Stack version

> stack --version
Version 2.7.3, Git revision 7927a3aec32e2b2e5e4fb5be76d0d50eddcc197f x86_64 hpack-0.34.4

Method of installation

  • Official binary - the Windows installer
@mnn
Copy link
Author

mnn commented Jan 10, 2022

I have also tried the ghcup route, but the result is the same. I am now trying older package set (previous tests were with LTS 18.21).

Edit: So it's broken in a same way till LTS with GHC 8.8.4, since that version it fails with .\test.cabal: openBinaryFile: does not exist (No such file or directory).

@mpilgrem
Copy link
Member

Closing, given the passage of time and no other user is reporting similar problems with more current versions of Stack.

@mnn
Copy link
Author

mnn commented May 13, 2023

I pretty much gave up on Haskell on Windows (was unable to reproduce a compilation issue of my open-source project specific to Windows, because Stack on Windows and/or VM crashed way sooner than compilation of my program started). Judging from this ticket, supported is nonexistent. I provided clear repro, yet nobody even tried it. It looks rather dead...

@mpilgrem
Copy link
Member

@mnn, I'm also a Windows user and have had similar experiences in the past, but I think GHC and Stack today are more Windows-friendly than they have ever been. The large backlog of issues in this repository is a practical problem and I am trying to winnow them.

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

No branches or pull requests

2 participants