-
Notifications
You must be signed in to change notification settings - Fork 356
Closed
Labels
enhancementNew featuresNew features
Description
Problem description
As of pixi 0.55.0
(and probably earlier), two "leaf" tasks may depends-on
the
same "template" tasks in the same environment, inputs
, and outputs
, but with
different arg
values. As only the environment name and file hashes seem to have an
impact, running the leaf tasks interleaved appears to always encounter a cache miss,
and the tasks always run.
Consider a template task that calls a linter/formatter tool like ruff
, which
always considers the same python files.
dependencies.ruff = "*"
[tasks]
touch = """echo 'print("hello world")' > foo.py"""
fix.depends-on = [{task="_ruff", args=["1"]}]
lint.depends-on = ["_ruff"]
_ruff = {args = [{arg="fix", default=""}], inputs = ["*.py"], cmd = """
ruff format {{ "--check" if not fix }} && ruff check {{ "--fix-only" if fix }}
"""}
[project]
name = "foo"
platforms = ["linux-64", "osx-arm64", "win-64"]
channels = ["conda-forge"]
Then:
pixi r touch
pixi r fix && pixi r lint # expect to see run...
pixi r fix && pixi r lint # ... expect to see a cache hit
No amount of doing this will cause the cache to "settle".
design ideas
I think it might be a matter of adding the task args to the hash file name.
Will try a PR.
Metadata
Metadata
Assignees
Labels
enhancementNew featuresNew features