-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
foreign-library source files are not tracked in file-watch #3915
Comments
Just to let people know, the issue is also present with:
|
I've taken a quick look through the |
I can confirm this in 2.1.1 |
Related, Stack doesn't seem to rebuild foreign-library components when source files change, even without Logs just say
|
Notes for self:
So, it looks to me that any component that is not EDIT: But that can't be correct, because EDIT: The answer is -- | Gets list of Paths for files relevant to a set of components in a package.
-- Note that the library component, if any, is always automatically added to the
-- set of components.
getPackageFilesForTargets ::
HasEnvConfig env
=> Package
-> Path Abs File
-> Set NamedComponent
-> RIO env (Map NamedComponent (Set (Path Abs File)), [PackageWarning])
getPackageFilesForTargets pkg cabalFP nonLibComponents = do
(components',compFiles,otherFiles,warnings) <-
getPackageFiles (packageFiles pkg) cabalFP
let necessaryComponents =
Set.insert CLib $ Set.filter isCInternalLib (M.keysSet components')
components = necessaryComponents `Set.union` nonLibComponents
componentsFiles = M.map
(\files ->
Set.union otherFiles (Set.map dotCabalGetPath $ Set.fromList files)
)
$ M.filterWithKey (\component _ -> component `elem` components) compFiles
pure (componentsFiles, warnings)
|
General summary
If cabal file contains
foreign-library
section, its source files are not tracked withstack build --file-watch
. Stack doesn't trigger rebuild when files change.Steps to reproduce
stack build --file-watch
Expected
Rebuild when foreign/Example.hs is changed.
Actual
Nothing.
Stack version
Method of installation
brew
The text was updated successfully, but these errors were encountered: