sdist :: PackageDescriptioninformation from the tarball
-> SDistFlagsverbosity & snapshot
-> (FilePath -> FilePath)build prefix (temp dir)
-> [PPSuffixHandler]extra preprocessors (includes suffixes)
-> IO ()
Create a source distribution.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
ModuleCabal-3.12.1.0Haskell2010
This handles the sdist command. The module exports an sdist action but
also some of the phases that make it up so that other tools can use just the
bits they need. In particular the preparation of the tree of files to go
into the source tarball is separated from actually building the source
tarball.
The createArchive action uses the external tar program and assumes that
it accepts the -z flag. Neither of these assumptions are valid on Windows.
The sdist action now also does some distribution QA checks.
sdist :: PackageDescriptioninformation from the tarball
-> SDistFlagsverbosity & snapshot
-> (FilePath -> FilePath)build prefix (temp dir)
-> [PPSuffixHandler]extra preprocessors (includes suffixes)
-> IO ()Create a source distribution.
Note: must be called with the CWD set to the directory containing the '.cabal' file.
prepareTree :: Verbosityverbosity
-> PackageDescriptioninfo from the cabal file
-> FilePathsource tree to populate
-> [PPSuffixHandler]extra preprocessors (includes suffixes)
-> IO ()Prepare a directory tree of source files.
createArchive Create an archive from a tree of source files, and clean up the tree.
prepareSnapshotTree :: Verbosityverbosity
-> PackageDescriptioninfo from the cabal file
-> FilePathsource tree to populate
-> [PPSuffixHandler]extra preprocessors (includes suffixes)
-> IO ()Prepare a directory tree of source files for a snapshot version. It is expected that the appropriate snapshot version has already been set in the package description, eg using snapshotPackage or snapshotVersion.
Modifies a PackageDescription by appending a snapshot number corresponding to the given date.
Modifies a Version by appending a snapshot number corresponding to the given date.
Given a date produce a corresponding integer representation.
For example given a date 18032008 produce the number 20080318.
listPackageSources :: Verbosityverbosity
-> FilePathdirectory with cabal file
-> PackageDescriptioninfo from the cabal file
-> [PPSuffixHandler]extra preprocessors (include suffixes)
-> IO [FilePath]relative paths
List all source files of a package.
Since Cabal-3.4 returns a single list. There shouldn't be any
executable files, they are hardly portable.
listPackageSourcesWithDie :: Verbosityverbosity
-> (Verbosity -> CabalException -> IO [FilePath])-> FilePathdirectory with cabal file
-> PackageDescriptioninfo from the cabal file
-> [PPSuffixHandler]extra preprocessors (include suffixes)
-> IO [FilePath]relative paths
A variant of listPackageSources with configurable die.
Note: may still die directly. For example on missing include file.
Since @3.4.0.0