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/internal/gccgoimporter: needs v3 export data support, tests not running #28961

Closed
thanm opened this issue Nov 26, 2018 · 2 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@thanm
Copy link
Contributor

thanm commented Nov 26, 2018

What version of Go are you using (go version)?

Tip for Go, gccgo:

$ go version
go version devel +c52334a561 Tue Nov 13 10:37:24 2018 -0500 linux/amd64
$ gccgo -v
...
gcc version 9.0.0 20181119 (experimental) (GCC) 

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

Running programs that try to import gccgo export data will fail with "unrecognized magic string" errors.
For example, comment out lines src/go/internal/gccgoimporter/importer_test.go function TestObjImporter that guard the test so that it runs unconditionally, then execute "go test".

There are actually two problems here. First problem is that the tests aren't running for either gccgo or for the main gc: for gccgo the "testenv.MustHaveGoBuild()" guard will fail and for gc the "runtime.Compiler != "gccgo" guard will fail. The guards need to be changed to check for whether gccgo is present (not whether we're using a gccgo "go" installation).

Second problem is that the reader needs to be upgraded to deal with the recent changes on gcc tip that introduced lazy type export data reading, e.g. https://golang.org/cl/143022

What did you expect to see?

Clean run.

What did you see instead?

Errors of the form:

unrecognized magic string: "v3;\n"

@gopherbot gopherbot added this to the Gccgo milestone Nov 26, 2018
@thanm thanm self-assigned this Nov 26, 2018
@thanm thanm modified the milestones: Gccgo, Go1.12 Nov 26, 2018
@thanm thanm added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 26, 2018
@gopherbot
Copy link

Change https://golang.org/cl/149957 mentions this issue: go/internal/gccgoimporter: enhance for new export data, fix test issues

bradfitz pushed a commit that referenced this issue Nov 26, 2018
This patch merges in support for reading indexed type export data,
from the gofrontend CL https://golang.org/cl/143022 (which includes
a change in the export data version number from V2 to V3).

Also fixes the key tests to insure that they run both in gccgo builds
and main Go repo builds if "gccgo" is present (prior to this the tests
were not running in either scenario); this required fixing up some of
the expected results.

Fixes #28961.

Change-Id: I644d171f2a46be9160f89dada06ab3c20468bab7
Reviewed-on: https://go-review.googlesource.com/c/149957
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/151557 mentions this issue: go/internal/gccgoimporter: additional V3 export data changes

gopherbot pushed a commit that referenced this issue Nov 29, 2018
This patch merges in support for reading the most recent
incarnation of V3 export data (initial inline function bodies),
from the importer portions of https://golang.org/cl/150061 and
https://golang.org/cl/150067.

Updates #28961.

Change-Id: I34e837acbf48b8fd1a4896a1a977d2241adfb28d
Reviewed-on: https://go-review.googlesource.com/c/151557
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
@golang golang locked and limited conversation to collaborators Nov 28, 2019
@rsc rsc unassigned thanm Jun 23, 2022
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