Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cabal-install with GHC-8.10 #6709

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .docker/validate-8.10.1.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ RUN cabal v2-install -w ghc-8.10.1 --lib \
# Validate
WORKDIR /build
COPY . /build
RUN sh ./validate.sh --lib-only -w ghc-8.10.1 -v
RUN sh ./validate.sh -w ghc-8.10.1 -v
16 changes: 11 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,21 @@ jobs:
git fetch origin $GITHUB_REF:temporary-ci-branch
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
- name: Validate print-config
run: sh validate.sh -j 2 -w ghc-8.10.1 -v --lib-only -s print-config
run: sh validate.sh -j 2 -w ghc-8.10.1 -v -s print-config
- name: Validate print-tool-versions
run: sh validate.sh -j 2 -w ghc-8.10.1 -v --lib-only -s print-tool-versions
run: sh validate.sh -j 2 -w ghc-8.10.1 -v -s print-tool-versions
- name: Validate make-cabal-install-dev
run: sh validate.sh -j 2 -w ghc-8.10.1 -v -s make-cabal-install-dev
- name: Validate build
run: sh validate.sh -j 2 -w ghc-8.10.1 -v --lib-only -s build
run: sh validate.sh -j 2 -w ghc-8.10.1 -v -s build
- name: Validate lib-tests
run: sh validate.sh -j 2 -w ghc-8.10.1 -v --lib-only -s lib-tests
run: sh validate.sh -j 2 -w ghc-8.10.1 -v -s lib-tests
- name: Validate lib-suite
run: sh validate.sh -j 2 -w ghc-8.10.1 -v --lib-only -s lib-suite
run: sh validate.sh -j 2 -w ghc-8.10.1 -v -s lib-suite
- name: Validate cli-tests
run: sh validate.sh -j 2 -w ghc-8.10.1 -v -s cli-tests
- name: Validate cli-suite
run: sh validate.sh -j 2 -w ghc-8.10.1 -v -s cli-suite
validate-8_8_3:
name: validate.sh ghc-8.8.3
runs-on: ubuntu-18.04
Expand Down
2 changes: 1 addition & 1 deletion cabal-dev-scripts/src/GenValidate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ main = do
-- this shouldn't fail (run-time errors are due bugs in zinza)
w <- run Z
{ zJobs =
[ GhcJob "8.10.1" False "--lib-only" False ["8.8.3"] libSteps -- Note: only library atm.
[ GhcJob "8.10.1" False "" False ["8.8.3"] defSteps
, GhcJob "8.8.3" False "--solver-benchmarks" False [] defSteps
, GhcJob "8.6.5" False "--complete-hackage-tests" False ["8.8.3"] defSteps
, GhcJob "8.4.4" False "" False ["8.8.3"] defSteps
Expand Down
4 changes: 2 additions & 2 deletions cabal-install/Distribution/Client/FetchUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ fetchRepoTarball verbosity' repoCtxt repo pkgid = do
verbosity = verboseUnmarkOutput verbosity'

downloadRepoPackage = case repo of
RepoLocal{..} -> return (packageFile repo pkgid)
RepoLocalNoIndex{..} -> return (packageFile repo pkgid)
RepoLocal{} -> return (packageFile repo pkgid)
RepoLocalNoIndex{} -> return (packageFile repo pkgid)

RepoRemote{..} -> do
transport <- repoContextGetTransport repoCtxt
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/IndexUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ withIndexEntries
-> ([IndexCacheEntry] -> IO a)
-> ([NoIndexCacheEntry] -> IO a)
-> IO a
withIndexEntries _ (RepoIndex repoCtxt repo@RepoSecure{..}) callback _ =
withIndexEntries _ (RepoIndex repoCtxt repo@RepoSecure{}) callback _ =
repoContextWithSecureRepo repoCtxt repo $ \repoSecure ->
Sec.withIndex repoSecure $ \Sec.IndexCallbacks{..} -> do
-- Incrementally (lazily) read all the entries in the tar file in order,
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/TargetSelector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ readTargetSelectorsWith :: (Applicative m, Monad m) => DirActions m
-> Maybe ComponentKindFilter
-> [String]
-> m (Either [TargetSelectorProblem] [TargetSelector])
readTargetSelectorsWith dirActions@DirActions{..} pkgs mfilter targetStrs =
readTargetSelectorsWith dirActions@DirActions{} pkgs mfilter targetStrs =
case parseTargetStrings targetStrs of
([], usertargets) -> do
usertargets' <- mapM (getTargetStringFileStatus dirActions) usertargets
Expand Down
4 changes: 2 additions & 2 deletions cabal-install/Distribution/Client/Update.hs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ updateRepo :: Verbosity -> UpdateFlags -> RepoContext -> Repo -> IO ()
updateRepo verbosity updateFlags repoCtxt repo = do
transport <- repoContextGetTransport repoCtxt
case repo of
RepoLocal{..} -> return ()
RepoLocalNoIndex{..} -> return ()
RepoLocal{} -> return ()
RepoLocalNoIndex{} -> return ()
RepoRemote{..} -> do
downloadResult <- downloadIndex transport verbosity repoRemote repoLocalDir
case downloadResult of
Expand Down
13 changes: 5 additions & 8 deletions cabal-install/Distribution/Client/Utils/Json.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ module Distribution.Client.Utils.Json
)
where

import Data.Char
import Data.Int
import Data.String
import Data.Word
import Data.List
import Data.Monoid
import Distribution.Client.Compat.Prelude

import Data.Char (intToDigit)

import Data.ByteString.Builder (Builder)
import qualified Data.ByteString.Builder as BB
Expand Down Expand Up @@ -135,13 +132,13 @@ encodeArrayBB :: [Value] -> Builder
encodeArrayBB [] = "[]"
encodeArrayBB jvs = BB.char8 '[' <> go jvs <> BB.char8 ']'
where
go = Data.Monoid.mconcat . intersperse (BB.char8 ',') . map encodeValueBB
go = mconcat . intersperse (BB.char8 ',') . map encodeValueBB

encodeObjectBB :: Object -> Builder
encodeObjectBB [] = "{}"
encodeObjectBB jvs = BB.char8 '{' <> go jvs <> BB.char8 '}'
where
go = Data.Monoid.mconcat . intersperse (BB.char8 ',') . map encPair
go = mconcat . intersperse (BB.char8 ',') . map encPair
encPair (l,x) = encodeStringBB l <> BB.char8 ':' <> encodeValueBB x

encodeStringBB :: String -> Builder
Expand Down
11 changes: 6 additions & 5 deletions cabal-install/Distribution/Solver/Modular/Assignment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ module Distribution.Solver.Modular.Assignment
import Prelude ()
import Distribution.Solver.Compat.Prelude hiding (pi)

import Data.Array as A
import Data.List as L
import Data.Map as M
import Data.Maybe
import qualified Data.Array as A
import qualified Data.List as L
import qualified Data.Map as M

import Data.Maybe (fromJust)

import Distribution.PackageDescription (FlagAssignment, mkFlagAssignment) -- from Cabal

Expand Down Expand Up @@ -79,7 +80,7 @@ toCPs (A pa fa sa) rdm =
-- Dependencies per package.
depp :: QPN -> [(Component, PI QPN)]
depp qpn = let v :: Vertex
v = fromJust (cvm qpn)
v = fromJust (cvm qpn) -- TODO: why this is safe?
dvs :: [(Component, Vertex)]
dvs = tg A.! v
in L.map (\ (comp, dv) -> case vm dv of (_, x, _) -> (comp, PI x (pa M.! x))) dvs
Expand Down
10 changes: 5 additions & 5 deletions cabal-install/Distribution/Solver/Modular/Builder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ module Distribution.Solver.Modular.Builder (
-- flag-guarded dependencies, we cannot introduce them immediately. Instead, we
-- store the entire dependency.

import Data.List as L
import Data.Map as M
import Data.Set as S
import Prelude hiding (sequence, mapM)
import qualified Data.List as L
import qualified Data.Map as M
import qualified Data.Set as S
import Prelude

import qualified Distribution.Solver.Modular.ConflictSet as CS
import Distribution.Solver.Modular.Dependency
Expand Down Expand Up @@ -55,7 +55,7 @@ data BuildState = BS {
}

-- | Map of available linking targets.
type LinkingState = Map (PN, I) [PackagePath]
type LinkingState = M.Map (PN, I) [PackagePath]

-- | Extend the set of open goals with the new goals listed.
--
Expand Down
6 changes: 4 additions & 2 deletions cabal-install/Distribution/Solver/Modular/Index.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ module Distribution.Solver.Modular.Index
, mkIndex
) where

import Data.List as L
import Data.Map as M
import Prelude hiding (pi)

import Data.Map (Map)
import qualified Data.List as L
import qualified Data.Map as M

import Distribution.Solver.Modular.Dependency
import Distribution.Solver.Modular.Flag
import Distribution.Solver.Modular.Package
Expand Down
8 changes: 4 additions & 4 deletions cabal-install/Distribution/Solver/Modular/IndexConversion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ module Distribution.Solver.Modular.IndexConversion
( convPIs
) where

import Data.List as L
import qualified Data.List as L
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as M
import Data.Maybe
import Data.Maybe (mapMaybe, fromMaybe, maybeToList)
import Data.Monoid as Mon
import Data.Set as S
import qualified Data.Set as S

import Distribution.Compiler
import Distribution.InstalledPackageInfo as IPI
Expand Down Expand Up @@ -307,7 +307,7 @@ flagInfo (StrongFlags strfl) =

-- | Internal package names, which should not be interpreted as true
-- dependencies.
type IPNs = Set PN
type IPNs = S.Set PN

-- | Convenience function to delete a 'Dependency' if it's
-- for a 'PN' that isn't actually real.
Expand Down
10 changes: 5 additions & 5 deletions cabal-install/Distribution/Solver/Modular/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module Distribution.Solver.Modular.Solver
, PruneAfterFirstSuccess(..)
) where

import Data.Map as M
import Data.List as L
import Data.Set as S
import qualified Data.Map as M
import qualified Data.List as L
import qualified Data.Set as S
import Distribution.Verbosity

import Distribution.Compiler (CompilerInfo)
Expand Down Expand Up @@ -91,8 +91,8 @@ solve :: SolverConfig -- ^ solver parameters
-> Index -- ^ all available packages as an index
-> PkgConfigDb -- ^ available pkg-config pkgs
-> (PN -> PackagePreferences) -- ^ preferences
-> Map PN [LabeledPackageConstraint] -- ^ global constraints
-> Set PN -- ^ global goals
-> M.Map PN [LabeledPackageConstraint] -- ^ global constraints
-> S.Set PN -- ^ global goals
-> RetryLog Message SolverFailure (Assignment, RevDepMap)
solve sc cinfo idx pkgConfigDB userPrefs userConstraints userGoals =
explorePhase $
Expand Down
5 changes: 3 additions & 2 deletions cabal-install/Distribution/Solver/Modular/Validate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ module Distribution.Solver.Modular.Validate (validateTree) where
import Control.Applicative
import Control.Monad.Reader hiding (sequence)
import Data.Function (on)
import Data.List as L
import Data.Set as S
import Data.Traversable
import Prelude hiding (sequence)

import qualified Data.List as L
import qualified Data.Set as S

import Language.Haskell.Extension (Extension, Language)

import Data.Map.Strict as M
Expand Down
4 changes: 2 additions & 2 deletions cabal-install/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ EDIT_DISTANCE_VER="0.2.2.1"; EDIT_DISTANCE_VER_REGEXP="0\.2\.2\.?"
# 0.2.2.*
ED25519_VER="0.0.5.0"; ED25519_VER_REGEXP="0\.0\.?"
# 0.0.*
HACKAGE_SECURITY_VER="0.6.0.0"; HACKAGE_SECURITY_VER_REGEXP="0\.6\."
# >= 0.7.0.0 && < 0.7
HACKAGE_SECURITY_VER="0.6.0.1"; HACKAGE_SECURITY_VER_REGEXP="0\.6\."
# >= 0.6.0.0 && < 0.7
TAR_VER="0.5.1.1"; TAR_VER_REGEXP="0\.5\.([1-9]|1[0-9]|0\.[3-9]|0\.1[0-9])\.?"
# >= 0.5.0.3 && < 0.6
DIGEST_VER="0.0.1.2"; DIGEST_REGEXP="0\.0\.(1\.[2-9]|[2-9]\.?)"
Expand Down
4 changes: 2 additions & 2 deletions cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ executable cabal
build-depends:
async >= 2.0 && < 2.3,
array >= 0.4 && < 0.6,
base >= 4.8 && < 4.14,
base >= 4.8 && < 4.15,
base16-bytestring >= 0.1.1 && < 0.2,
binary >= 0.7.3 && < 0.9,
bytestring >= 0.10.6.0 && < 0.11,
Expand All @@ -354,7 +354,7 @@ executable cabal
time >= 1.5.0.1 && < 1.10,
transformers >= 0.4.2.0 && < 0.6,
zlib >= 0.5.3 && < 0.7,
hackage-security >= 0.6.0.0 && < 0.7,
hackage-security >= 0.6.0.1 && < 0.7,
text >= 1.2.3 && < 1.3,
parsec >= 3.1.13.0 && < 3.2

Expand Down
4 changes: 2 additions & 2 deletions cabal-install/cabal-install.cabal.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
build-depends:
async >= 2.0 && < 2.3,
array >= 0.4 && < 0.6,
base >= 4.8 && < 4.14,
base >= 4.8 && < 4.15,
base16-bytestring >= 0.1.1 && < 0.2,
binary >= 0.7.3 && < 0.9,
bytestring >= 0.10.6.0 && < 0.11,
Expand All @@ -43,7 +43,7 @@
time >= 1.5.0.1 && < 1.10,
transformers >= 0.4.2.0 && < 0.6,
zlib >= 0.5.3 && < 0.7,
hackage-security >= 0.6.0.0 && < 0.7,
hackage-security >= 0.6.0.1 && < 0.7,
text >= 1.2.3 && < 1.3,
parsec >= 3.1.13.0 && < 3.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ cabal-version: >= 1.2

library
exposed-modules: Q
build-depends: base, filepath
-- we rely that filepath has filepath-tests component
build-depends: base, filepath >=1.4.0.0

executable buildable-false
main-is: Main.hs
Expand Down