File tree Expand file tree Collapse file tree
Cabal/src/Distribution/PackageDescription
cabal-testsuite/PackageTests/Check Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -833,7 +833,9 @@ checkSetupExists _ =
833833 ( \ ops -> do
834834 ba <- doesFileExist ops " Setup.hs"
835835 bb <- doesFileExist ops " Setup.lhs"
836- return (not $ ba || bb)
836+ bc <- doesFileExist ops " SetupHooks.hs"
837+ bd <- doesFileExist ops " SetupHooks.lhs"
838+ return (not $ ba || bb || bc || bd)
837839 )
838840 (PackageDistInexcusable MissingSetupFile )
839841
Original file line number Diff line number Diff line change @@ -1463,7 +1463,8 @@ ppExplanation (UnknownFile fieldname file) =
14631463 ++ quote (getSymbolicPath file)
14641464 ++ " which does not exist."
14651465ppExplanation MissingSetupFile =
1466- " The package is missing a Setup.hs or Setup.lhs script."
1466+ " The package is missing a Setup.hs or Setup.lhs or SetupHooks.hs "
1467+ ++ " or SetupHooks.lhs script."
14671468ppExplanation MissingConfigureScript =
14681469 " The 'build-type' is 'Configure' but there is no 'configure' script. "
14691470 ++ " You probably need to run 'autoreconf -i' to generate it."
Original file line number Diff line number Diff line change 11# cabal check
22The following errors will cause portability problems on other environments:
3- Error: [missing-setup] The package is missing a Setup.hs or Setup.lhs script.
3+ Error: [missing-setup] The package is missing a Setup.hs or Setup.lhs or
4+ SetupHooks.hs or SetupHooks.lhs script.
45Error: Hackage would reject this package.
Original file line number Diff line number Diff line change 1+ module SetupHooks where
2+
3+ import Distribution.Simple.SetupHooks ( SetupHooks , noSetupHooks )
4+
5+ setupHooks :: SetupHooks
6+ setupHooks = noSetupHooks
Original file line number Diff line number Diff line change 1+ # cabal check
2+ No errors or warnings could be found in the package.
Original file line number Diff line number Diff line change 1+ import Test.Cabal.Prelude
2+
3+ -- SetupHooks.hs is a valid setup script.
4+ main = cabalTest $
5+ cabal " check" []
Original file line number Diff line number Diff line change 1+ cabal-version : 3.14
2+ name : pkg
3+ version : 0.1.0.0
4+ synopsis : pkg
5+ description : pkg description
6+ license : GPL-3.0-or-later
7+ author : Joris Dral
8+ maintainer : joris@well-typed.com
9+ build-type : Hooks
10+ category : Data
11+
12+ common warnings
13+ ghc-options : -Wall
14+
15+ library
16+ import : warnings
17+ exposed-modules : MyLib
18+ build-depends : base ^>= 4.18.3.0
19+ default-language : Haskell2010
20+
21+ custom-setup
22+ setup-depends :
23+ Cabal-hooks >= 3.14 && < 3.17 ,
24+ base >= 4.18 && < 5
Original file line number Diff line number Diff line change 1+ ---
2+ synopsis: Recognise SetupHooks.hs
3+ packages: [cabal-install]
4+ prs: 11351
5+ issues: 11349
6+ ---
7+
8+ `cabal check` now recogsnises `SetupHooks.hs` as a valid setup script.
Original file line number Diff line number Diff line change @@ -1521,7 +1521,7 @@ A list of all warnings with their constructor:
15211521- ``no-cabal-file ``: no ``.cabal `` file found in folder.
15221522- ``multiple-cabal-file ``: multiple ``.cabal `` files found in folder.
15231523- ``unknown-file ``: path refers to a file which does not exist.
1524- - ``missing-setup ``: missing ``Setup.hs `` or ``Setup.lsh ``.
1524+ - ``missing-setup ``: missing ``Setup.hs `` or ``Setup.lhs `` or `` SetupHooks.hs `` or `` SetupHooks.lhs ``.
15251525- ``missing-conf-script ``: missing ``configure `` script with ``build-type: Configure ``.
15261526- ``unknown-directory ``: paths refer to a directory which does not exist.
15271527- ``no-repository ``: missing ``source-repository `` section.
You can’t perform that action at this time.
0 commit comments