Open morlay opened 1 year ago
Here's a simpler example that demonstrates the issue:
exec cue cmd test
cmp stdout want-stdout
-- want-stdout --
ok
-- cue.mod/module.cue --
module: "example.com"
-- foo_tool.cue --
package foo
import (
"tool/exec"
"tool/cli"
)
command: test: {
run: exec.Run & {
cmd: "mktemp -d"
stdout: string
}
showResult: cli.Print & {
$after: run
if run.success {
text: "ok"
}
}
}
I see this output:
> exec cue cmd test
[stdout]
ok
[stderr]
command.test.showResult.$after.stdout: 2 errors in empty disjunction:
command.test.showResult.$after.stdout: conflicting values "$WORK/.tmp/tmp.zDzrYp1GSu\n" and "$WORK/.tmp/tmp.PPkM3Q17vw\n":
./foo_tool.cue:14:11
command.test.showResult.$after.stdout: conflicting values string and null (mismatched types string and null):
./foo_tool.cue:9:7
./foo_tool.cue:11:11
./foo_tool.cue:14:11
tool/exec:9:13
[exit status 1]
FAIL: /tmp/testscript1136299953/x.txtar/script.txtar:1: unexpected command failure
The if
comprehension has caused the showResult
task not to show up as a task, meaning that showResult.$after
does look like a task, and gets executed, but then there's a conflict with the earlier result which has become concrete and then copied over to showResult.$after
.
v0.7.0 still have this issue
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes (v0.6.0)
What did you do?
What did you expect to see?
What did you see instead?