Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ignore 'install-includes' that are also listed in 'extra-tmp-files'. #1559

Closed
wants to merge 1 commit into from

2 participants

@23Skidoo
Collaborator

Fixes #1557.

@dcoutts
Collaborator

See comments in #1557. I don't think this extra behaviour is needed or desirable.

If we need a mechanism for declaring generated files then it should be a bit more general and deliberate I think.

@23Skidoo 23Skidoo closed this
@23Skidoo 23Skidoo deleted the 23Skidoo:issue-1557 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
9 Cabal/Distribution/Simple/SrcDist.hs
@@ -87,7 +87,7 @@ import Distribution.Simple.Utils
, installOrdinaryFiles, installMaybeExecutableFiles
, findFile, findFileWithExtension, matchFileGlob
, withTempDirectory, defaultPackageDesc
- , die, warn, notice, setupMessage )
+ , die, warn, notice, setupMessage, notElemBy )
import Distribution.Simple.Setup ( Flag(..), SDistFlags(..)
, fromFlag, flagToMaybe)
import Distribution.Simple.PreProcess ( PPSuffixHandler, ppSuffixes
@@ -109,7 +109,7 @@ import System.Directory ( doesFileExist )
import System.IO (IOMode(WriteMode), hPutStrLn, withFile)
import Distribution.Verbosity (Verbosity)
import System.FilePath
- ( (</>), (<.>), dropExtension, isAbsolute )
+ ( (</>), (<.>), dropExtension, isAbsolute, equalFilePath )
-- |Create a source distribution.
sdist :: PackageDescription -- ^information from the tarball
@@ -262,8 +262,11 @@ listPackageSourcesOrdinary verbosity pkg_descr pps =
-- Install-include files.
, withLib $ \ l -> do
let lbi = libBuildInfo l
+ -- Ignore include files that are generated by 'configure'. See #1557.
+ isNotTmpFile f = notElemBy equalFilePath f (extraTmpFiles pkg_descr)
relincdirs = "." : filter (not.isAbsolute) (includeDirs lbi)
- mapM (fmap snd . findIncludeFile relincdirs) (installIncludes lbi)
+ fmap (filter isNotTmpFile)
+ . mapM (fmap snd . findIncludeFile relincdirs) $ (installIncludes lbi)
-- Setup script, if it exists.
, fmap (maybe [] (\f -> [f])) $ findSetupFile ""
View
12 Cabal/Distribution/Simple/Utils.hs
@@ -136,6 +136,8 @@ module Distribution.Simple.Utils (
normaliseLineEndings,
-- * generic utils
+ elemBy,
+ notElemBy,
equating,
comparing,
isInfixOf,
@@ -1271,6 +1273,16 @@ normaliseLineEndings ( c :s) = c : normaliseLineEndings s
-- * Common utils
-- ------------------------------------------------------------
+-- | Like 'elemBy', but takes a custom comparison function.
+elemBy :: (a -> b -> Bool) -> a -> [b] -> Bool
+elemBy _ _ [] = False
+elemBy f a (b:bs) = f a b || elemBy f a bs
+
+-- | Like 'notElemBy', but takes a custom comparison function.
+notElemBy :: (a -> b -> Bool) -> a -> [b] -> Bool
+notElemBy _ _ [] = True
+notElemBy f a (b:bs) = not (f a b) && notElemBy f a bs
+
equating :: Eq a => (b -> a) -> b -> b -> Bool
equating p x y = p x == p y
Something went wrong with that request. Please try again.