Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix `network` and `HTTP` dependencies #1047

Closed
wants to merge 1 commit into from

3 participants

Alexander Dorofeev Johan Tibell Dan Haraj
Alexander Dorofeev

This fixes build on Windows. network 2.3 unwilling build under
windows.

Alexander Dorofeev akaspin Fix `network` and `HTTP` dependencies
This fixes build on Windows. `network` 2.3 unwilling build under 
windows.
dcdd523
Johan Tibell
Owner

Does this mean that the newly released cabal-install-1.16.0 doesn't build for you under Windows? We did test it under Windows and at least it built on @bos's machine.

Dan Haraj

cabal-install-1.16.0 failed to install on a fresh install of GHC-7.6.1-x86_64 on Windows 7 with the following error:

cabal.exe: Error: some packages failed to install:
HTTP-4000.2.5 failed during the configure step. The exception was:
ExitFailure 1
cabal-install-1.16.0 depends on HTTP-4000.2.5 which failed to install.

HTTP-4000.2.5 fails to install with the following error:

Configuring HTTP-4000.2.5...
cabal.exe: The program ghc version >=6.10 && <7.6 is required but the version
found at f:\dev\tools\ghc\bin\ghc.exe is version 7.6.1

I haven't tried correcting this version constraint to see what happens. I imagine it is there for good reason. Or perhaps not. Silly things like this have prevented successful builds elsewhere in spacetime.

