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

cmd/go: TestScript/mod_doc_path and TestScript/cgo_stale_precompiled fail on AIX builder #66344

Closed
cherrymui opened this issue Mar 15, 2024 · 6 comments
Assignees
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-AIX
Milestone

Comments

@cherrymui
Copy link
Member

cherrymui commented Mar 15, 2024

cmd/go's TestScript/mod_doc_path and TestScript/cgo_stale_precompiled tests seem to fail consistently on the AIX builder since 412623c. E.g. https://build.golang.org/log/6fdbe2ef5c0c6420976d91752c2dfe135de43d32

--- FAIL: TestScript (0.18s)
    --- FAIL: TestScript/mod_doc_path (0.30s)
        script_test.go:136: 2024-03-15T20:06:34Z
        script_test.go:138: $WORK=/ramdisk8GB/workdir-host-aix-ppc64-osuosl/tmp/cmd-go-test-3850493464/tmpdir1302838300/mod_doc_path1258781541
        script_test.go:160: 
            # cmd/doc should use GOROOT to locate the 'go' command,
            # not use whatever is in $PATH.
            # Remove 'go' from $PATH. (It can still be located via $GOROOT/bin/go, and the
            # test script's built-in 'go' command still knows where to find it.) (0.111s)
            > env PATH=''
            > [GOOS:plan9] env path=''
            [condition not met]
            > go doc p.X
            [stderr]
            file does not exist
        script_test.go:160: FAIL: testdata/script/mod_doc_path.txt:9: go doc p.X: exit status 1
        script_test.go:415: go was invoked but no counters were incremented
    --- FAIL: TestScript/cgo_stale_precompiled (1.04s)
        script_test.go:136: 2024-03-15T20:07:09Z
        script_test.go:138: $WORK=/ramdisk8GB/workdir-host-aix-ppc64-osuosl/tmp/cmd-go-test-3850493464/tmpdir1302838300/cgo_stale_precompiled3412859766
        script_test.go:160: 
            # Regression test for https://go.dev/issue/47215 and https://go.dev/issue/50183:
            # A missing $CC caused the C dependencies of the net
            # package to appear stale, and it could not be rebuilt due to a missing $CC. (0.012s)
            # This test may start with the runtime/cgo package already stale.
            # Explicitly rebuild it to ensure that it is cached.
            # (See https://go.dev/issue/50892.)
            #
            # If running in non-short mode, explicitly vary CGO_CFLAGS
            # as a control case (to ensure that our regexps do catch rebuilds). (0.643s)
            # https://go.dev/issue/47215: a missing $(go env CC) caused the precompiled net
            # to be stale. But as of https://go.dev/cl/452457 the precompiled libraries are
            # no longer installed anyway! Since we're requiring a C compiler in order to
            # build and use cgo libraries in the standard library, we should make sure it
            # matches what's in the cache. (0.241s)
            > [abscc] stop
            [condition not met]
            > env CGO_ENABLED=1
            > env CC=''
            > [!GOOS:plan9] env PATH=''  # Guaranteed not to include $(go env CC)!
            > [GOOS:plan9] env path=''
            [condition not met]
            > ! go build -x runtime/cgo
            [stderr]
            file does not exist
            [exit status 1]
            > stderr 'C compiler .* not found'
        script_test.go:160: FAIL: testdata/script/cgo_stale_precompiled.txt:32: stderr 'C compiler .* not found': no match for `(?m)C compiler .* not found` in stderr

Commit 412623c doesn't seem related.
The builder also fails on the previous commit d45e8bf (CL https://go.dev/cl/571096), with a probably flaky runtime failure, which might mask out the cmd/go failures. This commit seems more likely related.

cc @matloob @hyangah @golang/aix

@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 15, 2024
@cherrymui cherrymui added this to the Backlog milestone Mar 15, 2024
@ayappanec
Copy link

I just verified that the failure is because of the commit d45e8bf (CL https://go.dev/cl/571096)

@matloob
Copy link
Contributor

matloob commented Mar 18, 2024

@ayappanec Thanks for verifying! I'm planning to take a look at this on the gomotes tomorrow.

@matloob matloob self-assigned this Mar 19, 2024
@matloob
Copy link
Contributor

matloob commented Mar 19, 2024

So this seems to be related to the fact that on AIX the code in os/executable_path.go checks PATH to reconstruct the executable path (which we use to start the telemetry sidecar) but the test unsets PATH.

Will continue to investigate

@ayappanec
Copy link

@matloob Any update on this ?

@matloob
Copy link
Contributor

matloob commented Mar 26, 2024

Hi, sorry I'm still looking at this. I'm trying to figure out what the best thing to do is when we don't have go in our path: to route GOROOT/bin in to telemetry.Start, or to avoid starting the child when we can't find os.Executable

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/575575 mentions this issue: cmd: update and vendor golang.org/x/telemetry@3640ba5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-AIX
Projects
None yet
Development

No branches or pull requests

4 participants