Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cabal-syntax/src/Distribution/CabalSpecVersion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ data CabalSpecVersion
CabalSpecV3_12
| CabalSpecV3_14
| CabalSpecV3_16
| -- 3.18: remove build-type: Make
CabalSpecV3_18
deriving (Eq, Ord, Show, Read, Enum, Bounded, Data, Generic)

instance Binary CabalSpecVersion
Expand All @@ -46,6 +48,7 @@ instance NFData CabalSpecVersion where rnf = genericRnf
--
-- @since 3.0.0.0
showCabalSpecVersion :: CabalSpecVersion -> String
showCabalSpecVersion CabalSpecV3_18 = "3.18"
showCabalSpecVersion CabalSpecV3_16 = "3.16"
showCabalSpecVersion CabalSpecV3_14 = "3.14"
showCabalSpecVersion CabalSpecV3_12 = "3.12"
Expand Down Expand Up @@ -76,6 +79,7 @@ cabalSpecLatest = CabalSpecV3_16
-- It may fail if for recent versions the version is not exact.
cabalSpecFromVersionDigits :: [Int] -> Maybe CabalSpecVersion
cabalSpecFromVersionDigits v
| v == [3, 18] = Just CabalSpecV3_18
| v == [3, 16] = Just CabalSpecV3_16
| v == [3, 14] = Just CabalSpecV3_14
| v == [3, 12] = Just CabalSpecV3_12
Expand All @@ -101,6 +105,7 @@ cabalSpecFromVersionDigits v

-- | @since 3.4.0.0
cabalSpecToVersionDigits :: CabalSpecVersion -> [Int]
cabalSpecToVersionDigits CabalSpecV3_18 = [3, 18]
cabalSpecToVersionDigits CabalSpecV3_16 = [3, 16]
cabalSpecToVersionDigits CabalSpecV3_14 = [3, 14]
cabalSpecToVersionDigits CabalSpecV3_12 = [3, 12]
Expand Down
9 changes: 7 additions & 2 deletions Cabal-syntax/src/Distribution/Types/BuildType.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ data BuildType
-- which invokes @configure@ to generate additional build
-- information used by later phases.
Configure
| -- | calls @Distribution.Make.defaultMain@
| -- | @build-type: Make@ is no longer functional, but we must keep parsing
-- old Cabal files, even if only to throw an error later.
Make
| -- | uses user-supplied @Setup.hs@ or @Setup.lhs@ (default)
Custom
Expand All @@ -49,7 +50,11 @@ instance Parsec BuildType where
"Simple" -> return Simple
"Configure" -> return Configure
"Custom" -> return Custom
"Make" -> return Make
"Make" -> do
v <- askCabalSpecVersion
if v < CabalSpecV3_18
then return Make
else fail "build-type: 'Make'. This feature requires cabal-version <= 3.18."
Comment thread
zlonast marked this conversation as resolved.
"Hooks" -> do
v <- askCabalSpecVersion
if v >= CabalSpecV3_14
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 @@ -29,8 +29,8 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int

md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion
md5CheckGenericPackageDescription proxy = md5Check proxy
0xaa065de51286b8f80733ffff51a44a20
0xd0df09480e91e08ae600d3ba4d9c3740

md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion
md5CheckLocalBuildInfo proxy = md5Check proxy
0xff2e1755aa2473b9d10c1236ef3ec80e
0x8190203d49e950335b62db3978880e45
1 change: 0 additions & 1 deletion Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ library
Distribution.Compat.Stack
Distribution.Compat.SysInfo
Distribution.Compat.Time
Distribution.Make
Distribution.PackageDescription.Check
Distribution.ReadE
Distribution.Simple
Expand Down
222 changes: 0 additions & 222 deletions Cabal/src/Distribution/Make.hs

This file was deleted.

3 changes: 1 addition & 2 deletions Cabal/src/Distribution/Simple.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ libraries/Cabal/Distribution/Simple.hs:78:0:
-- simple software.
--
-- The original idea was that there could be different build systems that all
-- presented the same compatible command line interfaces. There is still a
-- "Distribution.Make" system but in practice no packages use it.
-- presented the same compatible command line interfaces.
module Distribution.Simple
( module Distribution.Package
, module Distribution.Version
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/Simple/UserHooks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
--
-- This defines the API that @Setup.hs@ scripts can use to customise the way
-- the build works. This module just defines the 'UserHooks' type. The
-- predefined sets of hooks that implement the @Simple@, @Make@ and @Configure@
-- predefined sets of hooks that implement the @Simple@ and @Configure@
-- build systems are defined in "Distribution.Simple". The 'UserHooks' is a big
-- record of functions. There are 3 for each action, a pre, post and the action
-- itself. There are few other miscellaneous hooks, ones to extend the set of
Expand Down
3 changes: 1 addition & 2 deletions cabal-install/src/Distribution/Client/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ import Distribution.PackageDescription

import Distribution.Client.Errors
import Distribution.Compat.ResponseFile
import qualified Distribution.Make as Make
import Distribution.PackageDescription.PrettyPrint
( writeGenericPackageDescription
)
Expand Down Expand Up @@ -1575,7 +1574,7 @@ actAsSetupAction actAsSetupFlags args _globalFlags =
Simple.autoconfSetupHooks
defaultVerbosityHandles
args
Make -> Make.defaultMainArgs args
Make -> error "actAsSetupAction Main"
Hooks -> error "actAsSetupAction Hooks"
Custom -> error "actAsSetupAction Custom"

Expand Down
2 changes: 1 addition & 1 deletion cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ elaborateInstallPlan
-- main library in cabal. Other components will need to depend
-- on the main library for configured data.
PD.Custom -> [CuzBuildType CuzCustomBuildType]
PD.Make -> [CuzBuildType CuzMakeBuildType]
PD.Make -> error "build-type: Make is no longer supported"
PD.Simple -> []
-- TODO: remove the following, once we make Setup a separate
-- component (task tracked at #9986).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,6 @@ data NotPerComponentBuildType
= CuzConfigureBuildType
| CuzCustomBuildType
| CuzHooksBuildType
| CuzMakeBuildType
deriving (Eq, Show, Generic)

instance Binary NotPerComponentBuildType
Expand All @@ -784,7 +783,6 @@ whyNotPerComponent = \case
CuzConfigureBuildType -> "Configure"
CuzCustomBuildType -> "Custom"
CuzHooksBuildType -> "Hooks"
CuzMakeBuildType -> "Make"
CuzCabalSpecVersion -> "cabal-version is less than 1.8"
CuzNoBuildableComponents -> "there are no buildable components"
CuzDisablePerComponent -> "you passed --disable-per-component"
Expand Down
8 changes: 4 additions & 4 deletions cabal-install/src/Distribution/Client/SetupWrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ data SetupScriptOptions = SetupScriptOptions
-- overhead, we use a shared setup script cache
-- ('$XDG_CACHE_HOME/cabal/setup-exe-cache'). For each (compiler, platform, Cabal
-- version) combination the cache holds a compiled setup script
-- executable. This only affects the Simple build type; for the Custom,
-- Configure and Make build types we always compile the setup script anew.
-- executable. This only affects the Simple build type; for the Custom
-- and Configure build types we always compile the setup script anew.
setupCacheLock :: Maybe Lock
, isInteractive :: Bool
-- ^ Is the task we are going to run an interactive foreground task,
Expand Down Expand Up @@ -816,7 +816,7 @@ externalSetupMethod path verbosity options _ args NotInLibrary =

useCachedSetupExecutable :: BuildType -> Bool
useCachedSetupExecutable bt =
bt == Simple || bt == Configure || bt == Make
bt == Simple || bt == Configure

data ExternalExe = HooksExe | SetupExe
data WantedExternalExe (meth :: ExternalExe) where
Expand Down Expand Up @@ -971,7 +971,7 @@ buildTypeScript bt cabalLibVersion = "{-# LANGUAGE NoImplicitPrelude #-}\n" <> c
-> "import Distribution.Simple; main = defaultMainWithHooks autoconfUserHooks\n"
| otherwise
-> "import Distribution.Simple; main = defaultMainWithHooks defaultUserHooks\n"
Make -> "import Distribution.Make; main = defaultMain\n"
Make -> error "buildtypeScript Make is no longer supported"
Hooks
| cabalLibVersion >= mkVersion [3, 13, 0]
-> "import Distribution.Simple; import SetupHooks; main = defaultMainWithSetupHooks setupHooks\n"
Expand Down
Loading
Loading