Skip to content
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

x/build/cmd/golangbuild: possibility of false-negatives in detecting successful command execution #61960

Closed
dmitshur opened this issue Aug 11, 2023 · 2 comments
Assignees
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Aug 11, 2023

I spotted it's sometimes possible for a build to have steps with errors in the log, yet the exit code unexpectedly ended up being 0.

For example, in https://ci.chromium.org/b/8773129168948219089, unchecking "Hide Succeeded Steps" shows the "test golang.org/x/pkgsite module for android/amd64" build step as successful, yet clicking into its output log shows many cgo-related errors like:

 # golang.org/x/pkgsite/devtools/cmd/csphash.test
 loadinternal: cannot find runtime/cgo

It ends with "exiting with 0" as opposed to a non-zero exit code as usual (e.g., this failed step ends with "exiting with 1" as expected).

The problem may be directly in golangbuild itself or in one of the components it was invoking during that build step.

CC @golang/release, @mknyszek.

@dmitshur dmitshur added Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 11, 2023
@dmitshur dmitshur added this to the Unreleased milestone Aug 11, 2023
@dmitshur dmitshur self-assigned this Aug 11, 2023
@dmitshur
Copy link
Contributor Author

dmitshur commented Aug 11, 2023

Looks like the bug is in an underlying component, the go command. I can reproduce on a Linux machine with:

$ go version
go version go1.21.0 linux/amd64
$ GOOS=android GOARCH=amd64 go test -json -c -o=/dev/null ./...
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading cloud.google.com/go/storage v1.18.2
go: downloading golang.org/x/net v0.13.0
[...]
{"Time":"2023-08-11T17:24:59.434296396Z","Action":"start","Package":"golang.org/x/pkgsite/cmd/frontend"}
{"Time":"2023-08-11T17:24:59.434426674Z","Action":"output","Package":"golang.org/x/pkgsite/cmd/frontend","Output":"?   \tgolang.org/x/pkgsite/cmd/frontend\t[no test files]\n"}
{"Time":"2023-08-11T17:24:59.434466057Z","Action":"skip","Package":"golang.org/x/pkgsite/cmd/frontend","Elapsed":0}
{"Time":"2023-08-11T17:24:59.434803653Z","Action":"start","Package":"golang.org/x/pkgsite/cmd/internal/cmdconfig"}
{"Time":"2023-08-11T17:24:59.43493743Z","Action":"output","Package":"golang.org/x/pkgsite/cmd/internal/cmdconfig","Output":"?   \tgolang.org/x/pkgsite/cmd/internal/cmdconfig\t[no test files]\n"}
[...]
# golang.org/x/pkgsite/internal/vuln.test
loadinternal: cannot find runtime/cgo
# golang.org/x/pkgsite/internal/worker.test
loadinternal: cannot find runtime/cgo
# golang.org/x/pkgsite/internal/testing/integration.test
loadinternal: cannot find runtime/cgo
$ echo $?
0

I'll narrow it down a bit more and file a separate bug for cmd/go. Edit: Filed #62123.

@dmitshur
Copy link
Contributor Author

We discussed this and plan to let the fix land in the affected component. Nothing to do in golangbuild.

@dmitshur dmitshur closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Archived in project
Development

No branches or pull requests

1 participant