-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/go/gcexportdata: support export using indexed format #28260
Comments
It seems like @alandonovan or @griesemer: is there anything else that needs to be done here? |
I corrected the issue title to mean "write", not "read". |
Thanks - I'll start working on this now. |
Change https://golang.org/cl/156901 mentions this issue: |
Add an iexport.go (and corresponding iexport_test.go) file, which is an adapted version of $GOROOT/src/cmd/compile/internal/gc/iexport.go. This code writes exportdata for a *go/types.Package. A majority of this code is directly copied from iexport.go, with a change of types, while some of it had to be modified slightly. Updates golang/go#28260 Change-Id: Ic7e8e99f0c6b886839280b410afffb037da8a79b Reviewed-on: https://go-review.googlesource.com/c/156901 Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
@stamblerre Is this finished, i.e., can we close this issue? |
I think the final step here would be to have the |
Change https://golang.org/cl/198742 mentions this issue: |
Updates golang/go#28260 Change-Id: Id0ef98e1599fbef4dd67ba23c20ddb8bc4d33228 Reviewed-on: https://go-review.googlesource.com/c/tools/+/198742 Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
Updates golang/go#28260 Change-Id: Id0ef98e1599fbef4dd67ba23c20ddb8bc4d33228 Reviewed-on: https://go-review.googlesource.com/c/tools/+/198742 Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
https://golang.org/cl/198742 introduced a compatible change, but a breaking one for some programs. It used to be that I think |
Change https://golang.org/cl/201097 mentions this issue: |
I worked around it a different way. (I saved the path with the export data.) It sounds like you're keeping the previous behavior, where Read returns the written package for certain values of Should we update |
I made a mistake with the initial port of iexport.go in that I left the original package path of the top-level package in the export data. The package path for the top-level package should have been empty so that it can be changed when the package is loaded. Updates golang/go#28260 Change-Id: I781e63317a54eaf59385f25d18609e73ff97d572 Reviewed-on: https://go-review.googlesource.com/c/tools/+/201097 Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
Ended up adding documentation to IExportData (https://go-review.googlesource.com/c/tools/+/201097/6/go/internal/gcimporter/iexport.go), since it's really a behavior of the export data writer. The data that gets read should always have the import path that is provided by the caller, which is the way it worked in the past. It was my misunderstanding that changed the behavior, though it was never documented that the top-level package's path should be dropped. I think adding that documentation should be sufficient. |
We need to port the reader of indexed import data ($GOROOT/src/cmd/compile/internal/gc/iexport.go) to produce go/types data structures, analogous to what we do for the $ $B format, which is deprecated.
@stamblerre
The text was updated successfully, but these errors were encountered: