Description
C:\asd\simple>stack build
simple-0.1.0.0: unregistering (local file changes: C:\asde\simple\app\Main.hs C:\asde\simple\simple.cabal C:\asde\simple\src\Lib.hs C:\asde\simple\t...)
simple-0.1.0.0: configure
Configuring simple-0.1.0.0...
simple-0.1.0.0: build
Preprocessing library simple-0.1.0.0...
Preprocessing executable 'simple-exe' for simple-0.1.0.0...
simple-0.1.0.0: copy/register
Installing library in
C:\asd\simple\.stack-work\install\93264ba9\lib\x86_64-windows-ghc-8.0.1\simple-0.1.0.0-F3BExGhCZsn2GnfzIVL0FA
Installing executable(s) in C:\asd\simple\.stack-work\install\93264ba9\bin
Registering simple-0.1.0.0...
C:\asd\simple>stack clean
C:\asd\simple>stack build
simple-0.1.0.0: unregistering (local file changes: app\Main.hs simple.cabal src\Lib.hs test\Spec.hs)
simple-0.1.0.0: configure
Configuring simple-0.1.0.0...
simple-0.1.0.0: build
Preprocessing library simple-0.1.0.0...
[1 of 1] Compiling Lib ( src\Lib.hs, .stack-work\dist\b7fec021\build\Lib.o )
Preprocessing executable 'simple-exe' for simple-0.1.0.0...
[1 of 1] Compiling Main ( app\Main.hs, .stack-work\dist\b7fec021\build\simple-exe\simple-exe-tmp\Main.o )
Linking .stack-work\dist\b7fec021\build\simple-exe\simple-exe.exe ...
C:/Program Files/Haskell Platform/8.0.1/mingw/bin/ld.exe: cannot find -lHSbytestring-show-0.3.5.6-BjSy8lPQnxSIztPkxWzSlH
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)
-- While building package simple-0.1.0.0 using:
C:\Users\Marko\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\setup-Simple-Cabal-1.24.0.0-ghc-8.0.1.exe --builddir=.stack-work\dist\b7fec021 build lib:simple exe:simple-exe --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
I ran into some strange issues yesterday while trying to install the bytestring-show
package and after trying for an hour in order to write this report, I could not replicate it. It seemed to me that I was going crazy and the errors were on my own end, but by accident I managed to make it happen.
At first I thought the just renaming or moving the folder might be enough to trigger the bug, but that was not it. Nor was it that Stack was forgetting to close the file handles.
Here is the recipe.
- Start a new project using
stack new simple
inC:\asd
. - Add
bytestring
andbytestring-show
to the cabalsimple-exe
build dependencies.
build-depends: base
, simple
, bytestring
, bytestring-show
- Add
bytestring-show-0.3.5.6
to the yaml file.
extra-deps: [bytestring-show-0.3.5.6]
stack build
the project.- Rename the
asd
folder in which the project is in toasde
. - Run
stack build
,stack clean
andstack build
again and the project will get corrupted.
Cleaning it again will not work, nor will restarting the command prompt. Yesterday I had different errors than the above so there might be more than one bug, but this is the only one I could actually reproduce. It is also likely that yesterday's errors were due to my haphazard actions while running the build as I am not familiar with Stack, so this might in fact be the only one.
Not related to this bug, one other bug is that stack upgrade
is failing as shown in the SO post.
Edit: This is on Windows 10. I installed the latest full Haskell Platform 3 days ago.