Skip to content

Commit

Permalink
Merge branch 'master' into fix-4251
Browse files Browse the repository at this point in the history
  • Loading branch information
yvan-sraka authored Aug 25, 2023
2 parents adce9a3 + 967ecd3 commit 8ae2193
Show file tree
Hide file tree
Showing 42 changed files with 1,000 additions and 801 deletions.
2 changes: 2 additions & 0 deletions Cabal-syntax/Cabal-syntax.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ library
if impl(ghc >= 8.0) && impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances

build-tool-depends: alex:alex

exposed-modules:
Distribution.Backpack
Distribution.CabalSpecVersion
Expand Down
14 changes: 2 additions & 12 deletions templates/Lexer.x → Cabal-syntax/src/Distribution/Fields/Lexer.x
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ module Distribution.Fields.Lexer
,bol_section, in_section, in_field_layout, in_field_braces
,mkLexState) where

-- [Note: bootstrapping parsec parser]
--
-- We manually produce the `Lexer.hs` file from `boot/Lexer.x` (make lexer)
-- because bootstrapping cabal-install would be otherwise tricky.
-- Alex is (atm) tricky package to build, cabal-install has some magic
-- to move bundled generated files in place, so rather we don't depend
-- on it before we can build it ourselves.
-- Therefore there is one thing less to worry in bootstrap.sh, which is a win.
--
-- See also https://github.com/haskell/cabal/issues/4633
--

import Prelude ()
import qualified Prelude as Prelude
import Distribution.Compat.Prelude
Expand All @@ -53,6 +41,8 @@ import qualified Data.Text.Encoding.Error as T
}
-- Various character classes

%encoding "latin1"

$space = \ -- single space char
$ctlchar = [\x0-\x1f \x7f]
$printable = \x0-\xff # $ctlchar -- so no \n \r
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ ppExplanation SignaturesCabal2 =
"To use the 'signatures' field the package needs to specify "
++ "at least 'cabal-version: 2.0'."
ppExplanation AutogenNotExposed =
"An 'autogen-module' is neither on 'exposed-modules' or 'other-modules'."
"An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'."
ppExplanation AutogenIncludesNotIncluded =
"An include in 'autogen-includes' is neither in 'includes' or "
++ "'install-includes'."
Expand Down
13 changes: 4 additions & 9 deletions Cabal/src/Distribution/Simple.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import Distribution.Pretty
import Distribution.Simple.Bench
import Distribution.Simple.BuildPaths
import Distribution.Simple.ConfigureScript
import Distribution.Simple.Errors
import Distribution.Simple.Haddock
import Distribution.Simple.Install
import Distribution.Simple.LocalBuildInfo
Expand Down Expand Up @@ -601,16 +602,10 @@ sanityCheckHookedBuildInfo
verbosity
(PackageDescription{library = Nothing})
(Just _, _) =
die' verbosity $
"The buildinfo contains info for a library, "
++ "but the package does not have a library."
dieWithException verbosity $ NoLibraryForPackage
sanityCheckHookedBuildInfo verbosity pkg_descr (_, hookExes)
| exe1 : _ <- nonExistant =
die' verbosity $
"The buildinfo contains info for an executable called '"
++ prettyShow exe1
++ "' but the package does not have a "
++ "executable with that name."
dieWithException verbosity $ SanityCheckHookedBuildInfo exe1
where
pkgExeNames = nub (map exeName (executables pkg_descr))
hookExeNames = nub (map fst hookExes)
Expand Down Expand Up @@ -777,7 +772,7 @@ autoconfUserHooks =
verbosity
flags
lbi
else die' verbosity "configure script not found."
else dieWithException verbosity ConfigureScriptNotFound

pbi <- getHookedBuildInfo verbosity (buildDir lbi)
sanityCheckHookedBuildInfo verbosity pkg_descr pbi
Expand Down
4 changes: 1 addition & 3 deletions Cabal/src/Distribution/Simple/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ checkSemaphoreSupport
:: Verbosity -> Compiler -> BuildFlags -> IO ()
checkSemaphoreSupport verbosity comp flags = do
unless (jsemSupported comp || (isNothing (flagToMaybe (buildUseSemaphore flags)))) $
die' verbosity $
"Your compiler does not support the -jsem flag. "
++ "To use this feature you must use GHC 9.8 or later."
dieWithException verbosity CheckSemaphoreSupport

-- | Write available build information for 'LocalBuildInfo' to disk.
--
Expand Down
Loading

0 comments on commit 8ae2193

Please sign in to comment.