Unverified Commit 4aea51af authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Drop support for network < 2.6.

Supersedes #5216.
parent c0fb911b
......@@ -217,10 +217,10 @@ BINARY_VER="0.8.3.0"; BINARY_VER_REGEXP="[0]\.[78]\."
# >= 0.7 && < 0.9
TEXT_VER="1.2.3.0"; TEXT_VER_REGEXP="[1]\.[2]\."
# >= 1.2 && < 1.3
NETWORK_URI_VER="2.6.1.0"; NETWORK_URI_VER_REGEXP="2\.6\.(0\.[2-9]|[1-9])"
# >= 2.6.0.2 && < 2.7
NETWORK_VER="2.6.3.4"; NETWORK_VER_REGEXP="2\.[0-6]\."
# >= 2.0 && < 2.7
NETWORK_URI_VER="2.6.1.0"; NETWORK_URI_VER_REGEXP="2\.6\."
# >= 2.6 && < 2.7
CABAL_VER="2.3.0.0"; CABAL_VER_REGEXP="2\.3\.[0-9]"
# >= 2.3 && < 2.4
TRANS_VER="0.5.5.0"; TRANS_VER_REGEXP="0\.[45]\."
......@@ -265,9 +265,9 @@ TAR_VER="0.5.1.0"; TAR_VER_REGEXP="0\.5\.([1-9]|1[0-9]|0\.[3-9]|0\.1[0-9])\.
HACKAGE_URL="https://hackage.haskell.org/package"
# Haddock fails for network-2.5.0.0, and for hackage-security for
# GHC <8, c.f. https://github.com/well-typed/hackage-security/issues/149
NO_DOCS_PACKAGES_VER_REGEXP="network-uri-2\.5\.[0-9]+\.[0-9]+|hackage-security-0\.5\.[0-9]+\.[0-9]+"
# Haddock fails for hackage-security for GHC <8,
# c.f. https://github.com/well-typed/hackage-security/issues/149
NO_DOCS_PACKAGES_VER_REGEXP="hackage-security-0\.5\.[0-9]+\.[0-9]+"
# Cache the list of packages:
echo "Checking installed packages for ghc-${GHC_VER}..."
......@@ -427,27 +427,6 @@ do_Cabal_pkg () {
fi
}
# Replicate the flag selection logic for network-uri in the .cabal file.
do_network_uri_pkg () {
# Refresh installed package list.
${GHC_PKG} list --global ${SCOPE_OF_INSTALLATION} > ghc-pkg-stage2.list \
|| die "running '${GHC_PKG} list' failed"
NETWORK_URI_DUMMY_VER="2.5.0.0"; NETWORK_URI_DUMMY_VER_REGEXP="2\.5\." # < 2.6
if egrep " network-2\.[6-9]\." ghc-pkg-stage2.list > /dev/null 2>&1
then
# Use network >= 2.6 && network-uri >= 2.6
info_pkg "network-uri" ${NETWORK_URI_VER} ${NETWORK_URI_VER_REGEXP}
do_pkg "network-uri" ${NETWORK_URI_VER} ${NETWORK_URI_VER_REGEXP}
else
# Use network < 2.6 && network-uri < 2.6
info_pkg "network-uri" ${NETWORK_URI_DUMMY_VER} \
${NETWORK_URI_DUMMY_VER_REGEXP}
do_pkg "network-uri" ${NETWORK_URI_DUMMY_VER} \
${NETWORK_URI_DUMMY_VER_REGEXP}
fi
}
# Conditionally install bytestring-builder if bytestring is < 0.10.2.
do_bytestring_builder_pkg () {
if egrep "bytestring-0\.(9|10\.[0,1])\.?" ghc-pkg-stage2.list > /dev/null 2>&1
......@@ -468,6 +447,7 @@ info_pkg "transformers" ${TRANS_VER} ${TRANS_VER_REGEXP}
info_pkg "mtl" ${MTL_VER} ${MTL_VER_REGEXP}
info_pkg "text" ${TEXT_VER} ${TEXT_VER_REGEXP}
info_pkg "parsec" ${PARSEC_VER} ${PARSEC_VER_REGEXP}
info_pkg "network-uri" ${NETWORK_URI_VER} ${NETWORK_URI_VER_REGEXP}
info_pkg "network" ${NETWORK_VER} ${NETWORK_VER_REGEXP}
info_pkg "HTTP" ${HTTP_VER} ${HTTP_VER_REGEXP}
info_pkg "zlib" ${ZLIB_VER} ${ZLIB_VER_REGEXP}
......@@ -503,11 +483,8 @@ do_pkg "parsec" ${PARSEC_VER} ${PARSEC_VER_REGEXP}
# Install the Cabal library from the local Git clone if possible.
do_Cabal_pkg
do_pkg "network-uri" ${NETWORK_URI_VER} ${NETWORK_URI_VER_REGEXP}
do_pkg "network" ${NETWORK_VER} ${NETWORK_VER_REGEXP}
# We conditionally install network-uri, depending on the network version.
do_network_uri_pkg
do_pkg "HTTP" ${HTTP_VER} ${HTTP_VER_REGEXP}
do_pkg "zlib" ${ZLIB_VER} ${ZLIB_VER_REGEXP}
do_pkg "random" ${RANDOM_VER} ${RANDOM_VER_REGEXP}
......
......@@ -94,10 +94,6 @@ source-repository head
location: https://github.com/haskell/cabal/
subdir: cabal-install
Flag network-uri
description: Get Network.URI from the network-uri package
default: True
Flag native-dns
description: Enable use of the [resolv](https://hackage.haskell.org/package/resolv) & [windns](https://hackage.haskell.org/package/windns) packages for performing DNS lookups
default: True
......@@ -310,6 +306,8 @@ library
hashable >= 1.0 && < 2,
HTTP >= 4000.1.5 && < 4000.4,
mtl >= 2.0 && < 3,
network-uri >= 2.6.0.2 && < 2.7,
network >= 2.6 && < 2.7,
pretty >= 1.1 && < 1.2,
process >= 1.1.0.2 && < 1.7,
random >= 1 && < 1.2,
......@@ -319,14 +317,6 @@ library
zlib >= 0.5.3 && < 0.7,
hackage-security >= 0.5.2.2 && < 0.6
-- NOTE: you MUST include the network dependency even when network-uri
-- is pulled in, otherwise the constraint solver doesn't have enough
-- information
if flag(network-uri)
build-depends: network-uri >= 2.6 && < 2.7, network >= 2.6 && < 2.7
else
build-depends: network >= 2.4 && < 2.6
if flag(native-dns)
if os(windows)
build-depends: windns >= 0.1.0 && < 0.2
......@@ -393,6 +383,8 @@ executable cabal
hashable >= 1.0 && < 2,
HTTP >= 4000.1.5 && < 4000.4,
mtl >= 2.0 && < 3,
network >= 2.6 && < 2.7,
network-uri >= 2.6 && < 2.7,
pretty >= 1.1 && < 1.2,
process >= 1.2 && < 1.7,
random >= 1 && < 1.2,
......@@ -548,14 +540,6 @@ executable cabal
Distribution.Solver.Types.SourcePackage
Distribution.Solver.Types.Variable
-- NOTE: you MUST include the network dependency even when network-uri
-- is pulled in, otherwise the constraint solver doesn't have enough
-- information
if flag(network-uri)
build-depends: network-uri >= 2.6 && < 2.7, network >= 2.6 && < 2.7
else
build-depends: network >= 2.4 && < 2.6
if flag(native-dns)
if os(windows)
build-depends: windns >= 0.1.0 && < 0.2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment