Skip to content

Commit

Permalink
Merge branch 'master' into gb/extended-project-files
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Mar 31, 2022
2 parents 2496a7d + ebfd8c7 commit e562334
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 35 deletions.
8 changes: 4 additions & 4 deletions Cabal-syntax/src/Distribution/System.hs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ buildOS = classifyOS Permissive System.Info.os
-- ------------------------------------------------------------

-- | These are the known Arches: I386, X86_64, PPC, PPC64, Sparc,
-- Arm, AArch64, Mips, SH, IA64, S39, Alpha, Hppa, Rs6000, M68k,
-- Vax, and JavaScript.
-- Arm, AArch64, Mips, SH, IA64, S390, S390X, Alpha, Hppa, Rs6000,
-- M68k, Vax, and JavaScript.
--
-- The following aliases can also be used:
-- * PPC alias: powerpc
Expand All @@ -164,7 +164,7 @@ buildOS = classifyOS Permissive System.Info.os
--
data Arch = I386 | X86_64 | PPC | PPC64 | Sparc
| Arm | AArch64 | Mips | SH
| IA64 | S390
| IA64 | S390 | S390X
| Alpha | Hppa | Rs6000
| M68k | Vax
| JavaScript
Expand All @@ -178,7 +178,7 @@ instance NFData Arch where rnf = genericRnf
knownArches :: [Arch]
knownArches = [I386, X86_64, PPC, PPC64, Sparc
,Arm, AArch64, Mips, SH
,IA64, S390
,IA64, S390, S390X
,Alpha, Hppa, Rs6000
,M68k, Vax
,JavaScript]
Expand Down
2 changes: 0 additions & 2 deletions Cabal-tests/Cabal-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ test-suite hackage-tests
type: exitcode-stdio-1.0
main-is: HackageTests.hs

if os(windows)
buildable: False

hs-source-dirs: tests
build-depends:
Expand Down
7 changes: 6 additions & 1 deletion Cabal-tests/tests/HackageTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import Data.TreeDiff.Pretty (ansiWlEditExprCompact)
parseIndex :: (Monoid a, NFData a) => (FilePath -> Bool)
-> (FilePath -> B.ByteString -> IO a) -> IO a
parseIndex predicate action = do
cabalDir <- getAppUserDataDirectory "cabal"
cabalDir <- getCabalDir
configPath <- getCabalConfigPath cabalDir
cfg <- B.readFile configPath
cfgFields <- either (fail . show) pure $ Parsec.readFields cfg
Expand All @@ -74,6 +74,11 @@ parseIndex predicate action = do
tarName repo = repoCache </> repo </> "01-index.tar"
mconcat <$> traverse (parseIndex' predicate action . tarName) repos
where
getCabalDir = do
mx <- lookupEnv "CABAL_DIR"
case mx of
Just x -> return x
Nothing -> getAppUserDataDirectory "cabal"
getCabalConfigPath cabalDir = do
mx <- lookupEnv "CABAL_CONFIG"
case mx of
Expand Down
4 changes: 2 additions & 2 deletions Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ tests = testGroup "Distribution.Utils.Structured"
-- The difference is in encoding of newtypes
#if MIN_VERSION_base(4,7,0)
, testCase "GenericPackageDescription" $
md5Check (Proxy :: Proxy GenericPackageDescription) 0xafbf1cfb39ece402a2008d07f5e5ffd8
md5Check (Proxy :: Proxy GenericPackageDescription) 0x3713da01e295903b046123a7cba0fb14
, testCase "LocalBuildInfo" $
md5Check (Proxy :: Proxy LocalBuildInfo) 0xd8b4c7f04e75345f0303fe2c3093bc29
md5Check (Proxy :: Proxy LocalBuildInfo) 0xd4d0449f6db57c79b68b6e412b5f4f55
#endif
]

Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/Backpack/Id.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ computeComponentId
computeComponentId deterministic mb_ipid mb_cid pid cname mb_details =
-- show is found to be faster than intercalate and then replacement of
-- special character used in intercalating. We cannot simply hash by
-- doubly concating list, as it just flatten out the nested list, so
-- doubly concatenating list, as it just flatten out the nested list, so
-- different sources can produce same hash
let hash_suffix
| Just (dep_ipids, flags) <- mb_details
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/GetOpt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ data OptHelp = OptHelp {
-- second argument.
usageInfo :: String -- header
-> [OptDescr a] -- option descriptors
-> String -- nicely formatted decription of options
-> String -- nicely formatted description of options
usageInfo header optDescr = unlines (header : table)
where
options = flip map optDescr $ \(Option sos los ad d) ->
Expand Down
1 change: 1 addition & 0 deletions Cabal/src/Distribution/Simple/PreProcess.hs
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ platformDefines lbi =
SH -> []
IA64 -> ["ia64"]
S390 -> ["s390"]
S390X -> ["s390x"]
Alpha -> ["alpha"]
Hppa -> ["hppa"]
Rs6000 -> ["rs6000"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ qualifyDeps QO{..} (Q pp@(PackagePath ns q) pn) = go
-- dependency on R. We do not do this for the base qualifier however.
--
-- The inherited qualifier is only used for regular dependencies; for setup
-- and base deppendencies we override the existing qualifier. See #3160 for
-- and base dependencies we override the existing qualifier. See #3160 for
-- a detailed discussion.
inheritedQ :: Qualifier
inheritedQ = case q of
Expand Down
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/FileMonitor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ checkFileMonitorChanged
where
-- In fileMonitorCheckIfOnlyValueChanged mode we want to guarantee that
-- if we return MonitoredValueChanged that only the value changed.
-- We do that by checkin for file changes first. Otherwise it makes
-- We do that by checking for file changes first. Otherwise it makes
-- more sense to do the cheaper test first.
checkForChanges :: IO (Maybe (MonitorChangedReason a))
checkForChanges
Expand Down Expand Up @@ -768,7 +768,7 @@ probeMonitorStateGlobRel _ _ root dirName


return (MonitorStateGlobFiles glob mtime' children)
-- Again, we don't force a cache rewite with 'cacheChanged', but we do use
-- Again, we don't force a cache rewrite with 'cacheChanged', but we do use
-- the new mtime' if any.
where
probeMergeResult :: MergeResult (FilePath, MonitorStateFileStatus) FilePath
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/src/Distribution/Client/GlobalFlags.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ data RepoContext = RepoContext {
--
-- NOTE: It is important that we don't eagerly initialize the transport.
-- Initializing the transport is not free, and especially in contexts where
-- we don't know a-priori whether or not we need the transport (for instance
-- we don't know a priori whether or not we need the transport (for instance
-- when using cabal in "nix mode") incurring the overhead of transport
-- initialization on _every_ invocation (eg @cabal build@) is undesirable.
, repoContextGetTransport :: IO HttpTransport
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/src/Distribution/Client/HttpUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ wgetTransport prog =

-- wget doesn't support range requests.
-- so, we not only ignore range request headers,
-- but we also dispay a warning message when we see them.
-- but we also display a warning message when we see them.
let hasRangeHeader = any isRangeHeader reqHeaders
warningMsg = "the 'wget' transport currently doesn't support"
++ " range requests, which wastes network bandwidth."
Expand Down
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/IndexUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ readRepoIndex :: Verbosity -> RepoContext -> Repo -> RepoIndexState
readRepoIndex verbosity repoCtxt repo idxState =
handleNotFound $ do
when (isRepoRemote repo) $ warnIfIndexIsOld =<< getIndexFileAge repo
-- note that if this step fails due to a bad repocache, the the procedure can still succeed by reading from the existing cache, which is updated regardless.
-- note that if this step fails due to a bad repo cache, the the procedure can still succeed by reading from the existing cache, which is updated regardless.
updateRepoIndexCache verbosity (RepoIndex repoCtxt repo) `catchIO`
(\e -> warn verbosity $ "unable to update the repo index cache -- " ++ displayException e)
readPackageIndexCacheFile verbosity mkAvailablePackage
Expand Down Expand Up @@ -1086,7 +1086,7 @@ hashConsCache cache0
-- If/when we redo the binary serialisation via e.g. CBOR and we
-- are able to use incremental decoding, we may want to move the
-- hash-consing into the incremental deserialisation, or
-- alterantively even do something like
-- alternatively even do something like
-- http://cbor.schmorp.de/value-sharing
--
go _ _ [] = []
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/src/Distribution/Client/InstallPlan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ processingInvariant plan (Processing processingSet completedSet failedSet) =
-- The failed set is upwards closed, i.e. equal to its own rev dep closure
assert (failedSet == reverseClosure failedSet) $

-- All immediate reverse deps of packges that are currently processing
-- All immediate reverse deps of packages that are currently processing
-- are not currently being processed (ie not in the processing set).
assert (and [ rdeppkgid `Set.notMember` processingSet
| pkgid <- Set.toList processingSet
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/src/Distribution/Client/ProjectBuilding.hs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ rebuildTargets verbosity
createDirectoryIfMissingVerbose verbosity True distTempDirectory
traverse_ (createPackageDBIfMissing verbosity compiler progdb) packageDBsToUse

-- Before traversing the install plan, pre-emptively find all packages that
-- Before traversing the install plan, preemptively find all packages that
-- will need to be downloaded and start downloading them.
asyncDownloadPackages verbosity withRepoCtx
installPlan pkgsBuildStatus $ \downloadMap ->
Expand Down
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
-- invocation of the same `./configure` script.
-- See https://github.com/haskell/cabal/issues/4548
--
-- Moreoever, at this point in time, only non-Custom setup scripts
-- Moreover, at this point in time, only non-Custom setup scripts
-- are supported. Implementing per-component builds with
-- Custom would require us to create a new 'ElabSetup'
-- type, and teach all of the code paths how to handle it.
Expand Down Expand Up @@ -3503,7 +3503,7 @@ setupHsConfigureFlags (ReadyPackage elab@ElaboratedConfiguredPackage{..})
-- So for now, let's pass the rather harmless and idempotent
-- `-hide-all-packages` flag to all invocations (which has
-- the benefit that every GHC invocation starts with a
-- conistently well-defined clean slate) until we find a
-- consistently well-defined clean slate) until we find a
-- better way.
= Map.toList $
Map.insertWith (++) "ghc" ["-hide-all-packages"]
Expand Down
2 changes: 1 addition & 1 deletion changelog.d/pr-7349
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
synopsis: Add language extensions for GHC 9.2
pr: #7349
issues: #7312
decription: { Add support for new language extensions added in 9.2 }
description: { Add support for new language extensions added in 9.2 }
2 changes: 1 addition & 1 deletion changelog.d/pr-7407
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
synopsis: --dry-run and --only-download effect v2-configure, v2-freeze, v2-run, and v2-exec
pr: #7407
issues: #7379
decription: { v2-configure, v2-freeze, v2-run, and v2-exec now behave expectedly under the --dry-run and --only-download flags }
description: { v2-configure, v2-freeze, v2-run, and v2-exec now behave expectedly under the --dry-run and --only-download flags }
3 changes: 3 additions & 0 deletions changelog.d/pr-8065
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
synopsis: Add support for the 64-bit S390X architecture
prs: #8065
packages: Cabal, Cabal-syntax
18 changes: 7 additions & 11 deletions validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -401,18 +401,14 @@ CMD="$($CABALPLANLISTBIN Cabal-tests:test:no-thunks-test) $TESTSUITEJOBS --hide-
(cd Cabal-tests && timed $CMD) || exit 1

CMD=$($CABALPLANLISTBIN Cabal-tests:test:hackage-tests)
# hackage-tests is not buildable in windows so $CMD will be empty here
if [ "$OSTYPE" != "msys" ]; then
(cd Cabal-tests && timed $CMD read-fields) || exit 1
if $HACKAGETESTSALL; then
(cd Cabal-tests && timed $CMD parsec) || exit 1
(cd Cabal-tests && timed $CMD roundtrip) || exit 1
else
(cd Cabal-tests && timed $CMD parsec d) || exit 1
(cd Cabal-tests && timed $CMD roundtrip k) || exit 1
fi
(cd Cabal-tests && timed $CMD read-fields) || exit 1
if $HACKAGETESTSALL; then
(cd Cabal-tests && timed $CMD parsec) || exit 1
(cd Cabal-tests && timed $CMD roundtrip) || exit 1
else
(cd Cabal-tests && timed $CMD parsec d) || exit 1
(cd Cabal-tests && timed $CMD roundtrip k) || exit 1
fi

}

# Cabal cabal-testsuite
Expand Down

0 comments on commit e562334

Please sign in to comment.