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/tools: multiple tests consistently failing on "-nocgo" builders #39131

Closed
bcmills opened this issue May 18, 2020 · 6 comments
Closed

x/tools: multiple tests consistently failing on "-nocgo" builders #39131

bcmills opened this issue May 18, 2020 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented May 18, 2020

2020-05-18T17:24:58-c79c01b/darwin-amd64-nocgo
2020-05-18T17:24:58-c79c01b/linux-amd64-nocgo
2020-05-18T17:24:58-c79c01b/linux-ppc64-buildlet
2020-05-18T17:24:58-c79c01b/plan9-386-0intro
2020-05-18T17:24:58-c79c01b/plan9-arm

linux-amd64-nocgo at f296b7a6f045325a230f77e9bda1470b1270f817 building tools at c79c01b1c51c468123f4890fb7190cda24a42eb2

…
--- FAIL: TestGeneratedFiles (0.07s)
    gorename_test.go:33: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
FAIL
FAIL	golang.org/x/tools/cmd/gorename	0.078s
…
--- FAIL: TestCgoNoSyntax (0.04s)
    --- FAIL: TestCgoNoSyntax/GOPATH (0.02s)
        packagescgo_test.go:74: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
    --- FAIL: TestCgoNoSyntax/Modules (0.02s)
        packagescgo_test.go:74: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
--- FAIL: TestCgoBadPkgConfig (0.05s)
    --- FAIL: TestCgoBadPkgConfig/GOPATH (0.01s)
        packagescgo_test.go:115: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
    --- FAIL: TestCgoBadPkgConfig/Modules (0.04s)
        packagescgo_test.go:115: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
FAIL
FAIL	golang.org/x/tools/go/packages	75.708s
…
--- FAIL: TestLSP (11.78s)
    --- FAIL: TestLSP/GOPATH (5.68s)
        --- FAIL: TestLSP/GOPATH/testdata/lsp (3.52s)
            --- FAIL: TestLSP/GOPATH/testdata/lsp/Completion (2.37s)
                --- FAIL: TestLSP/GOPATH/testdata/lsp/Completion/declarecgo_nocgo_6_12_0 (0.03s)
                    lsp_test.go:99: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestLSP/GOPATH/testdata/lsp/Completion/usecgo_8_8_0 (0.01s)
                    lsp_test.go:99: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
            --- FAIL: TestLSP/GOPATH/testdata/lsp/Definition (0.04s)
                --- FAIL: TestLSP/GOPATH/testdata/lsp/Definition/declarecgo_nocgo_6_12 (0.01s)
                    lsp_test.go:99: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestLSP/GOPATH/testdata/lsp/Definition/usecgo_8_8 (0.02s)
                    lsp_test.go:99: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
    --- FAIL: TestLSP/Modules (6.10s)
        --- FAIL: TestLSP/Modules/testdata/lsp (2.65s)
            --- FAIL: TestLSP/Modules/testdata/lsp/Completion (1.25s)
                --- FAIL: TestLSP/Modules/testdata/lsp/Completion/declarecgo_nocgo_6_12_0 (0.01s)
                    lsp_test.go:99: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestLSP/Modules/testdata/lsp/Completion/usecgo_8_8_0 (0.01s)
                    lsp_test.go:99: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
            --- FAIL: TestLSP/Modules/testdata/lsp/Definition (0.04s)
                --- FAIL: TestLSP/Modules/testdata/lsp/Definition/usecgo_8_8 (0.02s)
                    lsp_test.go:99: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestLSP/Modules/testdata/lsp/Definition/declarecgo_nocgo_6_12 (0.01s)
                    lsp_test.go:99: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
FAIL
FAIL	golang.org/x/tools/internal/lsp	11.844s
…
--- FAIL: TestCommandLine (20.89s)
    --- FAIL: TestCommandLine/GOPATH (9.94s)
        --- FAIL: TestCommandLine/GOPATH/testdata/lsp (8.77s)
            --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Completion (0.08s)
                --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Completion/declarecgo_nocgo_6_12_0 (0.04s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Completion/usecgo_8_8_0 (0.03s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
            --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Definition (0.48s)
                --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Definition/declarecgo_nocgo_6_12 (0.05s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Definition/usecgo_8_8 (0.04s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
    --- FAIL: TestCommandLine/Modules (10.95s)
        --- FAIL: TestCommandLine/Modules/testdata/lsp (9.26s)
            --- FAIL: TestCommandLine/Modules/testdata/lsp/Completion (0.06s)
                --- FAIL: TestCommandLine/Modules/testdata/lsp/Completion/declarecgo_nocgo_6_12_0 (0.02s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestCommandLine/Modules/testdata/lsp/Completion/usecgo_8_8_0 (0.03s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
            --- FAIL: TestCommandLine/Modules/testdata/lsp/Definition (0.41s)
                --- FAIL: TestCommandLine/Modules/testdata/lsp/Definition/declarecgo_nocgo_6_12 (0.03s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestCommandLine/Modules/testdata/lsp/Definition/usecgo_8_8 (0.04s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
FAIL
FAIL	golang.org/x/tools/internal/lsp/cmd	21.277s
…
--- FAIL: TestSource (13.38s)
    --- FAIL: TestSource/GOPATH (7.34s)
        --- FAIL: TestSource/GOPATH/testdata/lsp (4.61s)
            --- FAIL: TestSource/GOPATH/testdata/lsp/Completion (1.65s)
                --- FAIL: TestSource/GOPATH/testdata/lsp/Completion/usecgo_8_8_0 (0.02s)
                    source_test.go:85: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestSource/GOPATH/testdata/lsp/Completion/declarecgo_nocgo_6_12_0 (0.03s)
                    source_test.go:85: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
            --- FAIL: TestSource/GOPATH/testdata/lsp/Definition (0.12s)
                --- FAIL: TestSource/GOPATH/testdata/lsp/Definition/usecgo_8_8 (0.01s)
                    source_test.go:85: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestSource/GOPATH/testdata/lsp/Definition/declarecgo_nocgo_6_12 (0.02s)
                    source_test.go:85: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
    --- FAIL: TestSource/Modules (6.04s)
        --- FAIL: TestSource/Modules/testdata/lsp (3.39s)
            --- FAIL: TestSource/Modules/testdata/lsp/Completion (1.61s)
                --- FAIL: TestSource/Modules/testdata/lsp/Completion/usecgo_8_8_0 (0.05s)
                    source_test.go:85: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestSource/Modules/testdata/lsp/Completion/declarecgo_nocgo_6_12_0 (0.01s)
                    source_test.go:85: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
            --- FAIL: TestSource/Modules/testdata/lsp/Definition (0.06s)
                --- FAIL: TestSource/Modules/testdata/lsp/Definition/declarecgo_nocgo_6_12 (0.01s)
                    source_test.go:85: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestSource/Modules/testdata/lsp/Definition/usecgo_8_8 (0.01s)
                    source_test.go:85: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
FAIL
FAIL	golang.org/x/tools/internal/lsp/source	13.418s
…
--- FAIL: TestCommandLine (16.10s)
    --- FAIL: TestCommandLine/GOPATH (7.85s)
        --- FAIL: TestCommandLine/GOPATH/testdata/lsp (7.52s)
            --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Completion (0.01s)
                --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Completion/declarecgo_nocgo_6_12_0 (0.00s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Completion/usecgo_8_8_0 (0.00s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
            --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Definition (1.15s)
                --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Definition/declarecgo_nocgo_6_12 (0.00s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestCommandLine/GOPATH/testdata/lsp/Definition/usecgo_8_8 (0.00s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
    --- FAIL: TestCommandLine/Modules (8.25s)
        --- FAIL: TestCommandLine/Modules/testdata/lsp (7.60s)
            --- FAIL: TestCommandLine/Modules/testdata/lsp/Completion (0.02s)
                --- FAIL: TestCommandLine/Modules/testdata/lsp/Completion/declarecgo_nocgo_6_12_0 (0.00s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestCommandLine/Modules/testdata/lsp/Completion/usecgo_8_8_0 (0.00s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
            --- FAIL: TestCommandLine/Modules/testdata/lsp/Definition (1.27s)
                --- FAIL: TestCommandLine/Modules/testdata/lsp/Definition/declarecgo_nocgo_6_12 (0.00s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
                --- FAIL: TestCommandLine/Modules/testdata/lsp/Definition/usecgo_8_8 (0.00s)
                    cmdtest.go:59: cgo tool not available: cgo not enabled: CGO_ENABLED="0"
FAIL
FAIL	golang.org/x/tools/gopls/test	16.184s
FAIL

This particular failure mode seems to start at CL 234108, but many of the same tests were already failing (with a different failure mode) before then.

CC @heschik @stamblerre

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 18, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label May 18, 2020
@gopherbot gopherbot added this to the Unreleased milestone May 18, 2020
@heschi
Copy link
Contributor

heschi commented May 18, 2020

Cool. At least it's common code now!

I can add some cases to allowMissingTool. Presumably the -nocgo means cgo shouldn't work. Do you know what the deal is with the other three?

@bcmills
Copy link
Contributor Author

bcmills commented May 18, 2020

They might just not support linking Go with C at all.

@bcmills
Copy link
Contributor Author

bcmills commented May 18, 2020

(You could check for that by running go env CGO_ENABLED with the variable CGO_ENABLED explicitly set to the empty string in the environment.)

@bcmills
Copy link
Contributor Author

bcmills commented May 18, 2020

Hmm, CGO_ENABLED='' go env CGO_ENABLED doesn't always work if the user set it via go env -w CGO_ENABLED=0.

But perhaps the tests should be skipped then anyway: most of the reason we have builders and TryBots in the first place is to catch configurations that differ from that of the CL author, so (assuming we're consistently watching for builder failures) it's not all that important to force every developer to test with all of them locally too.

@millerresearch
Copy link
Contributor

... Presumably the -nocgo means cgo shouldn't work. Do you know what the deal is with the other three?

There's no cgo on Plan 9. No gcc either.

@gopherbot
Copy link

Change https://golang.org/cl/234479 mentions this issue: internal/testenv: tolerate missing cgo as needed

@golang golang locked and limited conversation to collaborators May 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants