You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go version devel go1.21-5c51e9f45b Thu May 4 18:03:04 2023 +0000 darwin/arm64
Does this issue reproduce with the latest release?
Yes
What did you do?
I tried to run tests of a package in another module, where my current module didn't have those test deps in go.mod.
You get weird -lang mismatches (is it synthesizing some fake module behind the scenes and not filling something out?) instead of either working or failing nicely.
$ go version
go version go1.20.4 darwin/arm64
$ go test tailscale.com/net/dns/resolver
# github.com/miekg/dns
embedding interface element ~[]string requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/msg.go:549:12: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/msg.go:549:14: embedding interface element ~[]byte | ~string requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/msg.go:553:16: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/types.go:1605:17: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/types.go:1605:19: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/types.go:1605:26: embedding interface element ~[]E requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/clientconfig.go:71:25: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/defaults.go:211:12: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/edns.go:523:63: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/edns.go:523:63: too many errors
FAIL tailscale.com/net/dns/resolver [build failed]
FAIL
$ go get github.com/miekg/dns@v1.1.54 # <---- the workaround
$ go test tailscale.com/net/dns/resolver
ok tailscale.com/net/dns/resolver 0.160s
$ go mod tidy
$ go test tailscale.com/net/dns/resolver
# github.com/miekg/dns
embedding interface element ~[]string requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/msg.go:549:12: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/msg.go:549:14: embedding interface element ~[]byte | ~string requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/msg.go:553:16: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/types.go:1605:17: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/types.go:1605:19: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/types.go:1605:26: embedding interface element ~[]E requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/clientconfig.go:71:25: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/defaults.go:211:12: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/edns.go:523:63: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../go/pkg/mod/github.com/miekg/dns@v1.1.54/edns.go:523:63: too many errors
FAIL tailscale.com/net/dns/resolver [build failed]
FAIL
~/tmp/go-test-bug-repro$ go mod why github.com/miekg/dns
# github.com/miekg/dns
go-test-bug-repro
tailscale.com/tsnet
tailscale.com/ipn/ipnlocal
tailscale.com/net/dns/resolver
tailscale.com/net/dns/resolver.test
github.com/miekg/dns
~/tmp/go-test-bug-repro$ go test tailscale.com/net/dns/resolver
# tailscale.com/net/dns/resolver
../../pkg/mod/tailscale.com@v1.1.1-0.20230504144956-787fc41fa48d/net/dns/resolver/tsdns_server_test.go:13:2: github.com/miekg/dns@v1.1.54: missing go.sum entry for go.mod file; to add it:
go mod download github.com/miekg/dns
FAIL tailscale.com/net/dns/resolver [setup failed]
FAIL
~/tmp/go-test-bug-repro$ go mod tidy -go=1.21
~/tmp/go-test-bug-repro$ go test tailscale.com/net/dns/resolver
ok tailscale.com/net/dns/resolver 0.030s
What version of Go are you using (
go version
)?Both:
Does this issue reproduce with the latest release?
Yes
What did you do?
I tried to run tests of a package in another module, where my current module didn't have those test deps in go.mod.
You get weird
-lang
mismatches (is it synthesizing some fake module behind the scenes and not filling something out?) instead of either working or failing nicely.Repro at https://github.com/bradfitz/go-test-bug-repro
/cc @bcmills @matloob @ianlancetaylor
The text was updated successfully, but these errors were encountered: