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
cmd/cue: incorrect cyclic task dependency error #3108
Labels
Comments
Catched another incorrect snippet. Unfortunately this time I'm out of luck. ❯ cue cmd test
cyclic task dependency:
task command.test.s2 refers to
task command.test.s3 refers to
task command.test.s2:
./test_tool.cue:7:26 package main
import (
"tool/exec"
)
command: test: [string]: exec.Run
command: test: X={
let tasks = [
{cmd: "echo a"},
{cmd: "echo 1"},
{cmd: "echo 2", $dep: [0]},
{cmd: "echo 3", $dep: [0]},
{cmd: "echo 4", $dep: [0]},
{cmd: "echo 5", $dep: [0]},
{cmd: "echo z", $dep: [1, 2, 3, 4, 5]},
]
for i, v in tasks {
"s\(i+1)": v & {
if i != 0 {
let p = (v.$dep & [...int]) != _|_
if p {
$after: [for i in v.$dep {X["s\(i+1)"]}]
}
if !p {
$after: [X["s\(i)"]]
}
}
}
}
}
❯ cue eval - < test_tool.cue
command: {
test: {
s1: {
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}
s2: {
$id: "tool/exec.Run"
cmd: "echo 1"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
mustSucceed: true
}
s3: {
$id: "tool/exec.Run"
cmd: "echo 2"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
$dep: [0]
mustSucceed: true
}
s4: {
$id: "tool/exec.Run"
cmd: "echo 3"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
$dep: [0]
mustSucceed: true
}
s5: {
$id: "tool/exec.Run"
cmd: "echo 4"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
$dep: [0]
mustSucceed: true
}
s6: {
$id: "tool/exec.Run"
cmd: "echo 5"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
$dep: [0]
mustSucceed: true
}
s7: {
$id: "tool/exec.Run"
cmd: "echo z"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo 1"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
mustSucceed: true
}, {
$id: "tool/exec.Run"
cmd: "echo 2"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
$dep: [0]
mustSucceed: true
}, {
$id: "tool/exec.Run"
cmd: "echo 3"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
$dep: [0]
mustSucceed: true
}, {
$id: "tool/exec.Run"
cmd: "echo 4"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
$dep: [0]
mustSucceed: true
}, {
$id: "tool/exec.Run"
cmd: "echo 5"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
$after: [{
$id: "tool/exec.Run"
cmd: "echo a"
env: {} | []
stdout: null
stderr: null
stdin: null
success: bool
mustSucceed: true
}]
$dep: [0]
mustSucceed: true
}]
$dep: [1, 2, 3, 4, 5]
mustSucceed: true
}
}
} |
networkhermit
changed the title
cmd/cue: wrong cyclic task dependency error
cmd/cue: incorrect cyclic task dependency error
May 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes.
What did you do?
cue cmd test
P.S.
The comments in the above code point two modifications which won't trigger the cyclic error.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: