commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.99k stars 843 forks source link

Stack fails to build threadscope with TH on Windows #3334

Open maoe opened 7 years ago

maoe commented 7 years ago

General summary/comments (optional)

I'm investigating why this branch of threadscope fails to build with stack on Windows.

Steps to reproduce

I've tested the following procedure with Windows Server 2016 on Google Compute Engine.

  1. Install the latest stack (1.5.1-windows-x86_64) using the installer
  2. Install the latest MSYS2 (msys2-x86_64-20161025)
  3. Launch MINGW64 shell and update packages (restart the shell as needed)
    • pacman --noconfirm --needed -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel
    • pacman --noconfirm -Syuu
    • pacman --noconfirm -Suu
  4. Check out this threadscope
  5. Install gtk2 and pkg-config
    • pacman -S $MINGW_PACKAGE_PREFIX-{gtk2,pkg-config}
  6. Build threadscope using the existing MSYS2
    • echo 'export PATH=$APPDATA/local/bin:$PATH' >> ~/.profile
    • source ~/.profile
    • stack build --skip-msys threadscope

Expected

Stack builds threadscope without errors.

Actual

It fails while building the modules in the threadscope project. The stack output is here.

If I do the same thing in command prompt, an error dialog pops up with the following message:

The procedure entry point inflateValidate could not be located in the dynamic link library C:\msys64\mingw64\bin\libpng16-16.dll.

I suspect this is a stack misbehavior because cabal new-build using the GHC which was downloaded by stack works just fine in the same shell.

Stack version

Version 1.5.1, Git revision 600c1f01435a10d127938709556c1682ecfd694e x86_64 hpack-0.17.1

Method of installation

Official binary using the Windows x86_64 installer.

maoe commented 7 years ago

As mentioned in haskell/ThreadScope#67, if I use stack's MSYS (i.e. no --skip-msys), it builds fine. This is not ideal because I need to install a separate gtk2 in the existing MSYS2 to actually run threadscope. Or probably stack exec -- threadscope is supposed to work. Unfortunately this command doesn't do anything with no error messages.