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 for gccgo #35617

Closed
bcmills opened this issue Nov 15, 2019 · 5 comments
Closed

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

bcmills opened this issue Nov 15, 2019 · 5 comments
Assignees
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Nov 15, 2019

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

@bcmills bcmills added this to the Go1.14 milestone Nov 15, 2019
@bcmills

This comment has been minimized.

Copy link
Member Author

@bcmills bcmills commented Nov 15, 2019

At first I suspected CL 207317, but it does actually not seem to be the culprit. Bisecting now.

@bcmills

This comment has been minimized.

Copy link
Member Author

@bcmills bcmills commented Nov 15, 2019

Also, this suggests that we have a test coverage gap: I would expect this failure to show up on the linux-amd64-longtest builder. Is it missing a gccgo binary? (Or perhaps this regresion only affects specific versions.)

@bcmills

This comment has been minimized.

Copy link
Member Author

@bcmills bcmills commented Nov 15, 2019

Bisected to CL 206144. Looks like maybe a typo introduced in that change; I'll send a fix shortly.

@bcmills

This comment has been minimized.

Copy link
Member Author

@bcmills bcmills commented Nov 15, 2019

(And @jayconrod, you might want to install gccgo on your development machine. 😉)

@bcmills bcmills self-assigned this Nov 15, 2019
@bcmills bcmills added the Testing label Nov 15, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 15, 2019

Change https://golang.org/cl/207340 mentions this issue: cmd/go: fix typo'd argument in build_trimpath.txt

@gopherbot gopherbot closed this in 5e52ca0 Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.