-
Notifications
You must be signed in to change notification settings - Fork 326
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
Force recompilation if imported module has changed #3703
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
As we don't have tests, we need to ensure manually that it works as expected:
- Did you try the scenario from the bug report to verify that now it behaves correctly?
- Can you somehow verify if after the changes there are not "too" many invalidations? (I guess just running a program twice, one with cleared caches and one cached would be ok to see that the second one is faster - very imperfect test but better than nothing)
Yeah, I did all of that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's even better, great!
I really appreciate adding the tests, as not having tests really means we cannot guarantee we don't regress - see the REPL being broken so often.
fead139
to
757eec9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great test! One question about transitive dependencies & ordering. One question about including hashing with a chain. Otherwise, looks like a progress. Approving.
engine/runtime/src/test/resources/Test_Caching_Invalidation/src/Main.enso
Outdated
Show resolved
Hide resolved
IR cache never really took into account a situation when a binding from the imported module has changed. In other words, it would continue to happily use the serialized metadata without noticing that it changed. This change forces cache invalidation when any of the imported modules was invalidated (or rather not loaded from cache). Sadly, it doesn't appear that we have appropriate infrastructure to write such scenarios so I'm delaying that bit for now.
Using _x, where x is the change step, to simulate modifications to files and thus trigger cache invalidation that should propagate to upstream modules.
fed45c3
to
9293020
Compare
Pull Request Description
IR cache never really took into account a situation when a binding from the imported module has changed. In other words, it would continue to happily use the serialized metadata without noticing that it changed.
This change forces cache invalidation when any of the imported modules was invalidated (or rather not loaded from cache).
Important Notes
Added simple test infrastructure that simulates file modifications that would trigger the initial cache invalidation.
If they succeed, cache invalidation is propagated thus causing an error.
Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.
./run ide build
and./run ide watch
.