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

reflect package from Go 1.11.1 doesn't build with GopherJS 1.11-1. #862

Closed
dmitshur opened this Issue Oct 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@dmitshur
Member

dmitshur commented Oct 2, 2018

Go 1.11.1 has been released today. It includes some changes to the reflect package. The overrides that GopherJS 1.11-1 makes to the reflect package are no longer compatible, causing it to not build:

$ go version
go version go1.11.1 darwin/amd64
$ gopherjs version
GopherJS 1.11-1
$ gopherjs build reflect
/usr/local/go/src/reflect/value.go:673:60: cannot use t (variable of type *rtype) as *funcType value in argument to funcLayout
/usr/local/go/src/reflect/value.go:336:21: cannot use methodReceiver(op, v, int(v.flag) >> flagMethodShift) (value of type *rtype) as *funcType value in assignment

@dmitshur dmitshur self-assigned this Oct 3, 2018

dmitshur added a commit that referenced this issue Oct 3, 2018

Go 1.11.1 support (version bump to GopherJS 1.11-2).
Go 1.11.1 has been released recently. It includes some changes to the
reflect package, including:

-	golang/go@a2f1c8e
-	golang/go@3afa9df
-	golang/go@58c9bd9

The second commit makes some changes to internal reflect code that
makes GopherJS reflect overrides no longer compatible, causing the
package to no longer build:

	$ gopherjs build reflect
	/usr/local/go/src/reflect/value.go:673:60: cannot use t (variable of type *rtype) as *funcType value in argument to funcLayout
	/usr/local/go/src/reflect/value.go:336:21: cannot use methodReceiver(op, v, int(v.flag) >> flagMethodShift) (value of type *rtype) as *funcType value in assignment

Specifically, the type of return value t of function methodReceiver
was changed from *rtype to *funcType in commit golang/go@3afa9df.

This change updates the native reflect override for methodReceiver
function and Value.call method accordingly.

Regenerate natives with:

	go generate ./compiler/natives

Use Go 1.11.1 in CI.

Bump GopherJS version to GopherJS 1.11-2.

Fixes #862.

@dmitshur dmitshur closed this in #865 Oct 4, 2018

dmitshur added a commit that referenced this issue Oct 4, 2018

Go 1.11.1 support (version bump to GopherJS 1.11-2). (#865)
Go 1.11.1 has been released recently. It includes some changes to the
reflect package, including:

-	golang/go@a2f1c8e
-	golang/go@3afa9df
-	golang/go@58c9bd9

The second commit makes some changes to internal reflect code that
makes GopherJS reflect overrides no longer compatible, causing the
package to no longer build:

	$ gopherjs build reflect
	/usr/local/go/src/reflect/value.go:673:60: cannot use t (variable of type *rtype) as *funcType value in argument to funcLayout
	/usr/local/go/src/reflect/value.go:336:21: cannot use methodReceiver(op, v, int(v.flag) >> flagMethodShift) (value of type *rtype) as *funcType value in assignment

Specifically, the type of return value t of function methodReceiver
was changed from *rtype to *funcType in commit golang/go@3afa9df.

This change updates the native reflect override for methodReceiver
function and Value.call method accordingly.

Maintain backwards compatibility with Go 1.11(.0) by creating
a custom go1.11.1 release tag (to be applied whenever Go version
is 1.11.1 or greater) and using it to select the appropriate overrides
for the reflect package for Go 1.11.1 and Go 1.11(.0).

This way, GopherJS 1.11-2 will function with Go 1.11.1 and Go 1.11(.0)
versions, rather than only with Go 1.11.1.

Regenerate natives with:

	go generate ./compiler/natives

Use Go 1.11.1 in CI.

Bump GopherJS version to GopherJS 1.11-2.

Fixes #862.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment