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/build_trimpath broken with gccgo 10.2.1 as of CL 266365 #43974

Closed
bcmills opened this issue Jan 28, 2021 · 3 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Soon This needs to be done soon. (regressions, serious bugs, outages) Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Jan 28, 2021

+ /usr/local/google/home/bcmills/go-review/bin/go test cmd/go -run=TestScript/build_trimpath
go test proxy running at GOPROXY=http://127.0.0.1:39195/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/build_trimpath (4.42s)
        script_test.go:213:
            # If GOROOT_FINAL is set, 'go build -trimpath' bakes that into the resulting
            # binary instead of GOROOT. Explicitly unset it here. (0.000s)
            # Set up two identical directories that can be used as GOPATH. (0.001s)
            # A binary built without -trimpath should contain the module root dir
            # and GOROOT for debugging and stack traces. (0.217s)
            # A binary built with -trimpath should not contain the current workspace
            # or GOROOT. (2.437s)
            # A binary from an external module built with -trimpath should not contain
            # the current workspace or GOROOT. (0.356s)
            # Two binaries built from identical packages in different directories
            # should be identical. (0.182s)
            # Same sequence of tests but with overlays.
            # A binary built without -trimpath should contain the module root dir
            # and GOROOT for debugging and stack traces. (0.212s)
            # A binary built with -trimpath should not contain the current workspace
            # or GOROOT. (0.202s)
            # Two binaries built from identical packages in different directories
            # should be identical. (0.158s)
            # Same sequence of tests but in GOPATH mode.
            # A binary built without -trimpath should contain GOPATH and GOROOT. (0.195s)
            # A binary built with -trimpath should not contain GOPATH or GOROOT. (0.202s)
            # Two binaries built from identical packages in different GOPATH roots
            # should be identical. (0.173s)
            # Same sequence of tests but with gccgo.
            # gccgo does not support builds in module mode. (0.000s)
            # A binary built with gccgo without -trimpath should contain the current
            # GOPATH and GOROOT. (0.065s)
            > go build -compiler=gccgo -o paths-dbg.exe paths
            [stderr]
            # paths
            a/src/paths/paths.go:15:18: error: reference to undefined identifier 'os.ReadFile'
               15 |  data, err := os.ReadFile(exe)
                  |                  ^
            [exit status 2]
            FAIL: testdata/script/build_trimpath.txt:101: unexpected command failure

FAIL
FAIL    cmd/go  6.606s
~$ gccgo --version
gccgo (Debian 10.2.1-3) 10.2.1 20201224

I suspect that this was broken by CL 266365 and masked by #35786 (CC @golang/release).

@ianlancetaylor, do you think it's worth backporting a fix to the 1.16 release branch?

CC @jayconrod @matloob

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. labels Jan 28, 2021
@bcmills bcmills modified the milestones: Backlog, Go1.17 Jan 28, 2021
@bcmills bcmills added the Soon This needs to be done soon. (regressions, serious bugs, outages) label Jan 28, 2021
@bcmills bcmills modified the milestones: Go1.17, Go1.16 Jan 28, 2021
@bcmills
Copy link
Contributor Author

bcmills commented Jan 28, 2021

Confirmed the root cause with git bisect. Fix forthcoming.

@gopherbot
Copy link

Change https://golang.org/cl/287613 mentions this issue: cmd/go: revert TestScript/build_trimpath to use ioutil.ReadFile

@ianlancetaylor
Copy link
Contributor

This commit will automatically wind up on the 1.16 branch anyhow.

It's useful for tests to pass with gccgo but I think it's not essential. In general I wouldn't worry about backports. Thanks.

@golang golang locked and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Soon This needs to be done soon. (regressions, serious bugs, outages) Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants