-
Notifications
You must be signed in to change notification settings - Fork 302
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
tools/flow: task deps lost when more than one level "deep" #2517
Comments
Can you confirm whether this bug exists in v0.5.0? |
Yes. but only test with With api in my tool https://github.com/octohelm/wagon, it works well. |
If there is a regression in CUE's Go API, can you please share a reproducer with it that succeeds with v0.5.0 but fails with v0.6.0-rc.1? |
@mvdan Another usage case like: Work well with package test
import (
"tool/cli"
"tool/exec"
)
version: #Version & {}
command: build: #Build & {
script: "echo \(version.output)"
}
command: print: cli.Print & {
text: command.build.output
}
#Build: {
script: string
_run: exec.Run & {
cmd: script
stdout: string
}
output: _run.stdout
}
#Version: {
_run: exec.Run & {
cmd: "echo v1.0.0"
stdout: string
}
output: _run.stdout
} |
If a reproducer failed with v0.5.0 but works with v0.6.0-rc.1, that's a good thing, no? We mainly want to be aware of any regressions since v0.5.0, as those are something to look at before we tag the final v0.6.0. |
This project could be show the case, https://github.com/octohelm/wagon on branch WAGON_GRAPH=1 make wagon.debug You could see the the replace with the patch just disable this from Once I upgrade to require (
cuelang.org/go v0.6.0-rc.1 // both remove the replace
github.com/octohelm/cuemod v0.7.0 // just some api bump
) the Other deps missing cause by #2516 |
Simplier testcase
@mvdan it could pass when |
@morlay thanks for the report. It was a little hard to pin down exactly what you did to trigger the problem but I think I have now down so in the following. What did you do?
What did you expect to see?A passing test. This passes with v0.5.0 What did you see instead?
i.e. the dependency from This bisects to https://cuelang.org/cl/556460 Also noting that the docs for
But a cursory glance at the code does not show the value of |
@morlay I've just merged a fix for this issue, and we're fairly sure that your other tools/flow issue had the same underlying cause so it should be fixed as well. Could you please try the latest master version in your Go code and confirm whether or not the fixes work for you? |
@mvdan flow.New hangs with "v0.6.0" 😭 https://github.com/octohelm/wagon/blob/main/pkg/engine/plan/runner.go#L220-L226 f := flow.New(
&flow.Config{
FindHiddenTasks: true,
},
cueValue,
noOpRunner,
) |
Ah, that's unfortunate. Could you please file a new issue following the bug template? Ideally with a self-contained reproducer, and a git bisect so we can tell what was the last CUE version to work correctly. |
@myitcv I will try log in Seems cause the repeated
|
when I added some map to avoid the loop hangs. visited := map[dep.Dependency]bool{}
dep.Visit(cfg, c.opCtx, n, func(d dep.Dependency) error {
if visited[d] {
return nil
}
visited[d] = true
// ...
}) will got error
|
Please don't try to fix it, these bugs tend to be hard to investigate and fix. The priority is a way for us to reproduce the bug - see my previous comment. |
@mvdan not try to fix it. just debug to locate where cause the issue. My cuepkg contains code like, which may not correctly since ship?: #Ship
if ship != _|_ {
ship: "auths": auths
ship: "mirror": mirror
} Once I upgrade this, everything works well. |
@morlay what is the |
if some ship fields defined, actions: go: #Project & {
ship: {
dest: "image_name"
}
} The ship tasks will be enabled (then merge Here an example in my release project: "webapp" and "go" both base the "go" tasks need $ wagon do
Allowed action:
go
go archive [--output=<dir>]
go build
go build "darwin/amd64" [--output=<path_to_oci_tar>]
go build "darwin/arm64" [--output=<path_to_oci_tar>]
go build "linux/amd64" [--output=<path_to_oci_tar>]
go build "linux/arm64" [--output=<path_to_oci_tar>]
go ship
go ship "push/linux/amd64" Push <arch> suffix image
go ship "push/linux/arm64" Push <arch> suffix image
go ship "push/x" Merge pushed arch suffix images into mutli-arch image
go ship push amd64 Push <arch> suffix image
go ship push arm64 Push <arch> suffix image
go ship push x Merge pushed arch suffix images into mutli-arch image
go ship pushx Push all images as multi-arch images
go source [--output=<dir>]
webapp build [--output=<dir>]
webapp build image [--output=<path_to_oci_tar>]
webapp source [--output=<dir>] If I want keep this feature, I could to write like this instead.
|
Yes, exactly what I was going to suggest. #943 will thankfully make this use of |
Yes. it is much clear. |
This reverts commit 9ef35eb but keeps the `cmd_undefined` test case and adds a new test case (very similar to the test case for #2517) that illustrates the way that the reverted commit fails. That commit introduced a regression that caused existing tools/flow uses to fail. See https://cuelang.org/issue/2965. A subsequent CL will apply a different fix for #1581. For #2965. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I322ac3b269bc79a541c15001a166160ad9191267
This reverts commit 9ef35eb but keeps the `cmd_undefined` test case and adds a new test case (very similar to the test case for #2517) that illustrates the way that the reverted commit fails. That commit introduced a regression that caused existing tools/flow uses to fail. See https://cuelang.org/issue/2965. A subsequent CL will apply a different fix for #1581. For #2965. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I322ac3b269bc79a541c15001a166160ad9191267 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1185281 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
This reverts commit 9ef35eb but keeps the `cmd_undefined` test case and adds a new test case (very similar to the test case for #2517) that illustrates the way that the reverted commit fails. That commit introduced a regression that caused existing tools/flow uses to fail. See https://cuelang.org/issue/2965. A subsequent CL will apply a different fix for #1581. For #2965. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I322ac3b269bc79a541c15001a166160ad9191267 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1185281 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> (cherry picked from commit ea385fd)
This reverts commit 9ef35eb but keeps the `cmd_undefined` test case and adds a new test case (very similar to the test case for #2517) that illustrates the way that the reverted commit fails. That commit introduced a regression that caused existing tools/flow uses to fail. See https://cuelang.org/issue/2965. A subsequent CL will apply a different fix for #1581. For #2965. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I322ac3b269bc79a541c15001a166160ad9191267 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1185281 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> (cherry picked from commit ea385fd) Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1190978 Reviewed-by: Paul Jolly <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes
What did you do?
Use task output as others' int
What did you expect to see?
version
->command.build
->command.print
What did you see instead?
version
not be as deps ofcommand.build
and not executeThe text was updated successfully, but these errors were encountered: