Commit 2e604aa0 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Correctly pass setup options to sdist invocation.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 4f796f22
......@@ -1197,7 +1197,7 @@ buildInplaceUnpackedPackage verbosity
--TODO: [required eventually] this doesn't track file
--non-existence, so we could fail to rebuild if someone
--adds a new file which changes behavior.
allSrcFiles <- allPackageSourceFiles verbosity srcdir
allSrcFiles <- allPackageSourceFiles verbosity scriptOptions srcdir
updatePackageBuildFileMonitor packageFileMonitor srcdir timestamp
pkg buildStatus
......
......@@ -38,6 +38,7 @@ import Distribution.Client.SrcDist (allPackageSourceFiles)
import Distribution.Client.Sandbox.Index
(ListIgnoredBuildTreeRefs (ListIgnored), RefTypesToList(OnlyLinks)
,listBuildTreeRefs)
import Distribution.Client.SetupWrapper
import Distribution.Compat.Exception (catchIO)
import Distribution.Compat.Time (ModTime, getCurTime,
......@@ -227,7 +228,9 @@ withActionOnCompilerTimestamps f sandboxDir compId platform act = do
isDepModified :: Verbosity -> ModTime -> AddSourceTimestamp -> IO Bool
isDepModified verbosity now (packageDir, timestamp) = do
debug verbosity ("Checking whether the dependency is modified: " ++ packageDir)
depSources <- allPackageSourceFiles verbosity packageDir
-- TODO: we should properly plumb the correct options through
-- instead of using defaultSetupScriptOptions
depSources <- allPackageSourceFiles verbosity defaultSetupScriptOptions packageDir
go depSources
where
......
......@@ -33,7 +33,7 @@ import Distribution.Simple.Program (requireProgram, simpleProgram, programPath)
import Distribution.Simple.Program.Db (emptyProgramDb)
import Distribution.Text ( display )
import Distribution.Verbosity (Verbosity, normal, lessVerbose)
import Distribution.Version (Version(..), orLaterVersion)
import Distribution.Version (Version(..), orLaterVersion, intersectVersionRanges)
import Distribution.Client.Utils
(tryFindAddSourcePackageDesc)
......@@ -147,8 +147,8 @@ createZipArchive verbosity pkg tmpDir targetPref = do
-- | List all source files of a given add-source dependency. Exits with error if
-- something is wrong (e.g. there is no .cabal file in the given directory).
allPackageSourceFiles :: Verbosity -> FilePath -> IO [FilePath]
allPackageSourceFiles verbosity packageDir = do
allPackageSourceFiles :: Verbosity -> SetupScriptOptions -> FilePath -> IO [FilePath]
allPackageSourceFiles verbosity setupOpts0 packageDir = do
pkg <- do
let err = "Error reading source files of package."
desc <- tryFindAddSourcePackageDesc packageDir err
......@@ -161,9 +161,11 @@ allPackageSourceFiles verbosity packageDir = do
then lessVerbose verbosity else verbosity,
sDistListSources = Flag file
}
setupOpts = defaultSetupScriptOptions {
setupOpts = setupOpts0 {
-- 'sdist --list-sources' was introduced in Cabal 1.18.
useCabalVersion = orLaterVersion $ Version [1,18,0] [],
useCabalVersion = intersectVersionRanges
(orLaterVersion $ Version [1,18,0] [])
(useCabalVersion setupOpts0),
useWorkingDir = Just packageDir
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment