-
Notifications
You must be signed in to change notification settings - Fork 697
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
cabal new-build does not track files added via TH’s addDependentFile #4746
Comments
One hack solution is to watch |
BTW, is there a way to force |
@23Skidoo that would force GHC to always build that module, that doesn't sound like a very good idea. |
Yep, but sometimes you want that in a build system. For example, Shake rules can be marked Re: |
An alternative way to fix this is to get the list of files to be monitored from |
Does |
@phadej If you click that link, you'll see that I asked that exact question there. |
Given that this feature will only be in |
@cocreature With old versions we can simulate that feature with
|
@23Skidoo btw, we can avoid paying for the slow-legacy fallback when it's not needed, because we know when TH is needed (we already require |
Unfortunately we not only missed the boat for GHC 8.4, but most likely also for GHC 8.6 to get supporting features into GHC... as https://phabricator.haskell.org/D3898 got stuck on a decision which design path to go down... :-/ PS: Screen-scraping GHC's |
Upvoting this issue. It is critical for larger web-dev shops that have people who are totally focused on front-end web UI development. They require instant reload; they don't have time to poke around at files manually every time to induce rebuilds. We are a yesod shop, so we are using stack. For comparison, stack detects this by parsing |
Another upvote for this issue! I think |
We ran into the same issue today. Is there any progress here? |
@kaldonir, no. As far as I know no-one is actively working on adding necessary features to GHC (e.g. ghc-proposals/ghc-proposals#245 or something similar so the compiler could tell Cabal what extra dependencies exist). Alternatively or additionally |
@phadej Are you opposed to making cabal track |
I'm not. It should be easy, I think it should go to the same place as c2f4625 PR welcome! |
This should alleviate haskell#4746 for most use cases, if the dependent files are declared in `extra-source-files`. The downside is that `cabal` will not be able to avoid invoking GHC in as many cases, but GHC's `--make` should be smart enough to avoid any "actual" rebuilding that isn't necessary.
@Mikolaj we should give the permissions to Michael, I think |
No way, @michaelpj, I've just checked and you weren't even a lowly Read-level member of the project according to the Settings page. I've invited you to the respectable Triage level. Could you try? |
done |
Perfect. Thank you. |
+1 Still an issue it seems. |
Stack's code for parsing |
Linking this to #8605 because I can't start using cabal until this is fixed. |
Thinking about hi based tracking I think there's a potential issue: if files are not in the .cabal manifest they still won't get packaged up by an sdist. So that means that an |
Cabal/GHC doesn't know about files produced by cargo, and will therefore fail to invalidate caches. While there are ways to tell Cabal/GHC to depend on these files, they are known to be broken in our tool versions. See: haskell/cabal#4746 Note that we don't use `cabal clean`, as it will also remove any sources it downloaded (specified in `cabal.project`).
Cabal/GHC doesn't know about files produced by cargo, and will therefore fail to invalidate caches. While there are ways to tell Cabal/GHC to depend on these files, they are known to be broken in our tool versions. See: haskell/cabal#4746 Note that we don't use `cabal clean`, as it will also remove any sources it downloaded (specified in `cabal.project`).
Cabal/GHC doesn't know about files produced by cargo, and will therefore fail to invalidate caches. While there are ways to tell Cabal/GHC to depend on these files, they are known to be broken in our tool versions. See: haskell/cabal#4746 Note that we don't use `cabal clean`, as it will also remove any sources it downloaded (specified in `cabal.project`).
Cabal/GHC doesn't know about files produced by cargo, and will therefore fail to invalidate caches. While there are ways to tell Cabal/GHC to depend on these files, they are known to be broken in our tool versions. See: haskell/cabal#4746 Note that we don't use `cabal clean`, as it will also remove any sources it downloaded (specified in `cabal.project`).
Cabal/GHC doesn't know about files produced by cargo, and will therefore fail to invalidate caches. While there are ways to tell Cabal/GHC to depend on these files, they are known to be broken in our tool versions. See: haskell/cabal#4746 Note that we don't use `cabal clean`, as it will also remove any sources it downloaded (specified in `cabal.project`).
I think this is a related issue I've just created - #9745 |
I'm very surprised to see this being labeled as "priority:low" given that I consider this a dealbreaking "cannot consider cabal usable until fixed"-bug. |
@NorfairKing: I've bumped priority. PRs welcome. Actually, design welcome first, IIRC? Especially that it's marked as blocked on GHC, so we either need to create a patch for GHC or devise a special workaround? |
@Mikolaj I don't understand how this is blocked on GHC when stack has not had this bug since 2015. |
Me neither, but it's a long time since I looked into this long discussion thread (assuming I understood it then). Do you think things may have changed since then? Would you like to re-assess? |
My understanding is that stack gets this information by parsing binary https://gitlab.haskell.org/ghc/ghc/-/merge_requests/11994 is some movement towards getting a proper interface for exposing the dependency graph from the GHC side. Though I'm not sure if that includes TH dependencies |
Only GHC knows the result of running TH (do you really want cabal duplicating enough of GHC that it can run TH itself? Remember that you can do conditionals) so it would have been blocked on GHC exporting that information usefully. Later messages in this thread indicate it's now part of the |
Thank you for your remarks. @phadej has also educated me on this issue just now: " So maybe we could look into the |
That's what Sylvain said above: Stack parses hi for this reason (not sure alone or not) with https://github.com/commercialhaskell/hi-file-parser, and we should adopt it. |
No you shouldn't. see e.g. commercialhaskell/stack#5134. Stack does some not so good design choices, and that's a good example of a bad design. But if you want one more thing to slow down making recent ghc compatible releases, go ahead: AFAICT, |
I completely agree with Oleg that depending on "hi-file-parser" is a bad idea. |
@phadej @mpickering what are our options? Reading Mikolaj's post above, I thought that Oleg supports the idea of parsing This issue looks important for some amount of users. Feature-parity with stack is a desirable goal too (modulo some things like installing GHC). I wish we could come to an agreement on some way forward for this. |
I didn't say that, and I only implied that one could parse |
Steps to reproduce
cabal new-build
fileinput
cabal new-build
.Expected behavior
cabal new-build
rebuilds becausefileinput
has changed.Actual behavior
cabal new-build
exits without rebuilding after sayingUp to date
.This issue affects both
cabal-2.0
as well as the master branch.The text was updated successfully, but these errors were encountered: