RFE: refactor cache to be more flexible and useful
There are only two hard problems in IT: naming things, cache invalidation, and off-by-one errors.
The apkg cache is working fine most of the time, saving huge amounts of CPU cycles, but there are edge cases of false cache positives that lead to strange behavior which is best resolved with rm -rf pkg.
Most of CI systems don't really use caching with apkg so the real issues with cache are usually found in manual edge cases.
Furthermore, apkg commands now accept --no-cache/--cache options to control cache, but there are now multiple different things to cache:
- project archives created using
apkg make-archivewhich requires VCS. Entire caching is disabled when VCS isn't available because of this. - source packages and packages which depend on the content of input files
- remote files downloaded from the net (apkg RFE #23)
Suggested changes and improvements:
-
only disable cache for apkg make-archivewhen VCS isn't available as opposed to disabling all caching -
add apkg info cachewhich displays pretty-printed contents ofpkg/.cache.json -
refactor cache names and keys to be well-structured and readable -
add apkg clean cacheto removepkg/.cache.json(solved by #75 (closed)) -
add config to control various cache types ( make-archive/get-archive/srcpkg/build) -
add cache.mdto docs