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/go/packages: TestTarget: "cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set" (openbsd) #70891

Open
gopherbot opened this issue Dec 18, 2024 · 49 comments · May be fixed by golang/tools#552
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@gopherbot
Copy link
Contributor

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 18, 2024
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-16 21:46 x_tools-go1.22-openbsd-amd64 tools@bf42cd7f release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)
2024-12-16 21:46 x_tools-go1.23-openbsd-amd64 tools@bf42cd7f release-branch.go1.23@59b7d407 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.21s)
2024-12-16 21:46 x_tools-go1.24-openbsd-amd64 tools@bf42cd7f release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.13s)
2024-12-16 21:46 x_tools-gotip-openbsd-amd64 tools@bf42cd7f go@236a0b4f x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)
2024-12-17 17:46 x_tools-go1.22-openbsd-amd64 tools@d3a1606b release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.25s)
2024-12-17 17:46 x_tools-go1.23-openbsd-amd64 tools@d3a1606b release-branch.go1.23@59b7d407 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)
2024-12-17 17:46 x_tools-go1.24-openbsd-amd64 tools@d3a1606b release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.22s)
2024-12-17 17:46 x_tools-gotip-openbsd-amd64 tools@d3a1606b go@8790372a x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.22s)
2024-12-17 19:35 x_tools-go1.22-openbsd-amd64 tools@28cd7188 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)
2024-12-17 19:35 x_tools-go1.23-openbsd-amd64 tools@28cd7188 release-branch.go1.23@59b7d407 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.31s)
2024-12-17 19:35 x_tools-go1.24-openbsd-amd64 tools@28cd7188 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)
2024-12-17 19:35 x_tools-gotip-openbsd-amd64 tools@28cd7188 go@95b433ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.27s)
2024-12-17 23:14 x_tools-go1.22-openbsd-amd64 tools@fcb4185e release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)
2024-12-17 23:14 x_tools-go1.23-openbsd-amd64 tools@fcb4185e release-branch.go1.23@59b7d407 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.22s)
2024-12-17 23:14 x_tools-go1.24-openbsd-amd64 tools@fcb4185e release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)
2024-12-17 23:14 x_tools-gotip-openbsd-amd64 tools@fcb4185e go@95b433ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.25s)

watchflakes

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Dec 18, 2024
@gopherbot gopherbot added this to the Unreleased milestone Dec 18, 2024
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-17 23:14 x_tools-gotip-openbsd-amd64 tools@fcb4185e go@6aa46eb7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.15s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-17 23:14 x_tools-go1.23-openbsd-amd64 tools@fcb4185e release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-18 20:17 x_tools-go1.22-openbsd-amd64 tools@88435902 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.18s)
2024-12-18 20:17 x_tools-go1.23-openbsd-amd64 tools@88435902 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.33s)
2024-12-18 20:17 x_tools-go1.24-openbsd-amd64 tools@88435902 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)
2024-12-18 20:17 x_tools-gotip-openbsd-amd64 tools@88435902 go@6aa46eb7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-18 22:11 x_tools-go1.22-openbsd-amd64 tools@74dea825 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.16s)
2024-12-18 22:11 x_tools-go1.23-openbsd-amd64 tools@74dea825 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.31s)
2024-12-18 22:11 x_tools-go1.24-openbsd-amd64 tools@74dea825 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)
2024-12-18 22:11 x_tools-gotip-openbsd-amd64 tools@74dea825 go@6aa46eb7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.21s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-18 22:11 x_tools-gotip-openbsd-amd64 tools@74dea825 go@f4e3ec3d x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-18 22:11 x_tools-gotip-openbsd-amd64 tools@74dea825 go@4f0561f9 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.30s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-19 15:58 x_tools-go1.22-openbsd-amd64 tools@dcc725c9 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.32s)
2024-12-19 15:58 x_tools-go1.23-openbsd-amd64 tools@dcc725c9 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)
2024-12-19 15:58 x_tools-go1.24-openbsd-amd64 tools@dcc725c9 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.24s)
2024-12-19 15:58 x_tools-gotip-openbsd-amd64 tools@dcc725c9 go@4f0561f9 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.40s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-19 15:58 x_tools-gotip-openbsd-amd64 tools@dcc725c9 go@cb72406c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.21s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-19 15:58 x_tools-gotip-openbsd-amd64 tools@dcc725c9 go@e63eb98e x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.25s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-19 15:58 x_tools-gotip-openbsd-amd64 tools@dcc725c9 go@669d87a9 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.24s)

watchflakes

@adonovan adonovan changed the title x/tools/go/packages: TestTarget failures [consistent failure] x/tools/go/packages: TestTarget: "cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set" (openbsd) Dec 20, 2024
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-20 18:39 x_tools-go1.24-openbsd-amd64 tools@cb7945a7 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.21s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-20 18:39 x_tools-go1.22-openbsd-amd64 tools@cb7945a7 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)
2024-12-20 18:39 x_tools-go1.23-openbsd-amd64 tools@cb7945a7 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.27s)
2024-12-20 18:39 x_tools-gotip-openbsd-amd64 tools@cb7945a7 go@669d87a9 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.22s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-20 21:24 x_tools-go1.22-openbsd-amd64 tools@ea69910e release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.26s)
2024-12-20 21:24 x_tools-go1.23-openbsd-amd64 tools@ea69910e release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.25s)
2024-12-20 21:24 x_tools-go1.24-openbsd-amd64 tools@ea69910e release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.21s)
2024-12-20 21:24 x_tools-gotip-openbsd-amd64 tools@ea69910e go@669d87a9 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)

watchflakes

@matloob
Copy link
Contributor

matloob commented Dec 20, 2024

I've been debugging this. Still not totally sure what's going on. When we check go env GOROOT to get information about the GOROOT we get a good path, but then when we run the go command in the test, it exits early because cfg.GOROOT is not set. Strange

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-20 21:44 x_tools-go1.22-openbsd-amd64 tools@8e66a043 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)
2024-12-20 21:44 x_tools-go1.23-openbsd-amd64 tools@8e66a043 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)
2024-12-20 21:44 x_tools-go1.24-openbsd-amd64 tools@8e66a043 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.22s)
2024-12-20 21:44 x_tools-gotip-openbsd-amd64 tools@8e66a043 go@669d87a9 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-20 21:44 x_tools-gotip-openbsd-amd64 tools@8e66a043 go@110ab1aa x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.15s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-21 17:57 x_tools-go1.22-openbsd-amd64 tools@ebeac1b8 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)
2024-12-21 17:57 x_tools-go1.23-openbsd-amd64 tools@ebeac1b8 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.14s)
2024-12-21 17:57 x_tools-go1.24-openbsd-amd64 tools@ebeac1b8 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.43s)
2024-12-21 17:57 x_tools-gotip-openbsd-amd64 tools@ebeac1b8 go@110ab1aa x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.33s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-21 17:57 x_tools-gotip-openbsd-amd64 tools@ebeac1b8 go@06b191e1 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-21 17:57 x_tools-gotip-openbsd-amd64 tools@ebeac1b8 go@500675a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.36s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-21 17:57 x_tools-gotip-openbsd-amd64 tools@ebeac1b8 go@05d89847 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)

watchflakes

@linsite
Copy link
Contributor

linsite commented Dec 23, 2024

I've been debugging this. Still not totally sure what's going on. When we check go env GOROOT to get information about the GOROOT we get a good path, but then when we run the go command in the test, it exits early because cfg.GOROOT is not set. Strange

it can be reproduced locally on my openbsd 7.2 VM.
openbsd# go test ./...
go: downloading golang.org/x/sync v0.10.0 go: downloading github.com/google/go-cmp v0.6.0
go: downloading golang.org/x/mod v0.22.0
--- FAIL: TestTarget (0.22s)
packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-21 17:57 x_tools-gotip-openbsd-amd64 tools@ebeac1b8 go@eef35e3b x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-23 17:52 x_tools-go1.23-openbsd-amd64 tools@b75baa00 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-23 17:52 x_tools-go1.22-openbsd-amd64 tools@b75baa00 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)
2024-12-23 17:52 x_tools-go1.24-openbsd-amd64 tools@b75baa00 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.16s)
2024-12-23 17:52 x_tools-gotip-openbsd-amd64 tools@b75baa00 go@b9955f0a x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-23 19:36 x_tools-go1.22-openbsd-amd64 tools@851152fe release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.18s)
2024-12-23 19:36 x_tools-go1.23-openbsd-amd64 tools@851152fe release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)
2024-12-23 19:36 x_tools-go1.24-openbsd-amd64 tools@851152fe release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)
2024-12-23 19:36 x_tools-gotip-openbsd-amd64 tools@851152fe go@b9955f0a x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)
2024-12-23 19:37 x_tools-go1.22-openbsd-amd64 tools@81940297 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.40s)
2024-12-23 19:37 x_tools-go1.23-openbsd-amd64 tools@81940297 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.40s)
2024-12-23 19:37 x_tools-go1.24-openbsd-amd64 tools@81940297 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.18s)
2024-12-23 19:37 x_tools-gotip-openbsd-amd64 tools@81940297 go@b9955f0a x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-23 20:01 x_tools-go1.22-openbsd-amd64 tools@3cad8592 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.25s)
2024-12-23 20:01 x_tools-go1.23-openbsd-amd64 tools@3cad8592 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.12s)
2024-12-23 20:01 x_tools-go1.24-openbsd-amd64 tools@3cad8592 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.25s)
2024-12-23 20:01 x_tools-gotip-openbsd-amd64 tools@3cad8592 go@b9955f0a x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.35s)
2024-12-23 20:01 x_tools-go1.22-openbsd-amd64 tools@93cc684c release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.27s)
2024-12-23 20:01 x_tools-go1.23-openbsd-amd64 tools@93cc684c release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.22s)
2024-12-23 20:01 x_tools-go1.24-openbsd-amd64 tools@93cc684c release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.21s)
2024-12-23 20:01 x_tools-gotip-openbsd-amd64 tools@93cc684c go@b9955f0a x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.21s)
2024-12-23 20:38 x_tools-go1.22-openbsd-amd64 tools@aa94d89d release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.16s)
2024-12-23 20:38 x_tools-go1.23-openbsd-amd64 tools@aa94d89d release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.41s)
2024-12-23 20:38 x_tools-go1.24-openbsd-amd64 tools@aa94d89d release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.39s)
2024-12-23 20:38 x_tools-gotip-openbsd-amd64 tools@aa94d89d go@b9955f0a x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.18s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-23 21:52 x_tools-go1.22-openbsd-amd64 tools@02033b26 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.18s)
2024-12-23 21:52 x_tools-go1.23-openbsd-amd64 tools@02033b26 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.25s)
2024-12-23 21:52 x_tools-go1.24-openbsd-amd64 tools@02033b26 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.34s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-23 21:52 x_tools-gotip-openbsd-amd64 tools@02033b26 go@b9955f0a x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.16s)
2024-12-23 22:56 x_tools-go1.22-openbsd-amd64 tools@20cd540c release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.30s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-23 22:56 x_tools-go1.23-openbsd-amd64 tools@20cd540c release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.12s)
2024-12-23 22:56 x_tools-go1.24-openbsd-amd64 tools@20cd540c release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.24s)
2024-12-23 22:56 x_tools-gotip-openbsd-amd64 tools@20cd540c go@b9955f0a x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.42s)

watchflakes

@dmitshur dmitshur moved this to Active in Test Flakes Dec 24, 2024
@dmitshur
Copy link
Contributor

CC @golang/openbsd.

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-23 22:56 x_tools-gotip-openbsd-amd64 tools@20cd540c go@772f024c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-24 14:10 x_tools-go1.22-openbsd-amd64 tools@732f823c release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.39s)
2024-12-24 14:10 x_tools-go1.23-openbsd-amd64 tools@732f823c release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.18s)
2024-12-24 14:10 x_tools-go1.24-openbsd-amd64 tools@732f823c release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)
2024-12-24 14:10 x_tools-gotip-openbsd-amd64 tools@732f823c go@772f024c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.29s)

watchflakes

@linsite
Copy link
Contributor

linsite commented Dec 25, 2024

by run make.bash, 1.24 built on linux_amd64 is not path trimmed.
devel go1.24-772f024c61 Mon Dec 23 17:53:33 2024 -0800
path cmd/go
build -buildmode=exe
build -compiler=gc
build CGO_ENABLED=0
build GOARCH=amd64
build GOOS=linux
build GOAMD64=v1

while on openbsd is path trimmed.
/home/go1.24/go/bin/go: go1.24rc1
path cmd/go
build -buildmode=exe
build -compiler=gc
build -gcflags=cmd/...=-dwarf=false
build -trimpath=true // trimmed
build CGO_ENABLED=0
build GOARCH=amd64
build GOOS=openbsd
build GOAMD64=v1

this may be the cause.

@linsite
Copy link
Contributor

linsite commented Dec 26, 2024

By adding some println in go/internal/cfg/cfg.go, it looks like in the path trimmed 'go' and with an emtpy PATH, 'go` failed to find itself. The error report by os.Executable() is below.

'file does not exist'

This is the failed syscall execve got from ktrace.

12537 test CALL execve(0xc0000d0630,0xc00009ad80,0xc000088760)
12537 test ARGS [0] = "go"
[1] = "list"
[2] = "-e"
[3] = "-f"
[4] = "{{context.ReleaseTags}}"
[5] = "--"
[6] = "unsafe"
12537 test ENV
[0] = "GOPATH=/tmp/TestTarget2077853820/001/gopath"
[1] = "GO111MODULE=off"
[2] = "PWD=/home/golang-tools/go/packages"
12537 go RET execve 0
68287 test RET read 0

It's very odd that 'go` can be invoked without a PATH and a different PWD.

@linsite
Copy link
Contributor

linsite commented Dec 26, 2024

Yes, it can be reproduced with the following code. The reason that Linux doesn't have this problem is that Linux has a different os.executable() implementation in os/executable_procfs.go, while OpenBSD has not. 'go' in Linux can find its path from /proc/pid.

package main

import "os/exec"
import "bytes"
import "fmt"


func main() {
        cmd := exec.Command("go", "list", ".")
        var buf bytes.Buffer
        var buf2 bytes.Buffer
        cmd.Stdout = &buf
        cmd.Stderr = &buf2
        cmd.Env = append(cmd.Env, "GOPATH=/tmp")
        err := cmd.Run()
        if err != nil {
                fmt.Println(buf2.String())
                panic(err)
        }
        fmt.Println(buf.String())
}

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-26 14:40 x_tools-go1.22-openbsd-amd64 tools@e56f71af release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.16s)
2024-12-26 14:40 x_tools-go1.23-openbsd-amd64 tools@e56f71af release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.15s)
2024-12-26 14:40 x_tools-go1.24-openbsd-amd64 tools@e56f71af release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.14s)
2024-12-26 14:40 x_tools-gotip-openbsd-amd64 tools@e56f71af go@772f024c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-26 18:51 x_tools-go1.22-openbsd-amd64 tools@6d4eee4d release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.30s)
2024-12-26 18:51 x_tools-go1.23-openbsd-amd64 tools@6d4eee4d release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.30s)
2024-12-26 18:51 x_tools-go1.24-openbsd-amd64 tools@6d4eee4d release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.25s)
2024-12-26 18:51 x_tools-gotip-openbsd-amd64 tools@6d4eee4d go@772f024c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.52s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-26 18:51 x_tools-gotip-openbsd-amd64 tools@6d4eee4d go@cce75da3 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)

watchflakes

linsite added a commit to linsite/golang-tools that referenced this issue Dec 27, 2024
Fixes golang/go#70891, when running tests in OpenBSD if 'go' is
built with -trimpath, the TestTarget will always fail.
Because when invoked without proper environments, 'go' itself
fails to find the GOROOT path.
@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/637961 mentions this issue: go/packages: add GOROOT env to avoid TestTarget failure in OpenBSD

linsite added a commit to linsite/golang-tools that referenced this issue Dec 27, 2024
When running tests in OpenBSD if 'go' is
built with -trimpath, the TestTarget will always fail.
Because when invoked without proper environments, 'go' itself
fails to find the GOROOT path.

Fixes golang/go#70891
linsite added a commit to linsite/golang-tools that referenced this issue Dec 27, 2024
When running tests in OpenBSD if 'go' is built with -trimpath,
the TestTarget will always fail. Because when invoked without
proper environments, 'go' itself fails to find the GOROOT path.

Fixes golang/go#70891
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-26 18:51 x_tools-gotip-openbsd-amd64 tools@6d4eee4d go@d7c3e93c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.29s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-27 16:23 x_tools-go1.23-openbsd-amd64 tools@412b5e97 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.29s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-27 16:23 x_tools-go1.22-openbsd-amd64 tools@412b5e97 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.11s)
2024-12-27 16:23 x_tools-go1.24-openbsd-amd64 tools@412b5e97 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.27s)
2024-12-27 16:23 x_tools-gotip-openbsd-amd64 tools@412b5e97 go@d7c3e93c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.13s)
2024-12-27 16:34 x_tools-go1.22-openbsd-amd64 tools@a304b37f release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)
2024-12-27 16:34 x_tools-go1.23-openbsd-amd64 tools@a304b37f release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)
2024-12-27 16:34 x_tools-go1.24-openbsd-amd64 tools@a304b37f release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.16s)
2024-12-27 16:34 x_tools-gotip-openbsd-amd64 tools@a304b37f go@39794819 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-27 18:25 x_tools-go1.22-openbsd-amd64 tools@a0396942 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)
2024-12-27 18:25 x_tools-go1.23-openbsd-amd64 tools@a0396942 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.26s)
2024-12-27 18:25 x_tools-go1.24-openbsd-amd64 tools@a0396942 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.32s)
2024-12-27 18:25 x_tools-gotip-openbsd-amd64 tools@a0396942 go@39794819 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.21s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-27 18:25 x_tools-gotip-openbsd-amd64 tools@a0396942 go@e3cd55e9 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.18s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-27 21:46 x_tools-go1.22-openbsd-amd64 tools@c437d40e release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.30s)
2024-12-27 21:46 x_tools-go1.23-openbsd-amd64 tools@c437d40e release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)
2024-12-27 21:46 x_tools-go1.24-openbsd-amd64 tools@c437d40e release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.36s)
2024-12-27 21:46 x_tools-gotip-openbsd-amd64 tools@c437d40e go@e3cd55e9 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.19s)
2024-12-27 21:47 x_tools-go1.22-openbsd-amd64 tools@a6adab9c release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.14s)
2024-12-27 21:47 x_tools-go1.23-openbsd-amd64 tools@a6adab9c release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)
2024-12-27 21:47 x_tools-go1.24-openbsd-amd64 tools@a6adab9c release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.45s)
2024-12-27 21:47 x_tools-gotip-openbsd-amd64 tools@a6adab9c go@e3cd55e9 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.23s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-27 21:47 x_tools-gotip-openbsd-amd64 tools@a6adab9c go@2b794ed8 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.26s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-27 21:47 x_tools-gotip-openbsd-amd64 tools@a6adab9c go@fd5e0d26 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.15s)
2024-12-30 17:36 x_tools-go1.23-openbsd-amd64 tools@818ab3b3 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.40s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/tools/go/packages" && test == "TestTarget"
2024-12-30 17:36 x_tools-go1.22-openbsd-amd64 tools@818ab3b3 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.29s)
2024-12-30 17:36 x_tools-go1.24-openbsd-amd64 tools@818ab3b3 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.15s)
2024-12-30 17:36 x_tools-gotip-openbsd-amd64 tools@818ab3b3 go@fd5e0d26 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.25s)
2024-12-30 17:51 x_tools-go1.22-openbsd-amd64 tools@666fab23 release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.38s)
2024-12-30 17:51 x_tools-go1.23-openbsd-amd64 tools@666fab23 release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.14s)
2024-12-30 17:51 x_tools-go1.24-openbsd-amd64 tools@666fab23 release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)
2024-12-30 17:51 x_tools-gotip-openbsd-amd64 tools@666fab23 go@fd5e0d26 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.17s)
2024-12-30 17:57 x_tools-go1.22-openbsd-amd64 tools@d6cc3cdc release-branch.go1.22@8f3f22ee x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.24s)
2024-12-30 17:57 x_tools-go1.23-openbsd-amd64 tools@d6cc3cdc release-branch.go1.23@1576793c x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.13s)
2024-12-30 17:57 x_tools-go1.24-openbsd-amd64 tools@d6cc3cdc release-branch.go1.24@16afa6a7 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.29s)
2024-12-30 17:57 x_tools-gotip-openbsd-amd64 tools@d6cc3cdc go@fd5e0d26 x/tools/go/packages.TestTarget (log)
=== RUN   TestTarget
    packages_test.go:3369: err: exit status 2: stderr: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set
        
--- FAIL: TestTarget (0.20s)

watchflakes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
Status: Active
Development

Successfully merging a pull request may close this issue.

4 participants