Skip to content

Commit

Permalink
Merge pull request #7767 from haskell/mergify/bp/3.6/pr-7608
Browse files Browse the repository at this point in the history
glob expand extra-src-files when tracking for rebuild (backport #7608)
  • Loading branch information
Mikolaj committed Nov 30, 2021
2 parents ab688ed + ea4ea11 commit 763d0cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cabal-install/src/Distribution/Client/SourceFiles.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
-- we cannot "see" easily.
module Distribution.Client.SourceFiles (needElaboratedConfiguredPackage) where

import Control.Monad.IO.Class

import Distribution.Client.ProjectPlanning.Types
import Distribution.Client.RebuildMonad

import Distribution.Solver.Types.OptionalStanza

import Distribution.Simple.Glob (matchDirFileGlobWithDie)
import Distribution.Simple.PreProcess

import Distribution.Types.PackageDescription
Expand All @@ -35,6 +38,7 @@ import Distribution.ModuleName

import Prelude ()
import Distribution.Client.Compat.Prelude
import Distribution.Verbosity (silent)

import System.FilePath

Expand Down Expand Up @@ -138,13 +142,14 @@ needBuildInfo pkg_descr bi modules = do
-- A.hs-boot; need to track both.
findNeededModules ["hs", "lhs", "hsig", "lhsig"]
findNeededModules ["hs-boot", "lhs-boot"]
expandedExtraSrcFiles <- liftIO $ fmap concat . for (extraSrcFiles pkg_descr) $ \fpath -> matchDirFileGlobWithDie silent (\ _ _ -> return []) (specVersion pkg_descr) "." fpath
traverse_ needIfExists $ concat
[ cSources bi
, cxxSources bi
, jsSources bi
, cmmSources bi
, asmSources bi
, extraSrcFiles pkg_descr
, expandedExtraSrcFiles
]
for_ (installIncludes bi) $ \f ->
findFileMonitored ("." : includeDirs bi) f
Expand Down
10 changes: 10 additions & 0 deletions changelog.d/pr-7608
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
synopsis: Glob expand extra-source-files when tracking for rebuild
packages: cabal-install
prs: #7608
issues: #4746

description: {

- Since 3.4, extra-source-files have been tracked by cabal-install in the rebuild-checking logic. However, this tracking did not, until this PR, take into account glob-expansion.

}

0 comments on commit 763d0cc

Please sign in to comment.