Skip to content

Commit

Permalink
Merge pull request #6022 from 23Skidoo/cabal-3.0-remove-deprecated
Browse files Browse the repository at this point in the history
 Remove a bunch of previously deprecated stuff in preparation for the 3.0 release.
  • Loading branch information
23Skidoo authored May 6, 2019
2 parents 4f7486c + e3bb1cf commit 33c271e
Show file tree
Hide file tree
Showing 54 changed files with 953 additions and 1,204 deletions.
3 changes: 3 additions & 0 deletions Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ library
Distribution.Simple.Hpc
Distribution.Simple.Install
Distribution.Simple.InstallDirs
Distribution.Simple.InstallDirs.Internal
Distribution.Simple.LocalBuildInfo
Distribution.Simple.PackageIndex
Distribution.Simple.PreProcess
Expand Down Expand Up @@ -448,6 +449,7 @@ library
Distribution.Types.TargetInfo
Distribution.Types.Version
Distribution.Types.VersionRange
Distribution.Types.VersionRange.Internal
Distribution.Types.VersionInterval
Distribution.Types.GivenComponent
Distribution.Types.PackageVersionConstraint
Expand All @@ -456,6 +458,7 @@ library
Distribution.Utils.ShortText
Distribution.Utils.Progress
Distribution.Verbosity
Distribution.Verbosity.Internal
Distribution.Version
Language.Haskell.Extension
Distribution.Compat.Binary
Expand Down
12 changes: 1 addition & 11 deletions Cabal/Distribution/InstalledPackageInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

module Distribution.InstalledPackageInfo (
InstalledPackageInfo(..),
installedPackageId,
installedComponentId,
installedOpenUnitId,
sourceComponentName,
Expand All @@ -50,7 +49,7 @@ import Distribution.CabalSpecVersion (cabalSpecLatest)
import Distribution.FieldGrammar
import Distribution.FieldGrammar.FieldDescrs
import Distribution.ModuleName
import Distribution.Package hiding (installedPackageId, installedUnitId)
import Distribution.Package hiding (installedUnitId)
import Distribution.Types.ComponentName
import Distribution.Utils.Generic (toUTF8BS)

Expand Down Expand Up @@ -83,15 +82,6 @@ installedOpenUnitId ipi
requiredSignatures :: InstalledPackageInfo -> Set ModuleName
requiredSignatures ipi = openModuleSubstFreeHoles (Map.fromList (instantiatedWith ipi))

{-# DEPRECATED installedPackageId "Use installedUnitId instead" #-}
-- | Backwards compatibility with Cabal pre-1.24.
--
-- This type synonym is slightly awful because in cabal-install
-- we define an 'InstalledPackageId' but it's a ComponentId,
-- not a UnitId!
installedPackageId :: InstalledPackageInfo -> UnitId
installedPackageId = installedUnitId

-- -----------------------------------------------------------------------------
-- Munging

Expand Down
7 changes: 1 addition & 6 deletions Cabal/Distribution/Make.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
module Distribution.Make (
module Distribution.Package,
License(..), Version,
defaultMain, defaultMainArgs, defaultMainNoRead
defaultMain, defaultMainArgs
) where

import Prelude ()
Expand All @@ -70,7 +70,6 @@ import Distribution.Compat.Prelude
import Distribution.Compat.Exception
import Distribution.Package
import Distribution.Simple.Program
import Distribution.PackageDescription
import Distribution.Simple.Setup
import Distribution.Simple.Command

Expand All @@ -89,10 +88,6 @@ defaultMain = getArgs >>= defaultMainArgs
defaultMainArgs :: [String] -> IO ()
defaultMainArgs = defaultMainHelper

{-# DEPRECATED defaultMainNoRead "it ignores its PackageDescription arg" #-}
defaultMainNoRead :: PackageDescription -> IO ()
defaultMainNoRead = const defaultMain

defaultMainHelper :: [String] -> IO ()
defaultMainHelper args =
case commandsRun (globalCommand commands) commands args of
Expand Down
5 changes: 0 additions & 5 deletions Cabal/Distribution/ModuleName.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module Distribution.ModuleName (
components,
toFilePath,
main,
simple,
-- * Internal
validModuleComponent,
) where
Expand Down Expand Up @@ -66,10 +65,6 @@ validModuleComponent [] = False
validModuleComponent (c:cs) = isUpper c
&& all validModuleChar cs

{-# DEPRECATED simple "use ModuleName.fromString instead. This symbol will be removed in Cabal-3.0 (est. Mar 2019)." #-}
simple :: String -> ModuleName
simple str = ModuleName (stlFromStrings [str])

-- | Construct a 'ModuleName' from a valid module name 'String'.
--
-- This is just a convenience function intended for valid module strings. It is
Expand Down
6 changes: 0 additions & 6 deletions Cabal/Distribution/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module Distribution.Package
, Package(..), packageName, packageVersion
, HasMungedPackageId(..), mungedName', mungedVersion'
, HasUnitId(..)
, installedPackageId
, PackageInstalled(..)
) where

Expand Down Expand Up @@ -87,11 +86,6 @@ instance HasMungedPackageId MungedPackageId where
class Package pkg => HasUnitId pkg where
installedUnitId :: pkg -> UnitId

{-# DEPRECATED installedPackageId "Use installedUnitId instead. This symbol will be removed in Cabal-3.0 (est. Mar 2019)." #-}
-- | Compatibility wrapper for Cabal pre-1.24.
installedPackageId :: HasUnitId pkg => pkg -> UnitId
installedPackageId = installedUnitId

-- | Class of installed packages.
--
-- The primary data type which is an instance of this package is
Expand Down
2 changes: 0 additions & 2 deletions Cabal/Distribution/PackageDescription.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module Distribution.PackageDescription (
specVersion,
buildType,
license,
descCabalVersion,
BuildType(..),
knownBuildTypes,
allLibraries,
Expand All @@ -35,7 +34,6 @@ module Distribution.PackageDescription (
hasLibs,
explicitLibModules,
libModulesAutogen,
libModules,

-- ** Executables
Executable(..),
Expand Down
15 changes: 0 additions & 15 deletions Cabal/Distribution/PackageDescription/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

module Distribution.PackageDescription.Configuration (
finalizePD,
finalizePackageDescription,
flattenPackageDescription,

-- Utils
Expand Down Expand Up @@ -492,20 +491,6 @@ finalizePD userflags enabled satisfyDep
then DepOk
else MissingDeps missingDeps

{-# DEPRECATED finalizePackageDescription "This function now always assumes tests and benchmarks are disabled; use finalizePD with ComponentRequestedSpec to specify something more specific. This symbol will be removed in Cabal-3.0 (est. Mar 2019)." #-}
finalizePackageDescription ::
FlagAssignment -- ^ Explicitly specified flag assignments
-> (Dependency -> Bool) -- ^ Is a given dependency satisfiable from the set of
-- available packages? If this is unknown then use
-- True.
-> Platform -- ^ The 'Arch' and 'OS'
-> CompilerInfo -- ^ Compiler information
-> [Dependency] -- ^ Additional constraints
-> GenericPackageDescription
-> Either [Dependency]
(PackageDescription, FlagAssignment)
finalizePackageDescription flags = finalizePD flags defaultComponentRequestedSpec

{-
let tst_p = (CondNode [1::Int] [Distribution.Package.Dependency "a" AnyVersion] [])
let tst_p2 = (CondNode [1::Int] [Distribution.Package.Dependency "a" (EarlierVersion (Version [1,0] [])), Distribution.Package.Dependency "a" (LaterVersion (Version [2,0] []))] [])
Expand Down
Loading

0 comments on commit 33c271e

Please sign in to comment.