-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: internal compiler error on import on mismatch between -p and package name #54542
Comments
Thanks, yeah, I need to change that to a proper error instead of an ICE. The Go compiler now requires you to always specify |
FWIW, the binaries resulting from incorrect
It's just that prior to unified IR, the export data format didn't actually record the For more history on the |
Bumping to 1.21. ICE instead of a proper diagnostic is ugly, but I expect typical users are unlikely to run into this in practice. |
@mdempsky Based on your last message, it seems like this should happen during the dev cycle? Bumping to Backlog for now, but feel free to move it Go 1.22 if you plan to work on it. Thanks! |
Change https://go.dev/cl/596396 mentions this issue: |
Change https://go.dev/cl/596515 mentions this issue: |
Fixes golang#54542 Change-Id: I16cfb84fc54892923106d0a6f0b3ba810886d077 Reviewed-on: https://go-review.googlesource.com/c/go/+/596396 Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
Follow up suggestion in CL 596396. Updates #54542 Change-Id: I47bf66684bb8397dc1cfbc4479e2279e59a40cfb Reviewed-on: https://go-review.googlesource.com/c/go/+/596515 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
It's a small thing but I have encountered this by chance and I though I'd report it anyway, leaving for the compiler team to decide if it needs to be fixed.
Since
unified
was enabled by default, an internal compiler error can be triggered on manual invocations ofgo tool compile
when there's mismatch between the package name as imported by main and the-p
flag. Example:a.go
main.go
Now:
This doesn't happen with
GOEXPERIMENT=nounified
, and in fact a subsequentgo tool link
invocation appears to produce a working binary.unified
may want to either follow the old behaviour (no errors) or report an error message instead of an ICE.cc @mdempsky
The text was updated successfully, but these errors were encountered: