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

go/importer: better error message when importer is out of date #25856

Closed
griesemer opened this issue Jun 12, 2018 · 2 comments
Closed

go/importer: better error message when importer is out of date #25856

griesemer opened this issue Jun 12, 2018 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

griesemer commented Jun 12, 2018

Tools such as gotype (which is built by hand) may not be updated when a new Go version is installed and then get confused when they see newer export data than they are capable of handling.

The error in those cases will be misleading because it's not the imported package that needs to be updated, but the respective tool.

Make go/importer produce a better error message in those cases.

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 12, 2018
@griesemer griesemer added this to the Go1.11 milestone Jun 12, 2018
@griesemer griesemer self-assigned this Jun 12, 2018
@gopherbot
Copy link

Change https://golang.org/cl/118496 mentions this issue: go/importer: better error message when importer is out of date

@gopherbot
Copy link

Change https://golang.org/cl/118555 mentions this issue: go/internal/gcimporter, gccgoimporter: updated to match latest version in std lib

gopherbot pushed a commit to golang/tools that referenced this issue Jun 13, 2018
…n in std lib

This CL brings over the changes from:

https://go-review.googlesource.com/118496 (better error message when importer is out of date)
https://go-review.googlesource.com/114317 (permit embedding of non-defined interfaces via alias type names)
https://go-review.googlesource.com/85318  (use named receiver types for methods of named interfaces)
https://go-review.googlesource.com/42870  (report import path if package is not found)
https://go-review.googlesource.com/41710  (version tests for 1.8, v4 and v5)

Also updated go/gcexportdata to select between binary and new indexed export format.

For golang/go#25856.
For golang/go#25301.
For golang/go#20230.
For golang/go#13829.

Change-Id: Ibf77c50f86e767cef411bd1d3809e12397678958
Reviewed-on: https://go-review.googlesource.com/118555
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
dna2github pushed a commit to dna2fork/go that referenced this issue Jun 14, 2018
Separated out panic handling for bimporter and importer so that
the handler can consider the current version and report a better
error.

Added new export data test for export data version 999 (created
by changing the compiler temporarily) and verifying expected
error message.

Fixes golang#25856.

Change-Id: Iaafec07b79499154ef7c007341783fa07c57f24d
Reviewed-on: https://go-review.googlesource.com/118496
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
@golang golang locked and limited conversation to collaborators Jun 13, 2019
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.
Projects
None yet
Development

No branches or pull requests

2 participants