Skip to content

cmd/go: TestScript/build_trimpath broken with gccgo 10.2.1 as of CL 266365 #43974

Closed
@bcmills

Description

@bcmills
+ /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

Activity

added
TestingAn issue that has been verified to require only test changes, not just a test failure.
NeedsFixThe path to resolution is known, but the work has not been done.
on Jan 28, 2021
modified the milestones: Backlog, Go1.17 on Jan 28, 2021
added
SoonThis needs action soon. (recent regressions, service outages, unusual time-sensitive situations)
on Jan 28, 2021
modified the milestones: Go1.17, Go1.16 on Jan 28, 2021
bcmills

bcmills commented on Jan 28, 2021

@bcmills
ContributorAuthor

Confirmed the root cause with git bisect. Fix forthcoming.

gopherbot

gopherbot commented on Jan 28, 2021

@gopherbot
Contributor

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

ianlancetaylor

ianlancetaylor commented on Jan 28, 2021

@ianlancetaylor
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.

locked and limited conversation to collaborators on Jan 28, 2022

1 remaining item

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.SoonThis needs action soon. (recent regressions, service outages, unusual time-sensitive situations)TestingAn issue that has been verified to require only test changes, not just a test failure.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ianlancetaylor@bcmills@gopherbot

        Issue actions

          cmd/go: TestScript/build_trimpath broken with gccgo 10.2.1 as of CL 266365 · Issue #43974 · golang/go