k0001 / network-simple

Haskell library abstracting common network sockets usage patterns.
BSD 3-Clause "New" or "Revised" License
33 stars 9 forks source link

Does not build on Windows #6

Closed kvanbere closed 10 years ago

kvanbere commented 10 years ago

The Windows haskell platform shipped with 7.6.3 doesn't have a network package within the network-simple version range. I tried to build it today, but it's really painful to do and requires some manual configuration.

To be honest, I haven't figured out all the details, but cabal install pipes-network tries to upgrade the existing version of network which in turn installs this package which in turn fails due to the compilation of the .c files bundled in network being clunky to configure (even from MinGW).

I don't think this was always the case, but I forget when it became so.

k0001 commented 10 years ago

I don't use Windows myself nor I have a computer with Windows available, so I'll need more details. What version of network do you have? The Haskell Platform's web page says it it 2.4.1.2, which is the within the bounds of the current requirement on network:

network (>=2.3 && <2.5)
kvanbere commented 10 years ago

You seem correct, but install fails and I can't explain it.

$ ghc-pkg list
WARNING: cache is out of date: C:/Program Files (x86)/Haskell Platform/2013.2.0.0\lib\package.conf.d\package.cache
  use 'ghc-pkg recache' to fix.
C:/Program Files (x86)/Haskell Platform/2013.2.0.0\lib\package.conf.d:
    Cabal-1.16.0
    GLURaw-1.3.0.0
    GLUT-2.4.0.0
    HTTP-4000.2.8
    HUnit-1.2.5.2
    OpenGL-2.8.0.0
    OpenGLRaw-1.3.0.0
    QuickCheck-2.6
    Win32-2.3.0.0
    array-0.4.0.1
    async-2.0.1.4
    attoparsec-0.10.4.0
    base-4.6.0.1
    bin-package-db-0.0.0.0
    binary-0.5.1.1
    bytestring-0.10.0.2
    case-insensitive-1.0.0.1
    cgi-3001.1.7.5
    containers-0.5.0.0
    deepseq-1.3.0.1
    directory-1.2.0.1
    fgl-5.4.2.4
    filepath-1.3.0.1
    (ghc-7.6.3)
    ghc-prim-0.3.0.0
    hashable-1.1.2.5
    haskell-platform-2013.2.0.0
    haskell-src-1.0.1.5
    (haskell2010-1.1.1.0)
    (haskell98-2.0.0.2)
    hoopl-3.9.0.0
    hpc-0.6.0.0
    html-1.0.1.2
    integer-gmp-0.5.0.0
    mtl-2.1.2
    network-2.4.1.2
    old-locale-1.0.0.5
    old-time-1.1.0.1
    parallel-3.2.0.3
    parsec-3.1.3
    pretty-1.1.1.0
    primitive-0.5.0.1
    process-1.1.0.2
    random-1.0.1.1
    regex-base-0.93.2
    regex-compat-0.95.1
    regex-posix-0.95.2
    rts-1.0
    split-0.2.2
    stm-2.4.2
    syb-0.4.0
    template-haskell-2.8.0.0
    text-0.11.3.1
    time-1.4.0.1
    transformers-0.3.0.0
    unordered-containers-0.2.3.0
    vector-0.10.0.1
    xhtml-3000.2.1
    zlib-0.5.4.1

C:\Users\Kyle\AppData\Roaming\ghc\i386-mingw32-7.6.3\package.conf.d:
    Cabal-1.18.1.3
    bifunctors-4.1.1
    binary-0.7.1.0
    comonad-4.0.1
    contravariant-0.4.4
    distributive-0.4.1
    exceptions-0.3.3.1
    free-4.6.1
    mmorph-1.0.2
    mtl-2.1.3.1
    nats-0.1.2
    parsec-3.1.5
    pipes-4.1.0
    pipes-binary-0.4.0.1
    pipes-bytestring-2.0.1
    pipes-group-1.0.0
    pipes-parse-3.0.1
    pipes-safe-2.0.2
    profunctors-4.0.2
    semigroupoids-4.0.1
    semigroups-0.12.2
    tagged-0.7.1
    transformers-compat-0.1.1.1
Kyle@kyle-laptop /c/Users/Kyle/Downloads/cmake_haskell/hello
$ cabal install network-simple
Resolving dependencies...
Configuring network-2.4.2.2...
Failed to install network-2.4.2.2
Last 10 lines of the build log ( C:\Users\Kyle\AppData\Roaming\cabal\logs\network-2.4.2.2.log ):
/usr/bin/arch -k       =
/bin/arch              = x86_64
/usr/bin/oslevel       =
/usr/convex/getsysinfo =

UNAME_MACHINE = x86_64
UNAME_RELEASE = 2.0.0(0.272/5/3)
UNAME_SYSTEM  = MINGW32_NT-6.3
UNAME_VERSION = 2014-03-19 13:02
configure: error: cannot guess build type; you must specify one
cabal.exe: Error: some packages failed to install:
network-2.4.2.2 failed during the configure step. The exception was:
ExitFailure 1
network-simple-0.3.0 depends on network-2.4.2.2 which failed to install.
k0001 commented 10 years ago

It might be the parsec installation at C:\Users\Kyle\AppData\Roaming\ghc\i386-mingw32-7.6.3\package.conf.d: which is triggering the installation of a newer version of network.

Can you try running cabal install -v3 network==2.4.2.2 to see if you get any ideas? It seems this issue isn't related to network-simple but to network; maybe you can find some help in the issues in the network issue tracker?

kvanbere commented 10 years ago

I'll look at this later, but I'll pop it here incase you might want to in the meantime.

Kyle@kyle-laptop ~
$ cabal install -v3 network==2.4.2.2
Searching for ghc in path.
Found ghc at C:\Program Files (x86)\Haskell Platform\2013.2.0.0\bin\ghc.exe
("C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\bin\\ghc.exe",["--numeric-version"])
C:\Program Files (x86)\Haskell Platform\2013.2.0.0\bin\ghc.exe is version
7.6.3
looking for tool ghc-pkg near compiler in C:\Program Files (x86)\Haskell
Platform\2013.2.0.0\bin
found ghc-pkg in C:\Program Files (x86)\Haskell
Platform\2013.2.0.0\bin\ghc-pkg.exe
("C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\bin\\ghc-pkg.exe",["--version"])
C:\Program Files (x86)\Haskell Platform\2013.2.0.0\bin\ghc-pkg.exe is version
7.6.3
("C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\bin\\ghc.exe",["--supported-languages"])
("C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\bin\\ghc.exe",["--info"])
Reading installed packages...
("C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\bin\\ghc-pkg.exe",["dump","--global","-v0"])
("C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\bin\\ghc-pkg.exe",["dump","--user","-v0"])
("C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\bin\\ghc.exe",["--print-libdir"])
Reading available packages...
Choosing modular solver.
Resolving dependencies...
[__0] trying: network-2.4.2.2 (user goal)
[__1] trying: base-4.6.0.1/installed-f0c... (dependency of network-2.4.2.2)
[__2] trying: rts-1.0/installedbuil... (dependency of base-4.6.0.1/installed-f0c...)
[__3] trying: integer-gmp-0.5.0.0/installed-409... (dependency of base-4.6.0.1/installed-f0c...)
[__4] trying: ghc-prim-0.3.0.0/installed-9d6... (dependency of base-4.6.0.1/installed-f0c...)
[__5] trying: network-2.4.2.2:!test
[__6] trying: parsec-3.1.5/installed-ea9... (dependency of network-2.4.2.2)
[__7] trying: text-0.11.3.1/installed-a8e... (dependency of parsec-3.1.5/installed-ea9...)
[__8] trying: deepseq-1.3.0.1/installed-aa1... (dependency of text-0.11.3.1/installed-a8e...)
[__9] trying: array-0.4.0.1/installed-72e... (dependency of text-0.11.3.1/installed-a8e...)
[_10] trying: mtl-2.1.3.1/installed-853... (dependency of parsec-3.1.5/installed-ea9...)
[_11] trying: transformers-0.3.0.0/installed-df1... (dependency of mtl-2.1.3.1/installed-853...)
[_12] next goal: bytestring (dependency of network-2.4.2.2)
[_12] trying: bytestring-0.10.0.2/installed-c8f...
[_13] done
Ready to install network-2.4.2.2
Extracting
C:\Users\Kyle\AppData\Roaming\cabal\packages\hackage.haskell.org\network\2.4.2.2\network-2.4.2.2.tar.gz
to Z:\msys64\tmp\network-2.4.2.2-4468...
Waiting for install task to finish...
Updating network.cabal with the latest revision from the index.
Configuring network-2.4.2.2...
Using external setup method with build-type Configure
creating Z:\msys64\tmp\network-2.4.2.2-4468\network-2.4.2.2\dist\setup
creating Z:\msys64\tmp\network-2.4.2.2-4468\network-2.4.2.2\dist
creating Z:\msys64\tmp\network-2.4.2.2-4468\network-2.4.2.2\dist\setup
Using Cabal library version 1.18.1.3
Using Z:\msys64\tmp\network-2.4.2.2-4468\network-2.4.2.2\dist\setup\setup.hs
as setup script.
Setup executable needs to be updated, compiling...
("C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\bin\\ghc.exe",["--make","-v","-odir","Z:\\msys64\\tmp\\network-2.4.2.2-4468\\network-2.4.2.2\\dist\\setup","-hidir","Z:\\msys64\\tmp\\network-2.4.2.2-4468\\network-2.4.2.2\\dist\\setup","-i","-iZ:\\msys64\\tmp\\network-2.4.2.2-4468\\network-2.4.2.2","-package-id","Cabal-1.18.1.3-12329a33975366a480255d447ec76c44","Z:\\msys64\\tmp\\network-2.4.2.2-4468\\network-2.4.2.2\\dist\\setup\\setup.hs","-o","Z:\\msys64\\tmp\\network-2.4.2.2-4468\\network-2.4.2.2\\dist\\setup\\setup.exe"])
Z:\msys64\tmp\network-2.4.2.2-4468\network-2.4.2.2\dist\setup\setup.exe
configure --verbose=3 --ghc --prefix=C:\Users\Kyle\AppData\Roaming\cabal
--bindir=C:\Users\Kyle\AppData\Roaming\cabal\bin
--libdir=C:\Users\Kyle\AppData\Roaming\cabal
--libsubdir=i386-windows-ghc-7.6.3\network-2.4.2.2
--libexecdir=C:\Users\Kyle\AppData\Roaming\cabal\network-2.4.2.2
--datadir=C:\Users\Kyle\AppData\Roaming\cabal
--datasubdir=i386-windows-ghc-7.6.3\network-2.4.2.2
--docdir=C:\Users\Kyle\AppData\Roaming\cabal\doc\i386-windows-ghc-7.6.3\network-2.4.2.2
--htmldir=C:\Users\Kyle\AppData\Roaming\cabal\doc\i386-windows-ghc-7.6.3\network-2.4.2.2\html
--haddockdir=C:\Users\Kyle\AppData\Roaming\cabal\doc\i386-windows-ghc-7.6.3\network-2.4.2.2\html
--sysconfdir=C:\Users\Kyle\AppData\Roaming\cabal\etc
--enable-library-profiling --user
--extra-prog-path=C:\Users\Kyle\AppData\Roaming\cabal\bin --constraint=parsec
==3.1.5 --constraint=bytestring ==0.10.0.2 --constraint=base ==4.6.0.1
--disable-tests --disable-benchmarks
Redirecting build log to {handle:
C:\Users\Kyle\AppData\Roaming\cabal\logs\network-2.4.2.2.log}
Failed to install network-2.4.2.2
Last 10 lines of the build log ( C:\Users\Kyle\AppData\Roaming\cabal\logs\network-2.4.2.2.log ):
/bin/arch              = x86_64
/usr/bin/oslevel       =
/usr/convex/getsysinfo =

UNAME_MACHINE = x86_64
UNAME_RELEASE = 2.0.0(0.272/5/3)
UNAME_SYSTEM  = MINGW32_NT-6.3
UNAME_VERSION = 2014-03-19 13:02
configure: error: cannot guess build type; you must specify one
sh returned ExitFailure 1
World file is already up to date.
cabal.exe: Error: some packages failed to install:
network-2.4.2.2 failed during the configure step. The exception was:
ExitFailure 1

I'm aware it gives some instructions for installing network there (and on a few blogs too), but it's an extremely nontrivial/hacky thing to do. The network package on Windows is one of those which are better left alone and only upgraded with new HPs.

k0001 commented 10 years ago

Try getting rid of the parsec==3.1.5 installed in C:\Users\Kyle\AppData\Roaming\ghc\i386-mingw32-7.6.3\package.conf.d; I think that's what triggering the installation of a new network package,

kvanbere commented 10 years ago

Removed parsec, but it didn't seem to help. cabal install pipes-network still fails wanting to reinstall network (it also reinstalls the same version of parsec). I think you're right -- this is probably not a network-simple issue, but nonetheless it means neither network-simple or pipes-network seem to work on Windows...