-
Notifications
You must be signed in to change notification settings - Fork 127
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
Unexpected behavior of missing/changed task inputs
and outputs
#1139
Comments
Oh, and got a bit wrapped around the form input: thanks for |
He @bollwyvl, very nice issue report! I think there is a misunderstanding of the feature of [tasks.build]
inputs = ["build/preflight.txt"]
outputs = ["build/built.txt"]
cwd = "build"
cmd = """
cat preflight.txt > built.txt
&& sleep 1
&& echo "$(date) built" >> built.txt
"""
depends_on = ["preflight"] # <<<
[tasks.test]
inputs = ["build/built.txt"]
outputs = ["build/test.txt"]
cwd = "build"
cmd = """
rm -f test.txt
&& cat built.txt > test.txt
&& sleep 1
&& echo "$(date) tested" >> test.txt
"""
depends_on = ["build"] # <<< Adding these two depends on creates the required graph. Ps. I like the idea to generate mermaid graphs from the task definitions. 🤩 |
Ok, adding the explicit diff --git a/pixi.toml b/pixi.toml
index dece1d5..d2aca77 100644
--- a/pixi.toml
+++ b/pixi.toml
@@ -17,6 +17,7 @@ cmd = """
"""
[tasks.build]
+depends_on = ["preflight"]
inputs = ["build/preflight.txt"]
outputs = ["build/built.txt"]
cwd = "build"
@@ -27,6 +28,7 @@ cmd = """
"""
[tasks.test]
+depends_on = ["build"]
inputs = ["build/built.txt"]
outputs = ["build/test.txt"]
cwd = "build"
@@ -38,4 +40,4 @@ cmd = """
""" And running... pixi build Then... pixi run clean
pixi run test Yields... ✨ Pixi task (default): mkdir -p build
&& cd build
&& echo "$(date) preflight" > preflight.txt
&& echo "$(date) preflight extra" > preflight-extra.txt
Task can be skipped (cache hit) 🚀
✨ Pixi task (default): cat preflight.txt > built.txt
&& sleep 1
&& echo "$(date) built" >> built.txt
Task can be skipped (cache hit) 🚀
✨ Pixi task (default): rm -f test.txt
&& cat built.txt > test.txt
&& sleep 1
&& echo "$(date) tested" >> test.txt
Task can be skipped (cache hit) 🚀 ...Does not invalidate the graph, and it still thinks everything is fine. It can't be forced to actually run any of the tasks without digging into the It's also surprising that while there are a lot of emoji emitted, as well as the full body of the task, the name of the task running does not appear. My goal (ha) is to for the time one person takes to capture the task dependency information in a
Some other things that would be lovely that a rock-solid graph can provide:
Having to apply another task tool provisioned by pixi, but defined in another file would make things... even more confusing.
As for mermaid: sure, it's really quite nice, and getting more portable. More, in that sadly the github renderer doesn't yet support the elkjs backend, which can do some really nice things at scale: |
I agree with you, this output or yours seems a bug. For me it does run the Pinging @wolfv to ask for an explanation on the current design. |
I see today's release 🚀 has a
|
Looking a bit at |
Point taken regarding not logging the skipped task name. I debugged this and the main issue is that we take into account the If you change your pixi.toml to:
Things start to work. Now, I am not sure what we should do ... use the Lastly, we should warn the user when the globset didn't match anything at all so that they can further debug. If inputs or outputs are specified, it can be expected that the user meant to select something. |
Nice, #1202 looks like a good update, and dropping the Regarding some of the debugging: having a way to introspect from the CLI would be super helpful with e.g. |
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.Reproducible example
But fails in unexpected ways with most other invocations:
Expected behavior
I guess my mental model of
inputs
andoutputs
is something like, given theabove graph:
Where deleting a file would either mark a task as directly invalidated (❌)
or indeterminate (❓), since the parent state is unknown:
preflight
build
test
clean
pixi.toml
preflight.txt
preflight-extra.txt
built.txt
test.txt
Running a goal task would first ensure all of the parent tasks were valid, and not even bother checking e.g.
cwd
.I also see
depends_on
is a thing, but requires double-encoding of both a concrete file name and a semantic name feels very unsatisfying.The text was updated successfully, but these errors were encountered: