Skip to content

Commit

Permalink
Merge branch 'master' into outdated-3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 7, 2024
2 parents 7788026 + 1eb0bb2 commit 81db6b3
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 38 deletions.
2 changes: 2 additions & 0 deletions Cabal-syntax/src/Language/Haskell/Extension.hs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ data KnownExtension
| -- | Allow the use of built-in syntax for list, tuple and sum type constructors
-- rather than being exclusive to data constructors.
ListTuplePuns
| -- | Support multiline strings
MultilineStrings
deriving (Generic, Show, Read, Eq, Ord, Enum, Bounded, Typeable, Data)

instance Binary KnownExtension
Expand Down
8 changes: 4 additions & 4 deletions Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int
md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion
md5CheckGenericPackageDescription proxy = md5Check proxy
#if MIN_VERSION_base(4,19,0)
0x3da8883a286b8fbfd9f94790d57cc06e
0x62ad178a75f041af29947c9b3d83e6ed
#else
0x245e544da05f50f9dd0339a96ac99860
0xba8f0baa8074fd238ad36a309399349e
#endif

md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion
md5CheckLocalBuildInfo proxy = md5Check proxy
#if MIN_VERSION_base(4,19,0)
0x7683c2daece12ba7982e80f860454f47
0xc68e9c0758c4bf2d72fe82b3d55cee34
#else
0xe694b39b10bc861f47ea9c7b926a422a
0xcf7e7bbcaec504d745fe086eec1786ff
#endif
10 changes: 5 additions & 5 deletions Cabal/src/Distribution/Simple/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,20 @@ data ConfigStateFileError
dispConfigStateFileError :: ConfigStateFileError -> Doc
dispConfigStateFileError ConfigStateFileNoHeader =
text "Saved package config file header is missing."
<+> text "Re-run the 'configure' command."
<+> text "Re-run the 'Setup configure' command."
dispConfigStateFileError ConfigStateFileBadHeader =
text "Saved package config file header is corrupt."
<+> text "Re-run the 'configure' command."
<+> text "Re-run the 'Setup configure' command."
dispConfigStateFileError ConfigStateFileNoParse =
text "Saved package config file is corrupt."
<+> text "Re-run the 'configure' command."
<+> text "Re-run the 'Setup configure' command."
dispConfigStateFileError ConfigStateFileMissing{} =
text "Run the 'configure' command first."
text "Run the 'Setup configure' command first."
dispConfigStateFileError (ConfigStateFileBadVersion oldCabal oldCompiler _) =
text "Saved package config file is outdated:"
$+$ badCabal
$+$ badCompiler
$+$ text "Re-run the 'configure' command."
$+$ text "Re-run the 'Setup configure' command."
where
badCabal =
text "• the Cabal version changed from"
Expand Down
49 changes: 24 additions & 25 deletions Cabal/src/Distribution/Simple/Errors.hs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ versionRequirement range
exceptionMessage :: CabalException -> String
exceptionMessage e = case e of
NoBenchMarkProgram cmd -> "Could not find benchmark program \"" ++ cmd ++ "\". Did you build the package first?"
EnableBenchMark -> "No benchmarks enabled. Did you remember to configure with " ++ "\'--enable-benchmarks\'?"
EnableBenchMark -> "No benchmarks enabled. Did you remember to \'Setup configure\' with " ++ "\'--enable-benchmarks\'?"
BenchMarkNameDisabled bmName -> "Package configured with benchmark " ++ bmName ++ " disabled."
NoBenchMark bmName -> "no such benchmark: " ++ bmName
NoLibraryFound -> "No executables and no library found. Nothing to do."
Expand All @@ -331,8 +331,8 @@ exceptionMessage e = case e of
++ ".\n"
++ "If the module "
++ "is autogenerated it should be added to 'autogen-modules'."
RegMultipleInstancePkg -> "HcPkg.register: the compiler does not support,registering multiple instances of packages."
SuppressingChecksOnFile -> "HcPkg.register: the compiler does not support ,suppressing checks on files."
RegMultipleInstancePkg -> "HcPkg.register: the compiler does not support registering multiple instances of packages."
SuppressingChecksOnFile -> "HcPkg.register: the compiler does not support suppressing checks on files."
NoSupportDirStylePackageDb -> "HcPkg.writeRegistrationFileDirectly: compiler does not support dir style package dbs"
OnlySupportSpecificPackageDb -> "HcPkg.writeRegistrationFileDirectly: only supports SpecificPackageDB for now"
FailedToParseOutputDescribe programId pkgId -> "failed to parse output of '" ++ programId ++ " describe " ++ prettyShow pkgId ++ "'"
Expand All @@ -353,7 +353,7 @@ exceptionMessage e = case e of
++ " but "
++ "haddock is using GHC version "
++ prettyShow haddockGhcVersion
MustHaveSharedLibraries -> "Must have vanilla or shared libraries " ++ "enabled in order to run haddock"
MustHaveSharedLibraries -> "Must have vanilla or shared libraries enabled in order to run haddock"
HaddockPackageFlags inf ->
"internal error when calculating transitive "
++ "package dependencies.\nDebug info: "
Expand Down Expand Up @@ -391,7 +391,7 @@ exceptionMessage e = case e of
GlobalPackageDBLimitation ->
"With current ghc versions the global package db is always used "
++ "and must be listed first. This ghc limitation may be lifted in "
++ "future, see https://gitlab.haskell.org/ghc/ghc/-/issues/5977"
++ "the future, see https://gitlab.haskell.org/ghc/ghc/-/issues/5977"
GlobalPackageDBSpecifiedFirst ->
"If the global package db is specified, it must be "
++ "specified first and cannot be specified multiple times"
Expand Down Expand Up @@ -487,8 +487,7 @@ exceptionMessage e = case e of
++ "suite type "
++ prettyShow tt
NoSupportForPreProcessingBenchmark tt ->
"No support for preprocessing benchmark "
++ "type "
"No support for preprocessing benchmark type "
++ prettyShow tt
CantFindSourceForPreProcessFile errorStr -> errorStr
NoSupportPreProcessingTestExtras tt ->
Expand All @@ -511,11 +510,11 @@ exceptionMessage e = case e of
SanityCheckHookedBuildInfo exe1 ->
"The buildinfo contains info for an executable called '"
++ prettyShow exe1
++ "' but the package does not have a "
++ "' but the package does not have an "
++ "executable with that name."
ConfigureScriptNotFound fp -> "configure script not found at " ++ fp ++ "."
NoValidComponent -> "No valid component targets found"
ConfigureEitherSingleOrAll -> "Can only configure either single component or all of them"
ConfigureEitherSingleOrAll -> "Can only configure either a single component or all of them"
ConfigCIDValidForPreComponent -> "--cid is only supported for per-component configure"
SanityCheckForEnableComponents ->
"--enable-tests/--enable-benchmarks are incompatible with"
Expand All @@ -525,23 +524,23 @@ exceptionMessage e = case e of
++ " are incompatible with each other."
UnsupportedLanguages pkgId compilerId langs ->
"The package "
++ prettyShow (pkgId)
++ prettyShow pkgId
++ " requires the following languages which are not "
++ "supported by "
++ prettyShow (compilerId)
++ prettyShow compilerId
++ ": "
++ intercalate ", " langs
UnsupportedLanguageExtension pkgId compilerId exts ->
"The package "
++ prettyShow (pkgId)
++ prettyShow pkgId
++ " requires the following language extensions which are not "
++ "supported by "
++ prettyShow (compilerId)
++ prettyShow compilerId
++ ": "
++ intercalate ", " exts
CantFindForeignLibraries unsupportedFLibs ->
"Cannot build some foreign libraries: "
++ intercalate "," unsupportedFLibs
++ intercalate ", " unsupportedFLibs
ExpectedAbsoluteDirectory fPath -> "expected an absolute directory name for --prefix: " ++ fPath
FlagsNotSpecified diffFlags ->
"'--exact-configuration' was given, "
Expand Down Expand Up @@ -572,7 +571,7 @@ exceptionMessage e = case e of
++ "' refers to a library which is defined within the same "
++ "package. To use this feature the package must specify at "
++ "least 'cabal-version: >= 1.8'."
ReportFailedDependencies failed hackageUrl -> (intercalate "\n\n" (map reportFailedDependency failed))
ReportFailedDependencies failed hackageUrl -> intercalate "\n\n" (map reportFailedDependency failed)
where
reportFailedDependency (DependencyNotExists pkgname) =
"there is no version of "
Expand Down Expand Up @@ -617,7 +616,7 @@ exceptionMessage e = case e of
NoWorkingGcc ->
unlines
[ "No working gcc"
, "This package depends on foreign library but we cannot "
, "This package depends on a foreign library but we cannot "
++ "find a working C compiler. If you have it in a "
++ "non-standard location you can use the --with-gcc "
++ "flag to specify it."
Expand Down Expand Up @@ -674,8 +673,8 @@ exceptionMessage e = case e of
++ "where it is."
++ "If the library file does exist, it may contain errors that "
++ "are caught by the C compiler at the preprocessing stage. "
++ "In this case you can re-run configure with the verbosity "
++ "flag -v3 to see the error messages."
++ "In this case you can re-run 'Setup configure' with the "
++ "verbosity flag -v3 to see the error messages."
messagePlural =
"This problem can usually be solved by installing the system "
++ "packages that provide these libraries (you may need the "
Expand All @@ -685,18 +684,18 @@ exceptionMessage e = case e of
++ "where they are."
++ "If the library files do exist, it may contain errors that "
++ "are caught by the C compiler at the preprocessing stage. "
++ "In this case you can re-run configure with the verbosity "
++ "flag -v3 to see the error messages."
++ "In this case you can re-run 'Setup configure' with the "
++ "verbosity flag -v3 to see the error messages."
headerCppMessage =
"If the header file does exist, it may contain errors that "
++ "are caught by the C compiler at the preprocessing stage. "
++ "In this case you can re-run configure with the verbosity "
++ "flag -v3 to see the error messages."
++ "In this case you can re-run 'Setup configure' with the "
++ "verbosity flag -v3 to see the error messages."
headerCcMessage =
"The header file contains a compile error. "
++ "You can re-run configure with the verbosity flag "
++ "You can re-run 'Setup configure' with the verbosity flag "
++ "-v3 to see the error messages from the C compiler."
CheckPackageProblems errors -> (intercalate "\n\n" $ errors)
CheckPackageProblems errors -> intercalate "\n\n" errors
LibDirDepsPrefixNotRelative l p ->
"Library directory of a dependency: "
++ show l
Expand Down Expand Up @@ -757,7 +756,7 @@ exceptionMessage e = case e of
RegisMultiplePkgNotSupported -> "Registering multiple package instances is not yet supported for this compiler"
RegisteringNotImplemented -> "Registering is not implemented for this compiler"
NoTestSuitesEnabled ->
"No test suites enabled. Did you remember to configure with "
"No test suites enabled. Did you remember to 'Setup configure' with "
++ "\'--enable-tests\'?"
TestNameDisabled tName ->
"Package configured with test suite "
Expand Down
4 changes: 2 additions & 2 deletions cabal-install-solver/cabal-install-solver.cabal
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cabal-version: 2.2
name: cabal-install-solver
version: 3.13.0.0
synopsis: The command-line interface for Cabal and Hackage.
synopsis: The solver component of cabal-install
description:
The solver component used in cabal-install command-line program
The solver component used in the cabal-install command-line program.

homepage: http://www.haskell.org/cabal/
bug-reports: https://github.com/haskell/cabal/issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ data ConstraintSource =
-- from Cabal >= 3.11
| ConstraintSourceMultiRepl

| ConstraintSourceProfiledDynamic
-- | Constraint introduced by --enable-profiling-shared, which requires features
-- from Cabal >= 3.13
| ConstraintSourceProfiledDynamic

-- | The source of the constraint is not specified.
| ConstraintSourceUnknown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,20 @@ import UnitTests.Distribution.Solver.Modular.QuickCheck.Utils

tests :: [TestTree]
tests =
[ -- This test checks that certain solver parameters do not affect the
[ testPropertyWithSeed "solver does not throw exceptions" $
\test goalOrder reorderGoals indepGoals prefOldest ->
let r =
solve
(EnableBackjumping True)
(FineGrainedConflicts True)
reorderGoals
(CountConflicts True)
indepGoals
prefOldest
(getBlind <$> goalOrder)
test
in resultPlan r `seq` ()
, -- This test checks that certain solver parameters do not affect the
-- existence of a solution. It runs the solver twice, and only sets those
-- parameters on the second run. The test also applies parameters that
-- can affect the existence of a solution to both runs.
Expand Down Expand Up @@ -516,6 +529,11 @@ instance Arbitrary IndependentGoals where

shrink (IndependentGoals indep) = [IndependentGoals False | indep]

instance Arbitrary PreferOldest where
arbitrary = PreferOldest <$> arbitrary

shrink (PreferOldest prefOldest) = [PreferOldest False | prefOldest]

instance Arbitrary Component where
arbitrary =
oneof
Expand Down
13 changes: 13 additions & 0 deletions changelog.d/configure-messages
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
synopsis: clarify Cabal "configure" messages
packages: Cabal
prs: #9476

synopsis: {

Cabal can issue a number of error messages referencing "Setup configure",
but it simply references "configure" which could mean any of three
things (Setup configure, the package's "configure" script, or "cabal
configure"). This has recently caught out even Cabal devs. Clarify these
messages.

}
8 changes: 8 additions & 0 deletions changelog.d/pr-10245
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
synopsis: Add MultilineStrings extension
packages: Cabal-syntax
prs: #10245
description: {

- adds support for the `MultilineStrings` language extension (GHC proposal #637)

}
1 change: 1 addition & 0 deletions editors/vim/syntax/cabal.vim
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ syn keyword cabalExtension contained
\ MonoLocalBinds
\ MonoPatBinds
\ MonomorphismRestriction
\ MultilineStrings
\ MultiParamTypeClasses
\ MultiWayIf
\ NPlusKPatterns
Expand Down

0 comments on commit 81db6b3

Please sign in to comment.