mvoidex / hsdev

Haskell development tool
BSD 3-Clause "New" or "Revised" License
130 stars 23 forks source link

hsdev-0.1.3.0 build fails #9

Closed Dangthrimble closed 10 years ago

Dangthrimble commented 10 years ago

Attempting to configure hsdev and get the following warning:

>cabal configure
Resolving dependencies...
Configuring hsdev-0.1.3.0...
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package haddock-api-2.15.0 requires Cabal-1.18.1.3
package ghc-mod-5.1.1.0 requires Cabal-1.18.1.3
package ghc-7.8.3 requires Cabal-1.18.1.3
package bin-package-db-0.0.0.0 requires Cabal-1.18.1.3
package hsdev-0.1.3.0 requires Cabal-1.20.0.2
package HTTP-4000.2.10 requires network-2.4.2.3
package hsdev-0.1.3.0 requires network-2.6.0.2
package hdocs-0.4.1.0 requires network-2.6.0.2
package parsec-3.1.5 requires text-1.1.0.0
package semigroups-0.15.3 requires text-1.2.0.0
package scientific-0.3.3.2 requires text-1.2.0.0
package polyparse-1.10 requires text-1.2.0.0
package hsdev-0.1.3.0 requires text-1.2.0.0
package hdocs-0.4.1.0 requires text-1.2.0.0
package hashable-1.2.2.0 requires text-1.2.0.0
package ghc-mod-5.1.1.0 requires text-1.2.0.0
package attoparsec-0.12.1.2 requires text-1.2.0.0
package aeson-pretty-0.7.1 requires text-1.2.0.0
package aeson-0.8.0.2 requires text-1.2.0.0

cabal build then fails:

>cabal build
Building hsdev-0.1.3.0...
Preprocessing library hsdev-0.1.3.0...
[ 1 of 49] Compiling HsDev.Version    ( src\HsDev\Version.hs, dist\build\HsDev\Version.o )
[ 2 of 49] Compiling HsDev.Tools.Ghc.Prelude ( src\HsDev\Tools\Ghc\Prelude.hs, dist\build\HsDev\Tools\Ghc\Prelude.o )
[ 3 of 49] Compiling HsDev.Tools.ClearImports ( src\HsDev\Tools\ClearImports.hs, dist\build\HsDev\Tools\ClearImports.o )
[ 4 of 49] Compiling System.Win32.FileMapping.Memory ( src\System\Win32\FileMapping\Memory.hs, dist\build\System\Win32\FileMapping\Memory.o )
[ 5 of 49] Compiling System.Win32.FileMapping.NamePool ( src\System\Win32\FileMapping\NamePool.hs, dist\build\System\Win32\FileMapping\NamePool.o )
[ 6 of 49] Compiling Text.Format      ( src\Text\Format.hs, dist\build\Text\Format.o )
[ 7 of 49] Compiling HsDev.Cabal      ( src\HsDev\Cabal.hs, dist\build\HsDev\Cabal.o )
[ 8 of 49] Compiling Data.Lisp        ( src\Data\Lisp.hs, dist\build\Data\Lisp.o )
[ 9 of 49] Compiling Data.Help        ( src\Data\Help.hs, dist\build\Data\Help.o )
[10 of 49] Compiling System.Console.Args ( src\System\Console\Args.hs, dist\build\System\Console\Args.o )
[11 of 49] Compiling System.Console.Cmd ( src\System\Console\Cmd.hs, dist\build\System\Console\Cmd.o )
[12 of 49] Compiling Data.Group       ( src\Data\Group.hs, dist\build\Data\Group.o )
[13 of 49] Compiling Data.Async       ( src\Data\Async.hs, dist\build\Data\Async.o )
[14 of 49] Compiling Control.Concurrent.Util ( src\Control\Concurrent\Util.hs, dist\build\Control\Concurrent\Util.o )
[15 of 49] Compiling Control.Concurrent.Task ( src\Control\Concurrent\Task.hs, dist\build\Control\Concurrent\Task.o )
[16 of 49] Compiling HsDev.Util       ( src\HsDev\Util.hs, dist\build\HsDev\Util.o )
[17 of 49] Compiling HsDev.Project    ( src\HsDev\Project.hs, dist\build\HsDev\Project.o )
[18 of 49] Compiling HsDev.Server.Message ( src\HsDev\Server\Message.hs, dist\build\HsDev\Server\Message.o )
[19 of 49] Compiling HsDev.Symbols.Location ( src\HsDev\Symbols\Location.hs, dist\build\HsDev\Symbols\Location.o )
[20 of 49] Compiling HsDev.Display    ( src\HsDev\Display.hs, dist\build\HsDev\Display.o )
[21 of 49] Compiling HsDev.Symbols.Class ( src\HsDev\Symbols\Class.hs, dist\build\HsDev\Symbols\Class.o )
[22 of 49] Compiling HsDev.Symbols.Documented ( src\HsDev\Symbols\Documented.hs, dist\build\HsDev\Symbols\Documented.o )
[23 of 49] Compiling HsDev.Symbols    ( src\HsDev\Symbols.hs, dist\build\HsDev\Symbols.o )
[24 of 49] Compiling HsDev.Symbols.Util ( src\HsDev\Symbols\Util.hs, dist\build\HsDev\Symbols\Util.o )
[25 of 49] Compiling HsDev.Database   ( src\HsDev\Database.hs, dist\build\HsDev\Database.o )
[26 of 49] Compiling HsDev.Cache      ( src\HsDev\Cache.hs, dist\build\HsDev\Cache.o )
[27 of 49] Compiling HsDev.Cache.Structured ( src\HsDev\Cache\Structured.hs, dist\build\HsDev\Cache\Structured.o )
[28 of 49] Compiling HsDev.Database.Async ( src\HsDev\Database\Async.hs, dist\build\HsDev\Database\Async.o )
[29 of 49] Compiling HsDev.Commands   ( src\HsDev\Commands.hs, dist\build\HsDev\Commands.o )
[30 of 49] Compiling HsDev.Tools.HDocs ( src\HsDev\Tools\HDocs.hs, dist\build\HsDev\Tools\HDocs.o )
[31 of 49] Compiling HsDev.Symbols.Resolve ( src\HsDev\Symbols\Resolve.hs, dist\build\HsDev\Symbols\Resolve.o )
[32 of 49] Compiling HsDev.Tools.Hayoo ( src\HsDev\Tools\Hayoo.hs, dist\build\HsDev\Tools\Hayoo.o )
[33 of 49] Compiling HsDev.Tools.Base ( src\HsDev\Tools\Base.hs, dist\build\HsDev\Tools\Base.o )
[34 of 49] Compiling HsDev.Tools.Cabal ( src\HsDev\Tools\Cabal.hs, dist\build\HsDev\Tools\Cabal.o )
[35 of 49] Compiling HsDev.Scan.Browse ( src\HsDev\Scan\Browse.hs, dist\build\HsDev\Scan\Browse.o )
[36 of 49] Compiling HsDev.Inspect    ( src\HsDev\Inspect.hs, dist\build\HsDev\Inspect.o )
[37 of 49] Compiling System.Win32.PowerShell ( src\System\Win32\PowerShell.hs, dist\build\System\Win32\PowerShell.o )
[38 of 49] Compiling Control.Concurrent.FiniteChan ( src\Control\Concurrent\FiniteChan.hs, dist\build\Control\Concurrent\FiniteChan.o )
[39 of 49] Compiling Control.Concurrent.Worker ( src\Control\Concurrent\Worker.hs, dist\build\Control\Concurrent\Worker.o )
[40 of 49] Compiling HsDev.Tools.GhcMod ( src\HsDev\Tools\GhcMod.hs, dist\build\HsDev\Tools\GhcMod.o )
[41 of 49] Compiling HsDev.Tools.GhcMod.InferType ( src\HsDev\Tools\GhcMod\InferType.hs, dist\build\HsDev\Tools\GhcMod\InferType.o )
[42 of 49] Compiling HsDev.Scan       ( src\HsDev\Scan.hs, dist\build\HsDev\Scan.o )
[43 of 49] Compiling HsDev            ( src\HsDev.hs, dist\build\HsDev.o )
[44 of 49] Compiling HsDev.Database.Update ( src\HsDev\Database\Update.hs, dist\build\HsDev\Database\Update.o )
[45 of 49] Compiling HsDev.Tools.Ghc.Worker ( src\HsDev\Tools\Ghc\Worker.hs, dist\build\HsDev\Tools\Ghc\Worker.o )
[46 of 49] Compiling HsDev.Server.Types ( src\HsDev\Server\Types.hs, dist\build\HsDev\Server\Types.o )
[47 of 49] Compiling HsDev.Client.Commands ( src\HsDev\Client\Commands.hs, dist\build\HsDev\Client\Commands.o )
[48 of 49] Compiling Control.Apply.Util ( src\Control\Apply\Util.hs, dist\build\Control\Apply\Util.o )
[49 of 49] Compiling HsDev.Server.Commands ( src\HsDev\Server\Commands.hs, dist\build\HsDev\Server\Commands.o )
In-place registering hsdev-0.1.3.0...
Preprocessing executable 'hsdev' for hsdev-0.1.3.0...
[1 of 1] Compiling Main             ( tools\hsdev.hs, dist\build\hsdev\hsdev-tmp\Main.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package Win32-2.3.0.2 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package process-1.2.0.0 ... linking ... done.
Loading package Cabal-1.20.0.2 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package text-1.1.0.0 ... linking ... done.
Loading package parsec-3.1.5 ... linking ... done.
Loading package network-2.4.2.3 ... ghc.exe: warning: inet_ntoa from linking ... ws2_32 is linked instead of __imp_inet_ntoa
ghc.exe: warning: getnameinfo from ws2_32 is linked instead of __imp_getnameinfo

ghc.exe: warning: getaddrinfo from ws2_32 is linked instead of __imp_getaddrinfo

ghc.exe: warning: freeaddrinfo from ws2_32 is linked instead of __imp_freeaddrinfo
ghc.exe: warning: accept from ws2_32 is linked instead of __imp_accept
ghc.exe: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
ghc.exe: warning: WSAStartup from ws2_32 is linked instead of __imp_WSAStartup
ghc.exe: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
done.
Loading package old-time-1.1.0.2 ... linking ... done.
Loading package HTTP-4000.2.10 ... linking ... done.
Loading package text-1.2.0.0 ...

GHCi runtime linker: fatal error: I found a duplicate definition for symbol
   _hs_text_memcpy
whilst processing object file
   C:\Program Files\Haskell\x86_64-windows-ghc-7.8.3\text-1.2.0.0\HStext-1.2.0.0.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.
GHCi cannot safely continue in this situation.  Exiting now.  Sorry.
Dangthrimble commented 10 years ago

I'm going to delete %ProgramFiles%\Haskell and %AppData%\cabal then re-extract GHC to %ProgramFiles%\Haskell and the cabal-install tool to %ProgramFiles%\Haskell\bin. I also have Leksah installed, so I'm going to uninstall that. Then I'll try again.

Dangthrimble commented 10 years ago

It worked! Considering the problems I've been having, I'm wondering whether Leksah was interfering in some way. Thanks again for your support. Now I can build hsdev and try to get to grips with Sublime Text and SublimeHaskell. Any tips?

mvoidex commented 10 years ago

Make sure, that enable_hsdev is true in SublimeHaskell settings: Ctrl-Shift-P, then type SublimeHaskell settings and select user ones. If they are empty, write there:

{
    "enable_hsdev": true
}

You can find docs for settings in default SublimeHaskell settings.

There may be freezing just after starting SublimeHaskell, it's known bug.

Dangthrimble commented 10 years ago

When I say it worked, I managed to build alex, happy and cabal. But when I copied %ProgramFiles(x86)%\Haskell over %ProgramFiles%\Haskell I couldn't get hsdev to build. Deleted all but cabal and GHC there and tried to rebuild alex and happy and couldn't get them to build. I'll start from scratch again some time today if I get the chance and see what happens. I'll keep a note of exactly what I do.

What is the best way to go about moving the files from %ProgramFiles(x86)% to %ProgramFiles%?

Dangthrimble commented 10 years ago

Steps to install alex, happy and cabal to %ProgramFiles(x86). Worked like clockwork. The question is, what to do next?

Preparation

  1. Delete %ProgramFiles%\Haskell, %ProgramFiles(x86)%\Haskell and %AppData%/cabal

Installing GHC and cabal-install tool

  1. Create the directory %ProgramFiles%\Haskell\bin
  2. Download the latest version of GHC for 64-bit Windows. There are two file formats available; I use the *.tar.xz format
  3. Extract the ghc-* folder within to %ProgramFiles%\Haskell (not to the bin subdirectory)
  4. Download the latest version of the cabal-install tool for Windows
  5. Extract cabal.exe to %ProgramFiles%\Haskell\bin
  6. Add %ProgramFiles%\Haskell\bin, %ProgramFiles%\Haskell\ghc-7.8.3\bin and %ProgramFiles%\Haskell\ghc-7.8.3\mingw\bin to the front of the system PATH variable

Building cabal

  1. Run the MSYS2 shell as Administrator and run the following command:
$ cabal update
  1. Edit %AppData%\cabal\config and set user-install to False
  2. Within the MSYS2 shell run:
$ cabal install alex happy
$ cabal install cabal-install
mvoidex commented 10 years ago

I'm using this sequence of actions:

  1. Download GHC and unpack anywhere, add bin to PATH.
  2. Add GHCPATH/mingw/bin to PATH
  3. Download cabal-install tool, add it to PATH too
  4. Install Cygwin somewhere
  5. cabal update
  6. cabal install network --configure-option --build=i386-unknown-mingw32 from Cygwin terminal
  7. cabal install alex happy
  8. cabal install cabal-install
Dangthrimble commented 10 years ago

I've copied the three exe files to %ProgramFiles%\Haskell\bin and hsdev has built!

Can I delete %ProgramFiles(x86)\Haskell, or do the files need to be moved or stay where they are?

mvoidex commented 10 years ago

Are these files copied to new locations? And is PATH now contains new paths? If yes, I think, old folder may be deleted. To be sure, rename it to Haskell.bak, and if all works fine - delete it.

AnneTheAgile commented 9 years ago

thank you! On windows 8.1 I couldn't do

cabal install cabal-install

due to the network-2.6.0.2 dependency, as described above. It occurred indeed when I was using a regular bash shell instead of my cygwin. Upon using the cygwin shell, I used the update commands for cabal , network, and happy , and now it works great.

So, I did not need to move or rearrange my haskell folders in the OS.