There's no point on, when the clear cache flag is enabled via CLI, to remove the precompiled module units of the standard library modules. They aren't gonna change, and typically, building the std.cppm file is the one that is more time-consuming.
This operation is not too much expensive in terms of "seconds wasted", but we are "wasting seconds" that there's no point on wasting them, and effectively making the user to lose its time as well as we need to make a job that's already done.
Therefore, we must implement the clear cache flag in such way that is only used against user input.
That implies that deleting the cache file isn't anymore an option, but we must clean the user input files and details but maybe not our internal data, like compilers metadata, paths, execution times...
NOTE: if we do not clean the last_process_execution, files won't be rebuilt, and that's a bug, since the intention of clear cache is to rollback every status and rebuild files. Therefore, we will need to find a way to do it. For example, we can iterate all over the translation units and just change their TranslationUnitStatus to ::PendingToBuild
Refactor
There's no point on, when the
clear cache
flag is enabled via CLI, to remove the precompiled module units of the standard library modules. They aren't gonna change, and typically, building thestd.cppm
file is the one that is more time-consuming.This operation is not too much expensive in terms of "seconds wasted", but we are "wasting seconds" that there's no point on wasting them, and effectively making the user to lose its time as well as we need to make a job that's already done.
Therefore, we must implement the
clear cache
flag in such way that is only used against user input.That implies that deleting the cache file isn't anymore an option, but we must clean the user input files and details but maybe not our internal data, like compilers metadata, paths, execution times...