From 9b93feaf3a5813ac6316a9509680a6fb364f4fc3 Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Sun, 3 Mar 2019 17:57:59 +0100 Subject: [PATCH 1/2] Bump Cabal versions from 2.5 -> 3.0 --- Cabal/Cabal.cabal | 4 ++-- Cabal/ChangeLog.md | 2 +- Cabal/Makefile | 2 +- Cabal/doc/conf.py | 2 +- appveyor.yml | 2 +- cabal-install/bootstrap.sh | 2 +- cabal-install/cabal-install.cabal | 4 ++-- cabal-install/cabal-install.cabal.pp | 6 +++--- cabal-testsuite/cabal-testsuite.cabal | 6 +++--- solver-benchmarks/solver-benchmarks.cabal | 2 +- travis-common.sh | 4 ++-- travis-deploy.sh | 2 +- validate.sh | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index 1a2794cb47e..35f47b0edf7 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -1,5 +1,6 @@ +cabal-version: >=1.10 name: Cabal -version: 2.5.0.0 +version: 3.0.0.0 copyright: 2003-2019, Cabal Development Team (see AUTHORS file) license: BSD3 license-file: LICENSE @@ -16,7 +17,6 @@ description: The Haskell Cabal is part of a larger infrastructure for distributing, organizing, and cataloging Haskell libraries and tools. category: Distribution -cabal-version: >=1.10 build-type: Simple -- If we use a new Cabal feature, this needs to be changed to Custom so -- we can bootstrap. diff --git a/Cabal/ChangeLog.md b/Cabal/ChangeLog.md index c719080da37..27c7a19722b 100644 --- a/Cabal/ChangeLog.md +++ b/Cabal/ChangeLog.md @@ -1,4 +1,4 @@ -# 2.6.0.0 (current development version) +# 3.0.0.0 (current development version) * TODO * Introduce set notation for `^>=` and `==` operators. * 'check' reports warnings for various ghc-\*-options fields separately diff --git a/Cabal/Makefile b/Cabal/Makefile index e2ce8962c47..1cd2645d258 100644 --- a/Cabal/Makefile +++ b/Cabal/Makefile @@ -1,4 +1,4 @@ -VERSION=2.5.0.0 +VERSION=3.0.0.0 #KIND=devel KIND=rc diff --git a/Cabal/doc/conf.py b/Cabal/doc/conf.py index f91c93cd61f..b64b0344b68 100644 --- a/Cabal/doc/conf.py +++ b/Cabal/doc/conf.py @@ -13,7 +13,7 @@ sys.path.insert(0, os.path.abspath('.')) import cabaldomain -version = "2.5.0.0" +version = "3.0.0.0" extensions = ['sphinx.ext.extlinks', 'sphinx.ext.todo'] diff --git a/appveyor.yml b/appveyor.yml index 94a214150cd..b68902cb490 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -45,7 +45,7 @@ build_script: - cabal %CABOPTS% new-test Cabal - appveyor-retry cabal %CABOPTS% new-build exe:cabal exe:cabal-tests --only-dependencies - cabal %CABOPTS% new-build exe:cabal - - cabal %CABOPTS% new-run cabal-tests -- -j3 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.0.2\cabal-install-2.5.0.0\x\cabal\build\cabal\cabal.exe + - cabal %CABOPTS% new-run cabal-tests -- -j3 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.0.2\cabal-install-3.0.0.0\x\cabal\build\cabal\cabal.exe - appveyor-retry cabal %CABOPTS% new-build cabal-install:tests --only-dependencies - cd cabal-install - cabal %CABOPTS% new-run cabal-install:memory-usage-tests diff --git a/cabal-install/bootstrap.sh b/cabal-install/bootstrap.sh index 3d1f517550f..79ae0d5a0cb 100755 --- a/cabal-install/bootstrap.sh +++ b/cabal-install/bootstrap.sh @@ -224,7 +224,7 @@ 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.7.0.0"; NETWORK_VER_REGEXP="2\.[0-7]\." # >= 2.0 && < 2.7 -CABAL_VER="2.5.0.0"; CABAL_VER_REGEXP="2\.5\.[0-9]" +CABAL_VER="3.0.0.0"; CABAL_VER_REGEXP="3\.0\.[0-9]" # >= 2.5 && < 2.6 TRANS_VER="0.5.5.0"; TRANS_VER_REGEXP="0\.[45]\." # >= 0.2.* && < 0.6 diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index b457359e464..cd80b7f695b 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -4,7 +4,7 @@ Cabal-Version: >= 1.10 -- To update this file, edit 'cabal-install.cabal.pp' and run -- 'make cabal-install-prod' in the project's root folder. Name: cabal-install -Version: 2.5.0.0 +Version: 3.0.0.0 Synopsis: The command-line interface for Cabal and Hackage. Description: The \'cabal\' command-line program simplifies the process of managing @@ -311,7 +311,7 @@ executable cabal base16-bytestring >= 0.1.1 && < 0.2, binary >= 0.7.3 && < 0.9, bytestring >= 0.10.6.0 && < 0.11, - Cabal == 2.5.*, + Cabal == 3.0.*, containers >= 0.5.6.2 && < 0.7, cryptohash-sha256 >= 0.11 && < 0.12, deepseq >= 1.4.1.1 && < 1.5, diff --git a/cabal-install/cabal-install.cabal.pp b/cabal-install/cabal-install.cabal.pp index f2deaa2d92f..e452bbc23a4 100644 --- a/cabal-install/cabal-install.cabal.pp +++ b/cabal-install/cabal-install.cabal.pp @@ -10,7 +10,7 @@ -- To update this file, edit 'cabal-install.cabal.pp' and run -- 'make cabal-install-prod' in the project's root folder. Name: cabal-install -Version: 2.5.0.0 +Version: 3.0.0.0 # # NOTE: when updating build-depends, don't forget to update version regexps in bootstrap.sh. # @@ -22,7 +22,7 @@ base16-bytestring >= 0.1.1 && < 0.2, binary >= 0.7.3 && < 0.9, bytestring >= 0.10.6.0 && < 0.11, - Cabal == 2.5.*, + Cabal == 3.0.*, containers >= 0.5.6.2 && < 0.7, cryptohash-sha256 >= 0.11 && < 0.12, deepseq >= 1.4.1.1 && < 1.5, @@ -472,7 +472,7 @@ cpp-options: -DMONOLITHIC build-depends: - Cabal == 2.5.*, + Cabal == 3.0.*, cabal-install-solver-dsl, QuickCheck >= 2.8.2, array, diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index 455cc63b223..223c0c697ec 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -1,5 +1,5 @@ name: cabal-testsuite -version: 2.5.0.0 +version: 3.0.0.0 copyright: 2003-2019, Cabal Development Team (see AUTHORS file) license: BSD3 license-file: LICENSE @@ -64,7 +64,7 @@ executable cabal-tests build-depends: async, base, - Cabal == 2.5.0.0, + Cabal == 3.0.0.0, clock, filepath, process, @@ -81,5 +81,5 @@ custom-setup -- lib:Cabal dependency, and some stable lib:Cabal version for its -- custom-setup's one (due to 'setupMaxCabalVersionConstraint' in -- 'D.C.ProjectPlanning'). - setup-depends: Cabal == 2.5.0.0, + setup-depends: Cabal == 3.0.0.0, base diff --git a/solver-benchmarks/solver-benchmarks.cabal b/solver-benchmarks/solver-benchmarks.cabal index cff94a0734f..d3175488d20 100644 --- a/solver-benchmarks/solver-benchmarks.cabal +++ b/solver-benchmarks/solver-benchmarks.cabal @@ -1,5 +1,5 @@ name: solver-benchmarks -version: 2.5.0.0 +version: 3.0.0.0 copyright: 2003-2017, Cabal Development Team (see AUTHORS file) license: BSD3 license-file: LICENSE diff --git a/travis-common.sh b/travis-common.sh index 971a6f5b966..d6fe02c5acd 100644 --- a/travis-common.sh +++ b/travis-common.sh @@ -1,8 +1,8 @@ set -e HACKAGE_REPO_TOOL_VERSION="0.1.1.1" -CABAL_VERSION="2.5.0.0" -CABAL_INSTALL_VERSION="2.5.0.0" +CABAL_VERSION="3.0.0.0" +CABAL_INSTALL_VERSION="3.0.0.0" if [ "$TRAVIS_OS_NAME" = "linux" ]; then ARCH="x86_64-linux" diff --git a/travis-deploy.sh b/travis-deploy.sh index 26be19a686f..88d7ddbbb9b 100755 --- a/travis-deploy.sh +++ b/travis-deploy.sh @@ -8,7 +8,7 @@ deploy() { (cd cabal-website && git checkout --track -b gh-pages origin/gh-pages) rm -rf cabal-website/doc mkdir -p cabal-website/doc/html - mv dist-newstyle/build/`uname -m`-$TRAVIS_OS_NAME/ghc-$GHCVER/Cabal-2.5.0.0/doc/html/Cabal \ + mv dist-newstyle/build/`uname -m`-$TRAVIS_OS_NAME/ghc-$GHCVER/Cabal-3.0.0.0/doc/html/Cabal \ cabal-website/doc/html/Cabal (cd cabal-website && git add --all .) (cd cabal-website && \ diff --git a/validate.sh b/validate.sh index 1382950ad54..6e6353c63b2 100755 --- a/validate.sh +++ b/validate.sh @@ -177,7 +177,7 @@ timed $CABALPLAN --version ####################################################################### # NOTE: This should match cabal-testsuite version -CABAL_VERSION="2.5.0.0" +CABAL_VERSION="3.0.0.0" if [ "$(uname)" = "Linux" ]; then ARCH="x86_64-linux" From 66b9936efaae4d9cbe34f00ee8e41e5e21860576 Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Wed, 6 Mar 2019 21:40:21 +0100 Subject: [PATCH 2/2] Decouple lib:Cabal version used by custom-setup from the lib component This might require more refinement in future and is a first iteration trying to address #5916 --- cabal-testsuite/Setup.hs | 84 ++++++++++++++++++-- cabal-testsuite/Setup.simple.hs | 6 ++ cabal-testsuite/Test/Cabal/Monad.hs | 18 ++--- cabal-testsuite/Test/Cabal/Script.hs | 37 ++++----- cabal-testsuite/cabal-testsuite.cabal | 107 +++++++++++++++----------- cabal-testsuite/main/cabal-tests.hs | 5 +- 6 files changed, 170 insertions(+), 87 deletions(-) create mode 100644 cabal-testsuite/Setup.simple.hs diff --git a/cabal-testsuite/Setup.hs b/cabal-testsuite/Setup.hs index 590d1336d2c..e43a9cd7f36 100644 --- a/cabal-testsuite/Setup.hs +++ b/cabal-testsuite/Setup.hs @@ -1,10 +1,78 @@ +{-# LANGUAGE Haskell2010 #-} +module Main (main) where + +import Distribution.Backpack import Distribution.Simple +import Distribution.Simple.BuildPaths +import Distribution.Simple.LocalBuildInfo +import Distribution.Simple.Setup +import Distribution.Simple.Utils +import Distribution.Types.LocalBuildInfo +import Distribution.Types.ModuleRenaming +import Distribution.Types.UnqualComponentName + +import System.Directory +import System.FilePath + main :: IO () -main = defaultMain - --- Although this looks like the Simple build type, it is in fact vital that --- we use this Setup.hs because we need to compile against the very same --- version of the Cabal library that the test suite will be compiled --- against. When this happens, it will mean that we'll be able to --- read the LocalBuildInfo of our build environment, which we will --- subsequently use to make decisions about PATHs etc. Important! +main = defaultMainWithHooks simpleUserHooks + { buildHook = \pkg lbi hooks flags -> do + generateScriptEnvModule lbi flags + buildHook simpleUserHooks pkg lbi hooks flags + } + +generateScriptEnvModule :: LocalBuildInfo -> BuildFlags -> IO () +generateScriptEnvModule lbi flags = do + lbiPackageDbStack <- mapM canonicalizePackageDB (withPackageDB lbi) + + createDirectoryIfMissing True moduledir + rewriteFileEx verbosity (moduledir "ScriptEnv0.hs") $ unlines + [ "module Test.Cabal.ScriptEnv0 where" + , "" + , "import Distribution.Simple" + , "import Distribution.System (Platform(..), Arch(..), OS(..))" + , "import Distribution.Types.ModuleRenaming" + , "import Distribution.Simple.Program.Db" + , "import Distribution.Backpack (OpenUnitId)" + , "import Data.Map (fromList)" + , "" + , "lbiPackageDbStack :: PackageDBStack" + , "lbiPackageDbStack = " ++ show lbiPackageDbStack + , "" + , "lbiPlatform :: Platform" + , "lbiPlatform = " ++ show (hostPlatform lbi) + , "" + , "lbiCompiler :: Compiler" + , "lbiCompiler = " ++ show (compiler lbi) + , "" + , "lbiPackages :: [(OpenUnitId, ModuleRenaming)]" + , "lbiPackages = read " ++ show (show (cabalTestsPackages lbi)) + , "" + , "lbiProgramDb :: ProgramDb" + , "lbiProgramDb = read " ++ show (show (withPrograms lbi)) + , "" + , "lbiWithSharedLib :: Bool" + , "lbiWithSharedLib = " ++ show (withSharedLib lbi) + ] + where + verbosity = fromFlagOrDefault minBound (buildVerbosity flags) + moduledir = libAutogenDir "Test" "Cabal" + -- fixme: use component-specific folder + libAutogenDir = autogenPackageModulesDir lbi + +-- | Convert package database into absolute path, so that +-- if we change working directories in a subprocess we get the correct database. +canonicalizePackageDB :: PackageDB -> IO PackageDB +canonicalizePackageDB (SpecificPackageDB path) + = SpecificPackageDB `fmap` canonicalizePath path +canonicalizePackageDB x = return x + +-- | Compute the set of @-package-id@ flags which would be passed when +-- building the public library. Assumes that the public library is +-- non-Backpack. +cabalTestsPackages :: LocalBuildInfo -> [(OpenUnitId, ModuleRenaming)] +cabalTestsPackages lbi = + case componentNameCLBIs lbi (CExeName (mkUnqualComponentName "cabal-tests")) of + [clbi] -> -- [ (unUnitId $ unDefUnitId duid,rn) | (DefiniteUnitId duid, rn) <- componentIncludes clbi ] + componentIncludes clbi + _ -> error "cabalTestsPackages" diff --git a/cabal-testsuite/Setup.simple.hs b/cabal-testsuite/Setup.simple.hs new file mode 100644 index 00000000000..6fa548caf71 --- /dev/null +++ b/cabal-testsuite/Setup.simple.hs @@ -0,0 +1,6 @@ +module Main (main) where + +import Distribution.Simple + +main :: IO () +main = defaultMain diff --git a/cabal-testsuite/Test/Cabal/Monad.hs b/cabal-testsuite/Test/Cabal/Monad.hs index 07e070a1c45..d57dda559d7 100644 --- a/cabal-testsuite/Test/Cabal/Monad.hs +++ b/cabal-testsuite/Test/Cabal/Monad.hs @@ -66,8 +66,7 @@ import Distribution.System import Distribution.Simple.Program.Db import Distribution.Simple.Program import Distribution.Simple.Configure - ( getPersistBuildConfig, configCompilerEx ) -import Distribution.Types.LocalBuildInfo + ( configCompilerEx ) import Distribution.Version import Distribution.Text import Distribution.Package @@ -240,20 +239,19 @@ runTestM mode m = withSystemTempDirectory "cabal-testsuite" $ \tmp_dir -> do script_base = dropExtensions script_filename -- Canonicalize this so that it is stable across working directory changes script_dir <- canonicalizePath script_dir0 - lbi <- getPersistBuildConfig dist_dir let verbosity = normal -- TODO: configurable - senv <- mkScriptEnv verbosity lbi + senv <- mkScriptEnv verbosity -- Add test suite specific programs let program_db0 = addKnownPrograms ([gitProgram, hackageRepoToolProgram, cabalProgram, diffProgram] ++ builtinPrograms) - (withPrograms lbi) + (runnerProgramDb senv) -- Reconfigure according to user flags let cargs = testCommonArgs args -- Reconfigure GHC (comp, platform, program_db2) <- case argGhcPath cargs of - Nothing -> return (compiler lbi, hostPlatform lbi, program_db0) + Nothing -> return (runnerCompiler senv, runnerPlatform senv, program_db0) Just ghc_path -> do -- All the things that get updated paths from -- configCompilerEx. The point is to make sure @@ -274,7 +272,7 @@ runTestM mode m = withSystemTempDirectory "cabal-testsuite" $ \tmp_dir -> do -- we don't pay for things we don't need. A bit difficult -- to do in the current design. configCompilerEx - (Just (compilerFlavor (compiler lbi))) + (Just (compilerFlavor (runnerCompiler senv))) (Just ghc_path) Nothing program_db1 @@ -294,7 +292,7 @@ runTestM mode m = withSystemTempDirectory "cabal-testsuite" $ \tmp_dir -> do let db_stack = case argGhcPath (testCommonArgs args) of - Nothing -> withPackageDB lbi + Nothing -> runnerPackageDbStack senv -- NB: canonicalized -- Can't use the build package db stack since they -- are all for the wrong versions! TODO: Make -- this configurable @@ -311,9 +309,9 @@ runTestM mode m = withSystemTempDirectory "cabal-testsuite" $ \tmp_dir -> do testVerbosity = verbosity, testMtimeChangeDelay = Nothing, testScriptEnv = senv, - testSetupPath = dist_dir "setup" "setup", + testSetupPath = dist_dir "build" "setup" "setup", testSkipSetupTests = argSkipSetupTests (testCommonArgs args), - testHaveCabalShared = withSharedLib lbi, + testHaveCabalShared = runnerWithSharedLib senv, testEnvironment = -- Try to avoid Unicode output [ ("LC_ALL", Just "C") diff --git a/cabal-testsuite/Test/Cabal/Script.hs b/cabal-testsuite/Test/Cabal/Script.hs index 7305527e0eb..7cbf68afc53 100644 --- a/cabal-testsuite/Test/Cabal/Script.hs +++ b/cabal-testsuite/Test/Cabal/Script.hs @@ -9,13 +9,10 @@ module Test.Cabal.Script ( ) where import Test.Cabal.Run +import Test.Cabal.ScriptEnv0 import Distribution.Backpack import Distribution.Types.ModuleRenaming -import Distribution.Types.LocalBuildInfo -import Distribution.Types.ComponentLocalBuildInfo -import Distribution.Types.ComponentName -import Distribution.Types.UnqualComponentName import Distribution.Utils.NubList import Distribution.Simple.Program.Db import Distribution.Simple.Program.Builtin @@ -26,9 +23,9 @@ import Distribution.Verbosity import Distribution.System import Distribution.Simple.Setup (Flag(..)) -import System.Directory import qualified Data.Monoid as M + -- | The runner environment, which contains all of the important -- parameters for invoking GHC. Mostly subset of 'LocalBuildInfo'. data ScriptEnv = ScriptEnv @@ -38,8 +35,11 @@ data ScriptEnv = ScriptEnv , runnerPlatform :: Platform , runnerCompiler :: Compiler , runnerPackages :: [(OpenUnitId, ModuleRenaming)] + , runnerWithSharedLib :: Bool } +{- + -- | Convert package database into absolute path, so that -- if we change working directories in a subprocess we get the correct database. canonicalizePackageDB :: PackageDB -> IO PackageDB @@ -47,31 +47,24 @@ canonicalizePackageDB (SpecificPackageDB path) = SpecificPackageDB `fmap` canonicalizePath path canonicalizePackageDB x = return x +-} + -- | Create a 'ScriptEnv' from a 'LocalBuildInfo' configured with -- the GHC that we want to use. -mkScriptEnv :: Verbosity -> LocalBuildInfo -> IO ScriptEnv -mkScriptEnv verbosity lbi = do - package_db <- mapM canonicalizePackageDB (withPackageDB lbi) +mkScriptEnv :: Verbosity -> IO ScriptEnv +mkScriptEnv verbosity = return $ ScriptEnv { runnerVerbosity = verbosity - , runnerProgramDb = withPrograms lbi - , runnerPackageDbStack = package_db - , runnerPlatform = hostPlatform lbi - , runnerCompiler = compiler lbi + , runnerProgramDb = lbiProgramDb + , runnerPackageDbStack = lbiPackageDbStack + , runnerPlatform = lbiPlatform + , runnerCompiler = lbiCompiler -- NB: the set of packages available to test.hs scripts will COINCIDE -- with the dependencies on the cabal-testsuite library - , runnerPackages = cabalTestsPackages lbi + , runnerPackages = lbiPackages + , runnerWithSharedLib = lbiWithSharedLib } --- | Compute the set of @-package-id@ flags which would be passed when --- building the public library. Assumes that the public library is --- non-Backpack. -cabalTestsPackages :: LocalBuildInfo -> [(OpenUnitId, ModuleRenaming)] -cabalTestsPackages lbi = - case componentNameCLBIs lbi (CExeName (mkUnqualComponentName "cabal-tests")) of - [clbi] -> componentIncludes clbi - _ -> error "cabalTestsPackages" - -- | Run a script with 'runghc', under the 'ScriptEnv'. runghc :: ScriptEnv -> Maybe FilePath -> [(String, Maybe String)] -> FilePath -> [String] -> IO Result diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index 223c0c697ec..166abd2f3da 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -1,7 +1,8 @@ +cabal-version: 2.2 name: cabal-testsuite version: 3.0.0.0 copyright: 2003-2019, Cabal Development Team (see AUTHORS file) -license: BSD3 +license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team maintainer: cabal-devel@haskell.org @@ -11,7 +12,6 @@ synopsis: Test suite for Cabal and cabal-install description: This package defines a shared test suite for Cabal and cabal-install. category: Distribution -cabal-version: >=1.10 build-type: Custom extra-source-files: @@ -22,7 +22,19 @@ source-repository head location: https://github.com/haskell/cabal/ subdir: cabal-testsuite +common shared + default-language: Haskell2010 + + build-depends: + , base >= 4.6 && <4.13 + -- this needs to match the in-tree lib:Cabal version + , Cabal == 3.0.0.0 + + ghc-options: -Wall -fwarn-tabs + library + import: shared + exposed-modules: Test.Cabal.Workdir Test.Cabal.Script @@ -32,54 +44,63 @@ library Test.Cabal.Server Test.Cabal.Monad Test.Cabal.CheckArMetadata + + other-modules: + Test.Cabal.ScriptEnv0 + autogen-modules: + Test.Cabal.ScriptEnv0 + build-depends: - aeson ==1.4.*, - attoparsec, - async, - base, - bytestring, - transformers, - optparse-applicative >=0.14 && <0.15, - process, - directory, - filepath, - regex-compat-tdfa, - regex-tdfa, - temporary, - text, - cryptohash-sha256, - base16-bytestring, - Cabal >= 2.3 - ghc-options: -Wall -fwarn-tabs + , aeson ^>= 1.4.2.0 + , async ^>= 2.2.1 + , attoparsec ^>= 0.13.2.2 + , base16-bytestring ^>= 0.1.1.6 + , bytestring ^>= 0.10.0.2 + , containers ^>= 0.5.0.0 || ^>= 0.6.0.1 + , cryptohash-sha256 ^>= 0.11.101.0 + , directory ^>= 1.2.0.1 || ^>= 1.3.0.0 + , exceptions ^>= 0.10.0 + , filepath ^>= 1.3.0.1 || ^>= 1.4.0.0 + , optparse-applicative ^>= 0.14.3.0 + , process ^>= 1.1.0.2 || ^>= 1.2.0.0 || ^>= 1.4.2.0 || ^>= 1.6.1.0 + , regex-compat-tdfa ^>= 0.95.1.4 + , regex-tdfa ^>= 1.2.3.1 + , temporary ^>= 1.3 + , text ^>= 1.2.3.1 + , transformers ^>= 0.3.0.0 || ^>= 0.4.2.0 || ^>= 0.5.2.0 + if !os(windows) - build-depends: unix, exceptions + build-depends: + , unix ^>= 2.6.0.0 || ^>= 2.7.0.0 else - build-depends: Win32 - default-language: Haskell2010 + build-depends: + , Win32 executable cabal-tests + import: shared main-is: cabal-tests.hs hs-source-dirs: main - ghc-options: -threaded -Wall -fwarn-tabs + ghc-options: -threaded build-depends: - async, - base, - Cabal == 3.0.0.0, - clock, - filepath, - process, - optparse-applicative, - cabal-testsuite, - transformers, - exceptions - default-language: Haskell2010 + , cabal-testsuite + -- cosntraints inherited via lib:cabal-testsuite component + , async + , exceptions + , filepath + , optparse-applicative + , process + , transformers + -- dependencies specific to exe:cabal-tests + , clock ^>= 0.7.2 + + build-tool-depends: cabal-testsuite:setup + +-- this executable is needed by lib:cabal-testsuite +executable setup + import: shared + main-is: Setup.simple.hs custom-setup - -- It's important that we pick the exact same version of lib:Cabal - -- both here and for cabal-tests itself. Without this constraint, - -- the solver would pick the in-tree Cabal for cabal-tests's - -- lib:Cabal dependency, and some stable lib:Cabal version for its - -- custom-setup's one (due to 'setupMaxCabalVersionConstraint' in - -- 'D.C.ProjectPlanning'). - setup-depends: Cabal == 3.0.0.0, - base + -- we only depend on even stable releases of lib:Cabal + setup-depends: Cabal == 2.2.* || == 2.4.* || == 3.0.*, + base, filepath, directory diff --git a/cabal-testsuite/main/cabal-tests.hs b/cabal-testsuite/main/cabal-tests.hs index e3424f542a1..3a779d13530 100644 --- a/cabal-testsuite/main/cabal-tests.hs +++ b/cabal-testsuite/main/cabal-tests.hs @@ -9,7 +9,6 @@ import Test.Cabal.Server import Test.Cabal.Monad import Distribution.Verbosity (normal, verbose, Verbosity) -import Distribution.Simple.Configure (getPersistBuildConfig) import Distribution.Simple.Utils (getDirectoryContentsRecursive) import Options.Applicative @@ -110,10 +109,8 @@ main = do Nothing -> guessDistDir when (verbosity >= verbose) $ hPutStrLn stderr $ "Using dist dir: " ++ dist_dir - lbi <- getPersistBuildConfig dist_dir - -- Get ready to go! - senv <- mkScriptEnv verbosity lbi + senv <- mkScriptEnv verbosity let runTest runner path = runner Nothing [] path $ ["--builddir", dist_dir, path] ++ renderCommonArgs (mainCommonArgs args)