Update: Ok. This doesn't make much sense. I was using an older version of cabal-install when the build failed. When I manually dumped an exe of cabal-install-0.14.0 in its stead, the build went through. I'm not sure how that makes sense. In fact I'm not sure anything I've done in the past 30 minutes has made any sense :(

Johan Tibell
Owner

@dharaj If you can confirm that the patch in this pull request is the correct fix for cabal-install-1.16.0 that would be great, as I can then include it in the bug fix release.

Dan Haraj

My complete apologies. I don't think this patch is related to my issue, since my problem was building via cabal install, and this patch pertains to bootstrapping cabal-install. My problem seems to be related to this issue for the HTTP package, however the solution to update cabal-install from 0.10.2 to 0.14.0 first doesn't make sense to me.

Johan Tibell
Owner

I need more information for the original poster to fix this, so I'm closing this in the meantime. If someone could test to build the lastest cabal-install on Windows and confirm that there's some problem (please post complete logs) I'm happy to reopen this bug.

Johan Tibell tibbe closed this
Alexander Dorofeev

Ohh. "Everything works on my laptop..." - it's full story about opensource.

With network 2.3.1.0:

...
Building network-2.3.1.0...
Preprocessing library network-2.3.1.0...
[1 of 8] Compiling Network.URI      ( Network\URI.hs, dist\build\Network\URI.o )

[2 of 8] Compiling Network.Socket.ByteString.Internal ( Network\Socket\ByteStrin
g\Internal.hs, dist\build\Network\Socket\ByteString\Internal.o )
[3 of 8] Compiling Network.Socket.Internal ( dist\build\Network\Socket\Internal.
hs, dist\build\Network\Socket\Internal.o )

NetworkSocketInternal.hsc:81:1: Warning:
    Module `GHC.IOBase' is deprecated: use GHC.IO instead

NetworkSocketInternal.hsc:603:1: Warning:
    the 'stdcall' calling convention is unsupported on this platform,
    treating as ccall
    When checking declaration:
      foreign import stdcall unsafe "static WSAGetLastError" c_getLastError
        :: IO CInt
[4 of 8] Compiling Network.Socket   ( dist\build\Network\Socket.hs, dist\build\N
etwork\Socket.o )

NetworkSocket.hsc:431:13:
    Not in scope: `catch'
    Perhaps you meant `Control.Exception.catch' (imported from Control.Exception
)

Error during cabal-install bootstrap:
Building the network package failed

Bang! Ok. Fix network to 2.4.0.1:

...
Configuring HTTP-4000.2.4...
Building HTTP-4000.2.4...
Preprocessing library HTTP-4000.2.4...
[ 1 of 18] Compiling Network.HTTP.Base64 ( Network\HTTP\Base64.hs, dist\build\Ne
twork\HTTP\Base64.o )
[ 2 of 18] Compiling Network.HTTP.MD5Aux ( Network\HTTP\MD5Aux.hs, dist\build\Ne
twork\HTTP\MD5Aux.o )
[ 3 of 18] Compiling Paths_HTTP       ( dist\build\autogen\Paths_HTTP.hs, dist\b
uild\Paths_HTTP.o )
[ 4 of 18] Compiling Network.Stream   ( Network\Stream.hs, dist\build\Network\St
ream.o )
[ 5 of 18] Compiling Network.HTTP.Utils ( Network\HTTP\Utils.hs, dist\build\Netw
ork\HTTP\Utils.o )
[ 6 of 18] Compiling Network.HTTP.Headers ( Network\HTTP\Headers.hs, dist\build\
Network\HTTP\Headers.o )
[ 7 of 18] Compiling Network.HTTP.Cookie ( Network\HTTP\Cookie.hs, dist\build\Ne
twork\HTTP\Cookie.o )
[ 8 of 18] Compiling Network.BufferType ( Network\BufferType.hs, dist\build\Netw
ork\BufferType.o )
[ 9 of 18] Compiling Network.HTTP.Base ( Network\HTTP\Base.hs, dist\build\Networ
k\HTTP\Base.o )
[10 of 18] Compiling Network.TCP      ( Network\TCP.hs, dist\build\Network\TCP.o
 )
[11 of 18] Compiling Network.StreamDebugger ( Network\StreamDebugger.hs, dist\bu
ild\Network\StreamDebugger.o )
[12 of 18] Compiling Network.StreamSocket ( Network\StreamSocket.hs, dist\build\
Network\StreamSocket.o )
[13 of 18] Compiling Network.HTTP.Auth ( Network\HTTP\Auth.hs, dist\build\Networ
k\HTTP\Auth.o )

Network\HTTP\Auth.hs:192:49:
    Couldn't match expected type `Maybe URI' with actual type `URI'
    In the second argument of `fromMaybe', namely
      `(u `relativeTo` baseURI)'
    In the expression: fromMaybe u (u `relativeTo` baseURI)
    In the first argument of `map', namely
      `(\ u -> fromMaybe u (u `relativeTo` baseURI))'

Error during cabal-install bootstrap:
Building the HTTP package failed

Another bang! Fix HTTP to 4000.2.5:

...
===========================================
The 'cabal' program has been installed in /.cabal/bin/
You should either add /.cabal/bin to your PATH
or copy the cabal program to a directory that is on your PATH.

The first thing to do is to get the latest list of packages with:
  cabal update
This will also create a default config file (if it does not already
exist) at /.cabal/config

By default cabal will install programs to /.cabal/bin
If you do not want to add this directory to your PATH then you can
change the setting in the config file, for example you could use:
symlink-bindir: /bin

Sometimes you just need to believe.

Johan Tibell
Owner

I've released network-2.3.1.1 which fixes the build issue in 2.3.1.0 that occur when compiling using GHC 7.6.1 on Windows. I've changed bootstrap.sh to use the new release in 5485579.

Johan Tibell
Owner

@akaspin In the future, if you include the compilation log, the output of ghc --version, and the output ghc-pkg list in your original bug report, I will be able to figure out the cause of the issue faster. I happen to know that the change to catch was in GHC 7.6.1 so I was able to figure out which GHC version you're using from the error message this time.

I don't merge patches unless I exactly understand the cause of the issue, so I can judge what the best fix is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 23, 2012
  1. Alexander Dorofeev

    Fix `network` and `HTTP` dependencies

    akaspin authored
    This fixes build on Windows. `network` 2.3 unwilling build under 
    windows.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 cabal-install/bootstrap.sh
4 cabal-install/bootstrap.sh
View
@@ -50,11 +50,11 @@ PREFIX=${PREFIX:-${DEFAULT_PREFIX}}
PARSEC_VER="3.1.3"; PARSEC_VER_REGEXP="[23]\." # == 2.* || == 3.*
DEEPSEQ_VER="1.3.0.1"; DEEPSEQ_VER_REGEXP="1\.[1-9]\." # >= 1.1 && < 2
TEXT_VER="0.11.2.3"; TEXT_VER_REGEXP="0\.([2-9]|(1[0-1]))\." # >= 0.2 && < 0.12
-NETWORK_VER="2.3.1.0"; NETWORK_VER_REGEXP="2\." # == 2.*
+NETWORK_VER="2.4.0.1"; NETWORK_VER_REGEXP="2\." # == 2.*
CABAL_VER="1.16.0"; CABAL_VER_REGEXP="1\.(13\.3|1[4-7]\.)" # >= 1.13.3 && < 1.18
TRANS_VER="0.3.0.0"; TRANS_VER_REGEXP="0\.[23]\." # >= 0.2.* && < 0.4.*
MTL_VER="2.1.2"; MTL_VER_REGEXP="[12]\." # == 1.* || == 2.*
-HTTP_VER="4000.2.4"; HTTP_VER_REGEXP="4000\.[012]\." # == 4000.0.* || 4000.1.* || 4000.2.*
+HTTP_VER="4000.2.5"; HTTP_VER_REGEXP="4000\.[012]\." # == 4000.0.* || 4000.1.* || 4000.2.*
ZLIB_VER="0.5.4.0"; ZLIB_VER_REGEXP="0\.[45]\." # == 0.4.* || == 0.5.*
TIME_VER="1.4.0.1" TIME_VER_REGEXP="1\.[1234]\.?" # >= 1.1 && < 1.5
RANDOM_VER="1.0.1.1" RANDOM_VER_REGEXP="1\.0\." # >= 1 && < 1.1
Something went wrong with that request. Please try again.