Skip to content

[native_assets_builder] Purge old directories #1353

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

Open
dcharkes opened this issue Jul 17, 2024 · 3 comments
Open

[native_assets_builder] Purge old directories #1353

dcharkes opened this issue Jul 17, 2024 · 3 comments
Labels
P3 A lower priority bug or feature request package:hooks_runner

Comments

@dcharkes
Copy link
Collaborator

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:

// TODO(https://dartbug.com/50565): Purge old or unused folders.

Possible purging strategy:

  • touch the config.json (or a last_read.json) every time it's read. And with a 1% chance delete everything that hasn't been read in a week.
@dcharkes
Copy link
Collaborator Author

@jonasfj @sigurdm Does pub delete unused packages versions? Or do they just stay around forever (until a dart pub cache clean)?

@dcharkes dcharkes added the P3 A lower priority bug or feature request label Jul 17, 2024
@sigurdm
Copy link

sigurdm commented Jul 29, 2024

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.

@dcharkes dcharkes added this to the Native Assets v1.1 milestone Aug 30, 2024
@dcharkes
Copy link
Collaborator Author

dcharkes commented Oct 1, 2024

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. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request package:hooks_runner
Projects
None yet
Development

No branches or pull requests

2 participants