Skip to content

cmd/go: TestScript/build_trimpath broken for gccgo #35617

@bcmills

Description

@bcmills

cmd/go.TestScript/build_trimpath seems to be failing at head with gccgo 8.3.0.

$ go test cmd/go '-run=TestScript/^build_trimpath$'
go test proxy running at GOPROXY=http://127.0.0.1:37513/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/build_trimpath (1.26s)
        script_test.go:192:
            # A binary built without -trimpath should contain the current workspace
            # and GOROOT for debugging and stack traces. (0.332s)
            # A binary built with -trimpath should not contain the current workspace
            # or GOROOT. (0.316s)
            # A binary from an external module built with -trimpath should not contain
            # the current workspace or GOROOT. (0.385s)
            # Two binaries built from identical packages in different directories
            # should be identical.
            # TODO(golang.org/issue/35435): at the moment, they are not.
            #mkdir $GOPATH/src/b
            #cp $GOPATH/src/a/go.mod $GOPATH/src/b/go.mod
            #cp $GOPATH/src/a/paths.go $GOPATH/src/b/paths.go
            #cd $GOPATH/src/b
            #go build -trimpath -o $WORK/paths-b.exe .
            #cmp -q $WORK/paths-a.exe $WORK/paths-b.exe (0.000s)
            # A binary built with gccgo without -trimpath should contain the current
            # GOPATH and GOROOT. (0.205s)
            > env GO111MODULE=off # The current released gccgo does not support builds in module mode.
            > cd $GOPATH/src/a
            $WORK/gopath/src/a
            > go build -compiler=gccgo -o $WORK/gccgo-paths-a.exe .
            > exec $WORK/gccgo-paths-a.exe $WORK/gccgo-paths-b.exe
            [stderr]
            2019/11/15 08:43:04 open $WORK/gccgo-paths-b.exe: no such file or directory
            [exit status 1]
            FAIL: testdata/script/build_trimpath.txt:44: unexpected command failure

FAIL
FAIL    cmd/go  2.587s
$ gccgo --version
gccgo (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

CC @jayconrod @ianlancetaylor @thanm

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.TestingAn issue that has been verified to require only test changes, not just a test failure.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions