Reputation: 423
I made a training project which requires several module imports (Database.Redis and Web.Scotty among them). When I do stack build
I get this:
D:\ssd-data\work\my-project\my-project.cabal was modified manually. Ignoring D:\ssd-data\work\my-project\package.yaml in favor of the cabal file.
If you want to use the package.yaml file instead of the cabal file,
then please delete the cabal file.
Stack has not been tested with GHC versions above 8.6, and using 8.8.3, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
WARNING: Ignoring regex-posix's bounds on base (<0 && >=4.3 && <4.14); using base-4.13.0.0.
Reason: trusting snapshot over cabal file dependency information.
regex-posix > configure
regex-posix > Configuring regex-posix-0.96.0.0...
regex-posix > build
regex-posix > Preprocessing library for regex-posix-0.96.0.0..
regex-posix > C:\Users\user\AppData\Local\Temp\stack3628\regex-posix-0.96.0.0\Wrap.hsc:96:10: fatal error: regex.h: No such file or directory
regex-posix > compilation terminated.
regex-posix > compiling .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.c failed (exit code 1)
regex-posix > command was: C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\../mingw/bin\gcc.exe -c .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.c -o .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.o -D__GLASGOW_HASKELL__=808 -Dmingw32_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dmingw32_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Icbits -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -I.stack-work\dist\29cc6475\build\cbits -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -I.stack-work\dist\29cc6475\build\autogen -I.stack-work\dist\29cc6475\build\global-autogen -include .stack-work\dist\29cc6475\build\autogen\cabal_macros.h -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\bytestring-0.10.10.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\base-4.13.0.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\integer-gmp-1.0.2.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib/include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3/lib/include/
streaming-commons> configure
streaming-commons> Configuring streaming-commons-0.2.1.2...
streaming-commons> build
streaming-commons> Preprocessing library for streaming-commons-0.2.1.2..
streaming-commons> Building library for streaming-commons-0.2.1.2..
streaming-commons> [ 1 of 17] Compiling Data.Streaming.ByteString.Builder.Buffer
streaming-commons> [ 2 of 17] Compiling Data.Streaming.ByteString.Builder
streaming-commons> [ 3 of 17] Compiling Data.Streaming.Filesystem
streaming-commons> [ 4 of 17] Compiling Data.Streaming.Network.Internal
streaming-commons> [ 5 of 17] Compiling Data.Streaming.Network
streaming-commons> [ 6 of 17] Compiling Data.Streaming.Process.Internal
streaming-commons> [ 7 of 17] Compiling Data.Streaming.Process
streaming-commons> [ 8 of 17] Compiling Data.Streaming.Zlib.Lowlevel
streaming-commons> [ 9 of 17] Compiling Data.Streaming.Zlib
streaming-commons> [10 of 17] Compiling Data.Text.Internal.Encoding.Utf16
streaming-commons> [11 of 17] Compiling Data.Text.Internal.Encoding.Utf32
streaming-commons> [12 of 17] Compiling Data.Text.Internal.Unsafe.Shift
streaming-commons> [13 of 17] Compiling Data.Text.Internal.Unsafe.Char
streaming-commons> [14 of 17] Compiling Data.Text.Internal.Encoding.Utf8
streaming-commons> [15 of 17] Compiling Data.Streaming.Text
streaming-commons> [16 of 17] Compiling System.Win32File
streaming-commons> [17 of 17] Compiling Data.Streaming.FileRead
streaming-commons> copy/register
streaming-commons> Installing library in C:\sr\snapshots\260bc685\lib\x86_64-windows-ghc-8.8.3\streaming-commons-0.2.1.2-7nSvofLzcDVEO2jjCYKFuK
streaming-commons> Registering library for streaming-commons-0.2.1.2..
-- While building package regex-posix-0.96.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.3.exe --builddir=.stack-work\dist\29cc6475 build --ghc-options ""
Process exited with code: ExitFailure 1
Progress 2/9
When I build a project without any imports, everything is okay.
Upvotes: 2
Views: 877
Reputation: 408
I had the same problem, but I solved it. If you haven't solved the problem yet, I think you can fix the problem if you follow what I did.
The most important part of the error message is as follows. The point is that the header file is missing (regex.h), and you have to add it to the proper path.
regex-posix > ...\regex-posix-0.96.0.0\Wrap.hsc:96:10: fatal error:
regex.h: No such file or directory
regex-posix > compilation terminated.
...
regex-posix > command was: C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\../mingw/bin\gcc.exe -c .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.c -o .stack-work\dist\29cc6475\build\Text\Regex\Posix\Wrap_hsc_make.o -D__GLASGOW_HASKELL__=808 -Dmingw32_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dmingw32_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Icbits -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -I.stack-work\dist\29cc6475\build\cbits -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -I.stack-work\dist\29cc6475\build\autogen -I.stack-work\dist\29cc6475\build\global-autogen -include .stack-work\dist\29cc6475\build\autogen\cabal_macros.h -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\bytestring-0.10.10.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\base-4.13.0.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\integer-gmp-1.0.2.0\include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib/include -IC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3/lib/include/
You can get the regex.h file from https://code.woboq.org/linux/include/regex.h.html. Save the file into the path as shown in above error messages (last line). In your case, the path is:
\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\lib\include
The important thing is to put the regex.h file in Haskell's library folder. (...\x86_64-windows\ghc-8.8.3\lib\include) After that, execute stack build command.
I hope my answer is helpful to you.
Upvotes: 2