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: go test -c
does still not respect all gcflags
#48719
Comments
Generics are not fully supported in Go 1.17. Does this reproduce with a Go built from head? What commands do you see if you add the |
This may be a duplicate of #47682. |
go test -c
does still not respect all gcflagsgo test -c
does still not respect all gcflags
I tested with latest master (d55009c). I can confirm that it works on master while it doesn't work with It only works when specifying the source file directly Output with $ ./goroot/bin/go build -x -gcflags=-G=3 -v . WORK=/tmp/go-build908583775 MOD/tmp_bin mkdir -p $WORK/b001/ cat >$WORK/b001/_gomod_.go << 'EOF' # internal package main import _ "unsafe" //go:linkname __debug_modinfo__ runtime.modinfo var __debug_modinfo__ = "0w\xaf\f\x92t\b\x02A\xe1\xc1\a\xe6\xd6\x18\xe6path\tMOD/tmp_bin\nmod\tMOD\t(devel)\t\n\xf92C1\x86\x18 r\x00\x82B\x10A\x16\xd8\xf2" EOF cat >$WORK/b001/importcfg << 'EOF' # internal # import config packagefile fmt=GOROOT/pkg/linux_amd64/fmt.a packagefile runtime=GOROOT/pkg/linux_amd64/runtime.a EOF cd DIR GOROOT/pkg/tool/linux_amd64/compile -o $WORK/b001/_pkg_.a -trimpath "$WORK/b001=>" -p main -lang=go1.17 -complete -buildid z-sMC8R1MPGhU10yT-o1/z-sMC8R1MPGhU10yT-o1 -G=3 -importcfg $WORK/b001/importcfg -pack ./main.go $WORK/b001/_gomod_.go # MOD/tmp_bin ./main.go:7:12: type parameters require go1.18 or later ./main.go:7:14: undeclared name: any (requires version go1.18 or later) ./main.go:14:7: implicit function instantiation requires go1.18 or later |
@darkdragon-001 Seems that your I would say this is duplicated of #47682, and was fixed at tip. We can close the issue then, |
Thanks for your help! I can confirm it works! Will the fix be backported to 1.17.2? |
The |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Compile the following generics test code:
go run -gcflags=-G=3 main.go
go build -gcflags=-G=3 main.go
go build -gcflags=-G=3 main.go
What did you expect to see?
No error.
What did you see instead?
Additional information
Related?
go test -c
does not respect gcflags sometimes #27681The text was updated successfully, but these errors were encountered: