Skip to content

Commit 8ae2193

Browse files
authored
Merge branch 'master' into fix-4251
2 parents adce9a3 + 967ecd3 commit 8ae2193

File tree

42 files changed

+1000
-801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1000
-801
lines changed

Cabal-syntax/Cabal-syntax.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ library
5858
if impl(ghc >= 8.0) && impl(ghc < 8.8)
5959
ghc-options: -Wnoncanonical-monadfail-instances
6060

61+
build-tool-depends: alex:alex
62+
6163
exposed-modules:
6264
Distribution.Backpack
6365
Distribution.CabalSpecVersion

templates/Lexer.x renamed to Cabal-syntax/src/Distribution/Fields/Lexer.x

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,6 @@ module Distribution.Fields.Lexer
1919
,bol_section, in_section, in_field_layout, in_field_braces
2020
,mkLexState) where
2121

22-
-- [Note: bootstrapping parsec parser]
23-
--
24-
-- We manually produce the `Lexer.hs` file from `boot/Lexer.x` (make lexer)
25-
-- because bootstrapping cabal-install would be otherwise tricky.
26-
-- Alex is (atm) tricky package to build, cabal-install has some magic
27-
-- to move bundled generated files in place, so rather we don't depend
28-
-- on it before we can build it ourselves.
29-
-- Therefore there is one thing less to worry in bootstrap.sh, which is a win.
30-
--
31-
-- See also https://github.com/haskell/cabal/issues/4633
32-
--
33-
3422
import Prelude ()
3523
import qualified Prelude as Prelude
3624
import Distribution.Compat.Prelude
@@ -53,6 +41,8 @@ import qualified Data.Text.Encoding.Error as T
5341
}
5442
-- Various character classes
5543

44+
%encoding "latin1"
45+
5646
$space = \ -- single space char
5747
$ctlchar = [\x0-\x1f \x7f]
5848
$printable = \x0-\xff # $ctlchar -- so no \n \r

Cabal/src/Distribution/PackageDescription/Check.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ ppExplanation SignaturesCabal2 =
309309
"To use the 'signatures' field the package needs to specify "
310310
++ "at least 'cabal-version: 2.0'."
311311
ppExplanation AutogenNotExposed =
312-
"An 'autogen-module' is neither on 'exposed-modules' or 'other-modules'."
312+
"An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'."
313313
ppExplanation AutogenIncludesNotIncluded =
314314
"An include in 'autogen-includes' is neither in 'includes' or "
315315
++ "'install-includes'."

Cabal/src/Distribution/Simple.hs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ import Distribution.Pretty
9292
import Distribution.Simple.Bench
9393
import Distribution.Simple.BuildPaths
9494
import Distribution.Simple.ConfigureScript
95+
import Distribution.Simple.Errors
9596
import Distribution.Simple.Haddock
9697
import Distribution.Simple.Install
9798
import Distribution.Simple.LocalBuildInfo
@@ -601,16 +602,10 @@ sanityCheckHookedBuildInfo
601602
verbosity
602603
(PackageDescription{library = Nothing})
603604
(Just _, _) =
604-
die' verbosity $
605-
"The buildinfo contains info for a library, "
606-
++ "but the package does not have a library."
605+
dieWithException verbosity $ NoLibraryForPackage
607606
sanityCheckHookedBuildInfo verbosity pkg_descr (_, hookExes)
608607
| exe1 : _ <- nonExistant =
609-
die' verbosity $
610-
"The buildinfo contains info for an executable called '"
611-
++ prettyShow exe1
612-
++ "' but the package does not have a "
613-
++ "executable with that name."
608+
dieWithException verbosity $ SanityCheckHookedBuildInfo exe1
614609
where
615610
pkgExeNames = nub (map exeName (executables pkg_descr))
616611
hookExeNames = nub (map fst hookExes)
@@ -777,7 +772,7 @@ autoconfUserHooks =
777772
verbosity
778773
flags
779774
lbi
780-
else die' verbosity "configure script not found."
775+
else dieWithException verbosity ConfigureScriptNotFound
781776

782777
pbi <- getHookedBuildInfo verbosity (buildDir lbi)
783778
sanityCheckHookedBuildInfo verbosity pkg_descr pbi

Cabal/src/Distribution/Simple/Build.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,7 @@ checkSemaphoreSupport
181181
:: Verbosity -> Compiler -> BuildFlags -> IO ()
182182
checkSemaphoreSupport verbosity comp flags = do
183183
unless (jsemSupported comp || (isNothing (flagToMaybe (buildUseSemaphore flags)))) $
184-
die' verbosity $
185-
"Your compiler does not support the -jsem flag. "
186-
++ "To use this feature you must use GHC 9.8 or later."
184+
dieWithException verbosity CheckSemaphoreSupport
187185

188186
-- | Write available build information for 'LocalBuildInfo' to disk.
189187
--

0 commit comments

Comments
 (0)