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/compile: -G=3 reports wrong error message for misuse of //go:embed #48230

Closed
mdempsky opened this issue Sep 7, 2021 · 2 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@mdempsky
Copy link
Member

mdempsky commented Sep 7, 2021

For a package that uses //go:embed but doesn't import "embed", cmd/compile correctly reports "go:embed only allowed in Go files that import "embed"" for -G=0 and GOEXPREIMENT=unified, but instead reports "invalid go:embed: build system did not supply embed configuration" for -G=3.

(The -G=3 error is technically correct here, because I'm not specifying the embed configuration either; but it's missing the important error.)

$ go tool compile -G=3 a.go
a.go:3:3: invalid go:embed: build system did not supply embed configuration

$ go tool compile -G=0 a.go
a.go:3:3: go:embed only allowed in Go files that import "embed"
$ GOEXPERIMENT=unified go tool compile a.go
a.go:3:3: go:embed only allowed in Go files that import "embed"

$ cat a.go
package p

//go:embed a.txt
var hi string

$ cat a.txt
hi
@mdempsky mdempsky added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 7, 2021
@mdempsky mdempsky added this to the Go1.18 milestone Sep 7, 2021
@mdempsky mdempsky self-assigned this Sep 7, 2021
@heschi
Copy link
Contributor

heschi commented Oct 6, 2021

Ping from the release team: any updates on this? We consider it a release blocker, unless you disagree?

@gopherbot
Copy link

Change https://golang.org/cl/355529 mentions this issue: cmd/compile: fix irgen reports wrong error message for misuse of //go:embed

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants