-
Notifications
You must be signed in to change notification settings - Fork 571
[purs ide] Updates the cache-db.json file on rebuilds #3789
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
Conversation
This is so they can be used from within the IDE as well, which doesn't run in Make
I just want to check again that I've understood the issues you're solving here properly, does the following sound correct?
Is that it, or is there more to it than this? |
Yes, in addition to that mixing absolute with relative filepaths has the same effect.
That's the harmless case. With the current situation you can imagine the following sequence:
|
Ah yes, thanks for reminding me. |
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 great, thanks!
Thanks for taking a look! |
* generalizes and extracts CacheDb accessors from Make This is so they can be used from within the IDE as well, which doesn't run in Make * overwrites ContentHashes and Timestamps for rebuilt modules * removes a whole lot of "Christoph didn't know what he was doing" * reorganizes the cache info building * normalises filepaths before inserting them into the Cache * normalise file paths when rebuilding from the IDE * extracts the logic that updates the Cache * inlines function that I didn't up using in the IDE code * cleaner diff * more simplifications * Update src/Language/PureScript/Make/Cache.hs
* generalizes and extracts CacheDb accessors from Make This is so they can be used from within the IDE as well, which doesn't run in Make * overwrites ContentHashes and Timestamps for rebuilt modules * removes a whole lot of "Christoph didn't know what he was doing" * reorganizes the cache info building * normalises filepaths before inserting them into the Cache * normalise file paths when rebuilding from the IDE * extracts the logic that updates the Cache * inlines function that I didn't up using in the IDE code * cleaner diff * more simplifications * Update src/Language/PureScript/Make/Cache.hs
Why should IDE write out a changed a externs file if it doesn't produce the codegen output (codegeTargets is empty)? It seems that if no output is produced and externs/cache-db is not touched this couldn't break anything for later |
This patch makes it so we update the content hashes when rebuilds through the IDE occur. We've still got some unfortunate invalidation going on when recompiling a file with no changes, but at least this way the IDE can never cause
purs compile
to invalidate too little.One non-local change is that we now do some path normalisation for the cache-db entries, so two invocations like
purs compile "src/*.purs"
andpurs compile "./src/*.purs"
don't cause the compiler to invalidate every module.I plan to do the file watcher replacement in a follow-up PR.