Open dcharkes opened 3 months ago
@jonasfj @sigurdm Does pub delete unused packages versions? Or do they just stay around forever (until a dart pub cache clean
)?
Currently they stay in the cache forever.
We have a cool idea for how we could "garbage collect" the cache, but no immediate plans for realizing it.
Version-specific cache directories are checked periodically (at most, every 24 hours) to determine whether they are still in use. They are deleted if they haven’t been used for 7 days. https://docs.gradle.org/current/userguide/directory_layout.html#dir:project_root
Thanks @reidbaker!
We might follow a similar strategy of 24h and 7d. 👍
The native assets builder creates directories in the form of
.dart_tool/native_assets_builder/<some-hash-of-the-config>
. These directories should be purged at some point:https://github.com/dart-lang/native/blob/4c5fca965acecc0256489c9b0398518629cb9045/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart#L255
Possible purging strategy:
touch
theconfig.json
(or alast_read.json
) every time it's read. And with a 1% chance delete everything that hasn't been read in a week.