Skip to content

cmd/link: TestStrictDup fails in module mode #35790

@fhs

Description

@fhs

What version of Go are you using (go version)?

$ go version
go version devel +05511a5c0a Fri Nov 22 17:33:48 2019 +0000 linux/amd64

What operating system and processor architecture are you using (go env)?

go env Output
$ go env | egrep -v '^(GONOPROXY|GONOSUMDB|GOPRIVATE)='
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/fhs/.cache/go-build"
GOENV="/home/fhs/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOOS="linux"
GOPATH="/home/fhs/go"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/big/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/big/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build121624413=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go test cmd/link -run TestStrictDup

What did you expect to see?

Test pass

What did you see instead?

--- FAIL: TestStrictDup (0.01s)
    link_test.go:428: linking with -strictdups=1 failed: exit status 1
    link_test.go:431: unexpected output:
        go: cannot find main module; see 'go help modules'
    link_test.go:441: unexpected output:
        go: cannot find main module; see 'go help modules'
FAIL
FAIL	cmd/link	0.011s
FAIL

The test passes in GOPATH mode:

$ GO111MODULE=off go test cmd/link -run TestStrictDup
ok  	cmd/link	0.236s

@gopherbot Add labels Testing, NeedsFix, modules

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.modules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions