Commit ea8dbaaa authored by tibbe's avatar tibbe
Browse files

Merge branch 'master' into 1.22

parents 699d4df1 8282e5ff
......@@ -15,7 +15,7 @@ For general discussion or queries email the libraries mailing list
The Cabal library and related infrastructure is still under active
development. New features are being added and limitations and bugs are
being fixed. This requires internal changes and often user visible
changes as well. We therefor cannot promise complete future-proof
changes as well. We therefore cannot promise complete future-proof
stability, at least not without halting all development work.
This section documents the aspects of the Cabal interface that we can
......
......@@ -32,7 +32,6 @@ import Distribution.Verbosity (Verbosity)
import System.FilePath (searchPathSeparator, (</>))
import Control.Applicative ((<$>))
import Data.Monoid (mempty)
import Data.Traversable as T
-- | Execute the given command in the package's environment.
......
......@@ -128,7 +128,8 @@ import Distribution.Simple.Configure
, ConfigStateFileError(..), localBuildInfoFile
, getPersistBuildConfig, tryGetPersistBuildConfig )
import qualified Distribution.Simple.LocalBuildInfo as LBI
import Distribution.Simple.Program (defaultProgramConfiguration)
import Distribution.Simple.Program (defaultProgramConfiguration
,configureAllKnownPrograms)
import qualified Distribution.Simple.Setup as Cabal
import Distribution.Simple.Utils
( cabalVersion, die, notice, info, topHandler
......@@ -660,6 +661,8 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags)
savedHaddockFlags config `mappend` haddockFlags
globalFlags' = savedGlobalFlags config `mappend` globalFlags
(comp, platform, conf) <- configCompilerAux' configFlags'
-- TODO: Redesign ProgramDB API to prevent such problems as #2241 in the future.
conf' <- configureAllKnownPrograms verbosity conf
-- If we're working inside a sandbox and the user has set the -w option, we
-- may need to create a sandbox-local package DB for this compiler and add a
......@@ -672,7 +675,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags)
}
whenUsingSandbox useSandbox $ \sandboxDir -> do
initPackageDBIfNeeded verbosity configFlags'' comp conf
initPackageDBIfNeeded verbosity configFlags'' comp conf'
indexFile <- tryGetIndexFilePath config
maybeAddCompilerTimestampRecord verbosity sandboxDir indexFile
......@@ -689,7 +692,7 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags)
install verbosity
(configPackageDB' configFlags'')
(globalRepos globalFlags')
comp platform conf
comp platform conf'
useSandbox mSandboxPkgInfo
globalFlags' configFlags'' configExFlags'
installFlags' haddockFlags'
......
......@@ -188,10 +188,10 @@ TEXT_VER="1.2.0.3"; TEXT_VER_REGEXP="((1\.[012]\.)|(0\.([2-9]|(1[0-1]))\.))"
# >= 0.2 && < 1.3
NETWORK_VER="2.6.0.2"; NETWORK_VER_REGEXP="2\.[0-6]\."
# >= 2.0 && < 2.7
NETWORK_URI_VER="2.6.0.1"; NETWORK_URI_VER_REGEXP="2\.[0-6]\."
# >= 2.0 && < 2.7
CABAL_VER="1.21.1.0"; CABAL_VER_REGEXP="1\.21\.1"
# >= 1.21.1 && < 1.22
NETWORK_URI_VER="2.6.0.1"; NETWORK_URI_VER_REGEXP="2\.6\."
# >= 2.6 && < 2.7
CABAL_VER="1.22.0.0"; CABAL_VER_REGEXP="1\.22"
# >= 1.22 && < 1.23
TRANS_VER="0.4.2.0"; TRANS_VER_REGEXP="0\.[4]\."
# >= 0.2.* && < 0.5
MTL_VER="2.2.1"; MTL_VER_REGEXP="[2]\."
......@@ -330,6 +330,25 @@ do_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
}
# Actually do something!
info_pkg "deepseq" ${DEEPSEQ_VER} ${DEEPSEQ_VER_REGEXP}
......@@ -341,7 +360,6 @@ 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" ${NETWORK_VER} ${NETWORK_VER_REGEXP}
info_pkg "network-uri" ${NETWORK_URI_VER} ${NETWORK_URI_VER_REGEXP}
info_pkg "HTTP" ${HTTP_VER} ${HTTP_VER_REGEXP}
info_pkg "zlib" ${ZLIB_VER} ${ZLIB_VER_REGEXP}
info_pkg "random" ${RANDOM_VER} ${RANDOM_VER_REGEXP}
......@@ -356,12 +374,14 @@ do_pkg "mtl" ${MTL_VER} ${MTL_VER_REGEXP}
do_pkg "text" ${TEXT_VER} ${TEXT_VER_REGEXP}
do_pkg "parsec" ${PARSEC_VER} ${PARSEC_VER_REGEXP}
do_pkg "network" ${NETWORK_VER} ${NETWORK_VER_REGEXP}
do_pkg "network-uri" ${NETWORK_URI_VER} ${NETWORK_URI_VER_REGEXP}
do_pkg "HTTP" ${HTTP_VER} ${HTTP_VER_REGEXP}
do_pkg "zlib" ${ZLIB_VER} ${ZLIB_VER_REGEXP}
do_pkg "random" ${RANDOM_VER} ${RANDOM_VER_REGEXP}
do_pkg "stm" ${STM_VER} ${STM_VER_REGEXP}
# We conditionally install network-uri, depending on the network version.
do_network_uri_pkg
install_pkg "cabal-install"
# Use the newly built cabal to turn the prefix/package database into a
......
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