[purs ide] Updates the cache-db.json file on rebuilds#3789
[purs ide] Updates the cache-db.json file on rebuilds#3789kritzcreek merged 11 commits intopurescript:masterfrom
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. |
|
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 compileto 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.