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

Dependency-tracking phony/pure tasks with no output files #2621

Open
quodlibetor opened this issue Sep 21, 2024 · 2 comments
Open

Dependency-tracking phony/pure tasks with no output files #2621

quodlibetor opened this issue Sep 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@quodlibetor
Copy link

There are some tasks that don't create deterministic file system outputs (e.g. building docker images) but still have deterministic sources that define when they should be built.

I regularly make tasks that touch a file after success and use that file as the output to avoid unnecessary work in the future. It would, though, be really nice if I could tell mise that task outputs are "pure but non-existent" and have it manage the dependency tracking infrastructure for me.

@quodlibetor quodlibetor added the enhancement New feature or request label Sep 21, 2024
@jdx
Copy link
Owner

jdx commented Sep 23, 2024

I don't think I understand this. mise compares the input and the output to know whether or not something should be run. If there is no output, it would run it every time and be equivalent to not specifying any inputs at all.

@quodlibetor
Copy link
Author

Yes, that makes sense, I didn't want to describe an implementation in the feature request, but to make it more clear:

What I was imagining is that it would be possible to state that a task is pure (instead of specifying outputs):

[tasks."build:docker"]
run = "docker build src"
sources = "src/**"
pure = true

as this is marked as pure, mise would track the last-build time for task.build:docker (maybe by creating a file in ~/.cache/mise/task-times/task.build:docker, maybe by doing something else) and only re-run it if any of the sources are newer than that tracked time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants