Skip to content

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

Not planned
@dmitshur

Description

@dmitshur

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.

Activity

added
Buildersx/build issues (builders, bots, dashboards)
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Aug 11, 2023
added this to the Unreleased milestone on Aug 11, 2023
self-assigned this
on Aug 11, 2023
moved this to In Progress in Go Releaseon Aug 11, 2023
dmitshur

dmitshur commented on Aug 11, 2023

@dmitshur
MemberAuthor

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

dmitshur commented on Aug 22, 2023

@dmitshur
MemberAuthor

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

moved this from In Progress to Done in Go Releaseon Aug 22, 2023
locked and limited conversation to collaborators on Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Buildersx/build issues (builders, bots, dashboards)FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Type

No type

Projects

Status

Done

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @dmitshur@gopherbot

      Issue actions

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