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

Build fails on Windows - 'C compiler cannot create executables' #363

Closed
rossng opened this issue Jan 7, 2019 · 5 comments
Closed

Build fails on Windows - 'C compiler cannot create executables' #363

rossng opened this issue Jan 7, 2019 · 5 comments
Assignees
Labels

Comments

@rossng
Copy link

rossng commented Jan 7, 2019

Hi. I'm trying to build Tidal, which depends on network-2.6.3.6. stack build gives me this error:

D:\Development\Haskell\Tidal>stack build
network-2.6.3.6: configure
Progress 1/3

--  While building package network-2.6.3.6 using:
      C:\Users\Ross Gardiner\AppData\Local\Temp\stack13136\network-2.6.3.6\.stack-work\dist\7d103d30\setup\setup --builddir=.stack-work\dist\7d103d30 configure "--with-ghc=C:\\Users\\Ross Gardiner\\AppData\\Local\\Programs\\stack\\x86_64-windows\\ghc-8.4.4\\bin\\ghc.EXE" "--with-ghc-pkg=C:\\Users\\Ross Gardiner\\AppData\\Local\\Programs\\stack\\x86_64-windows\\ghc-8.4.4\\bin\\ghc-pkg.EXE" --user --package-db=clear --package-db=global --package-db=D:\sr\snapshots\889ff22c\pkgdb --libdir=D:\sr\snapshots\889ff22c\lib --bindir=D:\sr\snapshots\889ff22c\bin --datadir=D:\sr\snapshots\889ff22c\share --libexecdir=D:\sr\snapshots\889ff22c\libexec --sysconfdir=D:\sr\snapshots\889ff22c\etc --docdir=D:\sr\snapshots\889ff22c\doc\network-2.6.3.6 --htmldir=D:\sr\snapshots\889ff22c\doc\network-2.6.3.6 --haddockdir=D:\sr\snapshots\889ff22c\doc\network-2.6.3.6 --dependency=base=base-4.11.1.0 --dependency=bytestring=bytestring-0.10.8.2 "--extra-include-dirs=C:\\Users\\Ross Gardiner\\AppData\\Local\\Programs\\stack\\x86_64-windows\\msys2-20180531\\mingw64\\include" "--extra-lib-dirs=C:\\Users\\Ross Gardiner\\AppData\\Local\\Programs\\stack\\x86_64-windows\\msys2-20180531\\mingw64\\bin" "--extra-lib-dirs=C:\\Users\\Ross Gardiner\\AppData\\Local\\Programs\\stack\\x86_64-windows\\msys2-20180531\\mingw64\\lib"
    Process exited with code: ExitFailure 77
    Logs have been written to: D:\Development\Haskell\Tidal\.stack-work\logs\network-2.6.3.6.log

    [1 of 2] Compiling Main             ( C:\Users\Ross Gardiner\AppData\Local\Temp\stack13136\network-2.6.3.6\Setup.hs, C:\Users\Ross Gardiner\AppData\Local\Temp\stack13136\network-2.6.3.6\.stack-work\dist\7d103d30\setup\Main.o )
    [2 of 2] Compiling StackSetupShim   ( D:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\Users\Ross Gardiner\AppData\Local\Temp\stack13136\network-2.6.3.6\.stack-work\dist\7d103d30\setup\StackSetupShim.o )
    Linking C:\Users\Ross Gardiner\AppData\Local\Temp\stack13136\network-2.6.3.6\.stack-work\dist\7d103d30\setup\setup.exe ...
    Configuring network-2.6.3.6...
    configure: WARNING: unrecognized options: --with-compiler
    configure: loading site script /usr/local/etc/config.site
    checking build system type... x86_64-w64-mingw32
    checking host system type... x86_64-w64-mingw32
    checking for gcc... C:\Users\Ross Gardiner\AppData\Local\Programs\stack\X86_64~1\GHC-84~1.4\lib/../mingw/bin\gcc.exe
    checking whether the C compiler works... no
    configure: error: in `/c/Users/Ross Gardiner/AppData/Local/Temp/stack13136/network-2.6.3.6/.stack-work/dist/7d103d30/build':
    configure: error: C compiler cannot create executables
    See `config.log' for more details

I've seen a few threads around the place that have similar issues, but nothing I've tried has worked, including:

  • Removing my native installation of msys2 from PATH
  • Using --skip-msys
  • Using --no-system-ghc
  • Re-enabling 8.3 filenames (I had them disabled to improve NTFS performance)
  • stack building various versions of network directly from git, including 2.8.0.0 and the latest master

The gcc.exe mentioned in the error message does exist on disk and gcc -v gives valid output. I have no other GHC or GCC on my path.

Let me know if I can help by providing any further details.

Platform details:

  • Installed stack standalone - not through Haskell Platform
  • Windows 10 1809, 64-bit
@rossng
Copy link
Author

rossng commented Jan 7, 2019

I just tried this again after removing Stack and installing the full Haskell Platform but had no more luck.

I also wondered if it was something to do with autoreconf - obviously this isn't available on Windows but it can be installed inside Stack's msys2. I ran stack exec -- pacman -S base-devel and now (somewhat baffingly) get this:

> stack exec -- which autoreconf
/usr/bin/autoreconf

> stack exec -- autoreconf
Executable named autoreconf not found on path: [etc.]

@mpilgrem
Copy link
Contributor

This may be related: commercialhaskell/stack#4726. I found that setting up stack so that there was no space in a particular path fixed things for me.

@kazu-yamamoto
Copy link
Collaborator

@rossng Could you check if your path include space characters?

@mpilgrem
Copy link
Contributor

mpilgrem commented Apr 27, 2019

@rossng, in respect of your stack exec -- autoreconf problem, autoreconf is a shell script file, not an executable. Try stack exec sh -- autoreconf -i. autoreconf depends on perl, which also needs to be installed inside stack's MSYS2 (stack exec pacman -- -S perl).

EDIT: perl 5.28.1-2 is broken (msys2/MSYS2-packages#1611). To downgrade to a version that works, I used:

stack exec pacman -- -U http://repo.msys2.org/msys/x86_64/perl-5.28.0-1-x86_64.pkg.tar.xz

@Mistuke
Copy link
Collaborator

Mistuke commented May 20, 2020

This doesn't seem like a network issue. re-open if it is, but nothing here points to it being so..

@Mistuke Mistuke closed this as completed May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants