-
Notifications
You must be signed in to change notification settings - Fork 457
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
Hitting lots of "stale" build errors on 5.0.6 #3796
Comments
To help me diagnose.
Here |
I can reproduce in 5.1.0. I don't know if I can build a small test case, but I can confirm it happens when not using editor/watch mode. I have a fairly central module, used at the tip of a growing list of dependencies. Very few parts of my system depend on this module directly; the majority are via a module alias or When I change this central module, the if I change something else that depends on this central module, the next build throws the stale error with |
This is possible when X.cmi is rebuilt but its content is actually not changed. A workspace that I can reproduce would be very helpful |
There are a lot of modules that rebuild when this core piece changes, which haven't themselves changed. But not enough of them it seems 🤔 As another example of the same issue, if I comment out one of the APIs on this core piece there is no build failure until I do a rebuild; not enough of the modules that depend on it are rebuilt when it changes. I built a sample project, Module aliases seem to be the cause! There are comments in Looking at the explain output this is a lot simpler than my exact scenario - nothing rebuilds when the internal module is changed, in my project quite a few things do - but it seems like the same underlying cause. |
It seems Demo__internal was not recorded properly |
So the issue is that in a namespaced project. module B = Project_b is actually
If Project_b is only used as alias in project_a.ml, then only Project is recorded as a dependency, since Project is a special file(namespace file), it is created upfront, it does not record the dependency on Project_b (otherwise a cycle dep would be introduced), so Project_b changes would not trigger Project_a in this special case. I guess dune would expect the same issues, can you confirm that? Edit: since we plan only to use -no-alias-deps in namespace file, our fix could be easier |
relevant issues: ocaml/ocaml#6843 |
Me? I'm not very familiar with dune, sorry. I made some toy projects back in the jbuilder days but that's about it. |
Here is a small example that showing the property that cmi containing the transitive dependencies no longer hold after bring the -no-alias-deps in single place: ns.ml
mty.ml
mty no longer depends on Ns. Note we can not take the approach dune adopted by imposing transitive dependencies in the system level , that would render our effort of content-based build system not available any more |
This is indeed a tough issue, great that we own the whole compiler that we can do a clean fix. can you confirm that everything looks good after #3805? |
Oooh thank you for the quick update! I’m happy to try, how do I install from master? Check out the codebase and build it myself? 🤔 |
@TheSpyder I made a change in the last commit, so that install from master should work out of box (no git submodule needed), feedback is welcome and appreciated (build errors are hard to debug) |
Sorry I took a few days to get around to this. I was able to just use the git repo as a direct dependency in my It's working for me! No more stale errors! When do you think this will become a full release? [edit] nevermind, no rush as I can't upgrade until jaredly/reason-language-server#320 is fixed |
@TheSpyder I think both are fixed with 5.2.0-dev.2 would you have a try? |
Yes, I've been using it all day since your announcement on discord and it seems good 👍 |
Sorry I didn't do more to follow up on this, but I can also confirm that with 5.2.0-dev.2, things seem to be great. |
A few of us were talking in the #bucklescript channel on Discord, and we've been noticing an increase in the number of "It's possible that your build is stale" errors. Here's an example:
It seems to happen pretty often (but not quite all the time) when I edit a file that two or more unique modules depend on.
In the above example, I had Bucklescript's watch mode enabled, and I had just tried to save a change to
Txt_Offers.re
, which is a module that is used by quite a few other modules (includingOfferData_Other.re
, which had recently been modified, andOfferData_CostAllocations.re
, which had not).The text was updated successfully, but these errors were encountered: