Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

'stack install ghc-mod' fails with latest LTS/Nightly snapshot on 64-bit Windows #785

Closed
TerrorJack opened this issue May 11, 2016 · 12 comments

Comments

@TerrorJack
Copy link

TerrorJack commented May 11, 2016

The error message is as follows:

--  While building package ghc-mod-5.5.0.0 using:
  C:\msys64\tmp\stack2428\ghc-mod-5.5.0.0\.stack-work\dist\2672c1f3\setup\setup --builddir=.stack-work\dist\2672c1f3 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: C:\Users\astro\AppData\Roaming\stack\global-project\.stack-work\logs\ghc-mod-5.5.0.0.log

[1 of 5] Compiling NotCPP.Utils     ( NotCPP\Utils.hs, C:\msys64\tmp\stack2428\ghc-mod-5.5.0.0\.stack-work\dist\2672c1f3\setup\NotCPP\Utils.o )
[2 of 5] Compiling NotCPP.LookupValueName ( NotCPP\LookupValueName.hs, C:\msys64\tmp\stack2428\ghc-mod-5.5.0.0\.stack-work\dist\2672c1f3\setup\NotCPP\LookupValueName.o )
[3 of 5] Compiling NotCPP.Declarations ( NotCPP\Declarations.hs, C:\msys64\tmp\stack2428\ghc-mod-5.5.0.0\.stack-work\dist\2672c1f3\setup\NotCPP\Declarations.o )
[4 of 5] Compiling SetupCompat      ( SetupCompat.hs, C:\msys64\tmp\stack2428\ghc-mod-5.5.0.0\.stack-work\dist\2672c1f3\setup\SetupCompat.o )
[5 of 5] Compiling Main             ( C:\msys64\tmp\stack2428\ghc-mod-5.5.0.0\Setup.hs, C:\msys64\tmp\stack2428\ghc-mod-5.5.0.0\.stack-work\dist\2672c1f3\setup\Main.o )
Linking C:\msys64\tmp\stack2428\ghc-mod-5.5.0.0\.stack-work\dist\2672c1f3\setup\setup.exe ...
Configuring ghc-mod-5.5.0.0...
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package time-1.5.0.1 requires Win32-2.3.1.0
package process-1.2.3.0 requires Win32-2.3.1.0
package ghc-7.10.3 requires Win32-2.3.1.0
package directory-1.2.2.0 requires Win32-2.3.1.0
package time-1.5.0.1 requires Win32-2.3.1.1
package process-1.2.3.0 requires Win32-2.3.1.1
package directory-1.2.2.0 requires Win32-2.3.1.1
package ansi-terminal-0.6.2.3 requires Win32-2.3.1.1
package process-1.2.3.0 requires directory-1.2.2.0
package hpc-0.6.0.2 requires directory-1.2.2.0
package ghc-7.10.3 requires directory-1.2.2.0
package bin-package-db-0.0.0.0 requires directory-1.2.2.0
package temporary-1.2.0.4 requires directory-1.2.2.0
package process-1.2.3.0 requires directory-1.2.2.0
package hlint-1.9.32 requires directory-1.2.2.0
package ghc-mod-5.5.0.0 requires directory-1.2.2.0
package extra-1.4.5 requires directory-1.2.2.0
package cpphs-1.20.1 requires directory-1.2.2.0
package cabal-helper-0.6.3.1 requires directory-1.2.2.0
package Cabal-1.22.8.0 requires directory-1.2.2.0
package optparse-applicative-0.12.1.0 requires process-1.2.3.0
package hlint-1.9.32 requires process-1.2.3.0
package ghc-mod-5.5.0.0 requires process-1.2.3.0
package extra-1.4.5 requires process-1.2.3.0
package cmdargs-0.10.14 requires process-1.2.3.0
package cabal-helper-0.6.3.1 requires process-1.2.3.0
package Cabal-1.22.8.0 requires process-1.2.3.0
package ghc-7.10.3 requires process-1.2.3.0
package random-1.1 requires time-1.5.0.1
package ghc-mod-5.5.0.0 requires time-1.5.0.1
package extra-1.4.5 requires time-1.5.0.1
package directory-1.2.2.0 requires time-1.5.0.1
package Cabal-1.22.8.0 requires time-1.5.0.1
package hpc-0.6.0.2 requires time-1.5.0.1
package ghc-7.10.3 requires time-1.5.0.1
package directory-1.2.2.0 requires time-1.5.0.1
Building ghc-mod-5.5.0.0...
Preprocessing library ghc-mod-5.5.0.0...
[ 1 of 55] Compiling Data.Binary.Generic ( Data\Binary\Generic.hs, .stack-work\dist\2672c1f3\build\Data\Binary\Generic.o )
[ 2 of 55] Compiling Language.Haskell.GhcMod.Read ( Language\Haskell\GhcMod\Read.hs, .stack-work\dist\2672c1f3\build\Language\Haskell\GhcMod\Read.o )
[ 3 of 55] Compiling System.Directory.ModTime ( System\Directory\ModTime.hs, .stack-work\dist\2672c1f3\build\System\Directory\ModTime.o )
[ 4 of 55] Compiling Paths_ghc_mod    ( .stack-work\dist\2672c1f3\build\autogen\Paths_ghc_mod.hs, .stack-work\dist\2672c1f3\build\Paths_ghc_mod.o )
[ 5 of 55] Compiling Utils            ( Utils.hs, .stack-work\dist\2672c1f3\build\Utils.o )
[ 6 of 55] Compiling Language.Haskell.GhcMod.Caching.Types ( Language\Haskell\GhcMod\Caching\Types.hs, .stack-work\dist\2672c1f3\build\Language\Haskell\GhcMod\Caching\Types.o )
[ 7 of 55] Compiling Language.Haskell.GhcMod.Types ( Language\Haskell\GhcMod\Types.hs, .stack-work\dist\2672c1f3\build\Language\Haskell\GhcMod\Types.o )
GHC runtime linker: fatal error: I found a duplicate definition for symbol
   rgb
whilst processing object file
   C:\Users\astro\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\lib\Win32_ELFLzTRksT8Dql3wobiWvb\HSWin32-2.3.1.0-ELFLzTRksT8Dql3wobiWvb.o
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.
ghc.exe: panic! (the 'impossible' happened)
  (GHC version 7.10.3 for x86_64-unknown-mingw32):
    loadObj "C:\\Users\\astro\\AppData\\Local\\Programs\\stack\\x86_64-windows\\ghc-7.10.3\\lib\\Win32_ELFLzTRksT8Dql3wobiWvb\\HSWin32-2.3.1.0-ELFLzTRksT8Dql3wobiWvb.o": failed

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

I am building it in a mingw-w64 win64 shell (uname -a outputs MINGW64_NT-10.0 DESKTOP-RUPL5NM 2.5.0(0.297/5/3) 2016-04-12 13:08 x86_64 Msys).The ghc compiler I'm using is installed by stack setup, there is no global ghc. The build command is stack install ghc-mod, and it is not run in a project directory, so it is using implicit global config. Global project resolver is set to nightly-2016-05-08/lts-5.16, both fails. I also tried removing the whole %appdata%\stack directory (equivalent to ~/.stack in Linux), but that doesn't help either.

@DanielG
Copy link
Owner

DanielG commented May 11, 2016

[...]
Configuring ghc-mod-5.5.0.0...
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
[...]

I'm gonna go ahead and guess it's that. Shouldn't that be impossible with Stack!?

@rvion
Copy link

rvion commented May 11, 2016

@TerrorJack what gives stack --version
how did you setup ghc ?
what is the command you ran ?

@TerrorJack
Copy link
Author

stack --version gives Version 1.1.0 x86_64 hpack-0.13.0. I setup ghc with stack setup (no global ghc). I ran stack install ghc-mod, before which I set the snapshot version of global project to latest LTS/Nightly.

@rvion
Copy link

rvion commented May 11, 2016

are you in a project folder ?
if so, could you try to stack clean --full first ?

can you try stack instal --resolver=nightly ghc-mod ?

@TerrorJack
Copy link
Author

TerrorJack commented May 11, 2016

Not in a project folder, so implicitly using global config. And I completely purged the %appdata%\stack (equivalent to ~/.stack on Linux) directory first, but the problem persists.

@rvion
Copy link

rvion commented May 11, 2016

Arf, no idea, so. you should probably report a bug on stack. :/

Also, next time, it would be more practical if you could paste full logs of your commands.
For example, in your initial report, I don't see neither the exact command you ran, neither the initial logs outputed by stack, etc.

same for stack clean --full and stack instal --resolver=nightly ghc-mod. I'm not even sure if you tried them or if you you just concluded they would not work because you previously trashed your %appdata%\stack.

anyway, hope some else will be able to help

@TerrorJack
Copy link
Author

Thank you for taking your time, I'll give that a shot. I'll also try rolling back to lts-5.15 to see if it will work.

@rvion
Copy link

rvion commented May 11, 2016

no prob :)
(you may also want to say in your bug report if you use mysis /cygwin / any custom linker like gold instead of ld, etc)

@rvion
Copy link

rvion commented May 11, 2016

you can also print the result of "uname -a", that's could be usefull

@TerrorJack
Copy link
Author

@rvion Updated in the post. Not using any custom linker..

@TerrorJack
Copy link
Author

The problem persists even if I use stack clean --full and stack install --resolver=nightly ghc-mod. I think it is appropriate to conclude it's a stack bug, not ghc-mod bug.

@rvion
Copy link

rvion commented May 11, 2016

yes, I think you're right, I guess your best bet is to open an issue in the stack bug tracker, and link it to here

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

No branches or pull requests

3 participants