Skip to content

Commit

Permalink
root relative glob expansion of extra source files (#8640)
Browse files Browse the repository at this point in the history
* root relative glob expansion of extra source files
  • Loading branch information
gbaz authored Jan 2, 2023
1 parent ffa9f01 commit 7babda9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cabal-install/src/Distribution/Client/SourceFiles.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Distribution.ModuleName

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

import System.FilePath

Expand Down Expand Up @@ -150,7 +150,8 @@ 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
root <- askRoot
expandedExtraSrcFiles <- liftIO $ fmap concat . for (extraSrcFiles pkg_descr) $ \fpath -> matchDirFileGlobWithDie normal (\ _ _ -> return []) (specVersion pkg_descr) root fpath
traverse_ needIfExists $ concat
[ cSources bi
, cxxSources bi
Expand Down
10 changes: 10 additions & 0 deletions changelog.d/pr-8640
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
synopsis: Fix extra-source-file rebuild tracking when run in a multi-package project
packages: cabal-install
issues: #8632 #8634
prs: #8640

description: {

- Fixes an issue where glob expansion of extra-source-files for rebuild tracking purposes was not occuring correctly when run in a multi-package setting (i.e. when the globs needed to be expanded relative to something other than ".").

}

0 comments on commit 7babda9

Please sign in to comment.