-
Notifications
You must be signed in to change notification settings - Fork 842
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
File watch watches unrelated libs #5310
Comments
@dten could you provide an example project reproducing this? |
Sure, here's testlibs.zip (edit: this one slightly wrong)
edit: hmm i actually made testlib2's executable depend on testlib, so it's not quite what i said |
fixed not renaming enough in testlibs2. now truly unrelated |
Thanks, hopefully I will find some time to look into it soon. |
@dten it looks like currently all local files get tracked not only project package files but also local deps as well see https://github.com/commercialhaskell/stack/blob/master/src/Stack/Build.hs#L67 So it appears that what you want is not the way Stack currently works but changing that seems to be doable and I don't see any arguments against this. @snoyberg what do you think if |
Seems reasonable to me, no objections |
@snoyberg the fix is quite easy but I'm not sure what do we do with backwards-compatibility. The least surprising would be to add an extra explicit flag, something like |
I think we can just make the change, perhaps with a |
Thanks, I like this variant |
I have for example a stack.yaml with two packages in, neither of which reference each other. Let's call them package0 and package1
stack build package0 --file-watch
this results in watching all the files of package0 (good) but also all the lib files of package1 (seems bad).
I can't figure out a reason to watch the .hs files and the .md files of the other package. my logic for watching the cabal file also seems a bit weak.
Is this intended behaviour? Am I missing some reasoning where package1 could affect package0 if package0's dependency graph doesn't mention it?
and just in case it's just me i'm on ubuntu 18 under wsl (windows 10 1909) with stack 2.1.3
The text was updated successfully, but these errors were encountered: