-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
Generalize target invalidation logic #3706
Comments
Would a |
Maybe we need a |
@lihaoyi Do you mean to decide inside the input task whether the heavy work needs to be done and do it conditionally? This might be doable when we make |
The charm of the current |
Yes that's what I meant. I don't mind adding standardized helpers, just trying to understand what the underlying primitives. Just like |
The |
That's possible. The way |
Mill target invalidation works reasonable under the assumption that all outputs are cached in the Mill cache (e.g. the
out/
dir). Sometimes it's necessary to point to things outside of Mill's cache. Some use cases include:docker
Whenever we want to refer to something outside of Mill's cache, we are either forced to use commands, which are not cached or use cached tasks which risk to get stale. To prohibit such situations we already added the
PathRef.revalidate
flag, which ensures that cached tasks returningPathRef
s can detect if their cached value is invalid, to invalidate itself. We use this to properly detect cache evictions of coursier.To make Mill even more versatile, we should have a general concept to invalidate cached targets with user provided logic. E.g. to avoid to build a upstream docker container each time, we want to use a cached task. But since we can't point to exact file locations, we have no idea if the container is still valid. If we had some check logic to run, it could just query the docker registry and give a quick response.
In PR #3617 we introduced a new way to tag tasks.
We could introduce some new
validate
tag, which either contains a closure to check or points to a companion task that does the check for us. I think we need to experiment and thinker a bit, before we find the best approach.The text was updated successfully, but these errors were encountered: