Skip to content
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

publishLocal should be cached (publishLocalCached) #2975

Closed
lefou opened this issue Jan 16, 2024 · 1 comment · Fixed by #2976
Closed

publishLocal should be cached (publishLocalCached) #2975

lefou opened this issue Jan 16, 2024 · 1 comment · Fixed by #2976

Comments

@lefou
Copy link
Member

lefou commented Jan 16, 2024

Since publishLocal is local, it can be cached. With PathRef.revalidate Mill can detect, whether a cached target pointing to files outside of it's cache region is still valid. For that to work, all published files need to be returned as PathRef with enabled revalidation flag.

This would be a binary incompatible change, hence a intermediate API like publishLocalCached could be added.

@lefou
Copy link
Member Author

lefou commented Jan 16, 2024

The main use case which will be enabled with this feature, would be the local provision of some dependencies, which are consumed via coursier, but are not remotely available. This is often the case when OSGi bundles of thirdparty dependencies are needed but not available. Without this feature, a dedicated provision step needs to be run now and then. But adding it the the dependencies is too costly, due to the fact that publishLocal is a command, which always runs. Since a cached version will not need to run if the files are already in place, those provision steps can be added to the permanent dependencies of their consumers, and there is no need to run the extra manual tasks.

@lefou lefou changed the title publishLocal can be cached publishLocal can be cached (publishLocalCached) Jan 16, 2024
@lefou lefou changed the title publishLocal can be cached (publishLocalCached) publishLocal should be cached (publishLocalCached) Jan 16, 2024
lefou added a commit that referenced this issue Jan 22, 2024
The new targets are cached and invalidate properly when the target files
(which are outside of Mills cache folder) are changed or removed from
the repository cache, as the `PathRef.revalidate` flag is used and
enforced by Mill.

Fix #2975

Pull request: #2976
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant