-
Notifications
You must be signed in to change notification settings - Fork 569
support being built and used with newer versions of Go #966
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
Conversation
This change removes the build-time check that GopherJS was built with Go version 1.12, and replaces it with a runtime check instead. Add and document a new GopherJS-specific environment variable: GOPHERJS_GOROOT - if set, GopherJS uses this value as the default GOROOT value, instead of using the system GOROOT as the default GOROOT value The main reason that GopherJS required Go 1.12 to be built in the past was as a way of ensuring that the Go 1.12 standard library code is available on disk, which GopherJS 1.12-2 needs to build Go code. Now that the Go distribution can provided to GopherJS with convenience via the GOPHERJS_GOROOT environment variable, we can allow GopherJS to be built with a newer version of Go, as long as a Go 1.12 distribution is provided via GOPHERJS_GOROOT. Update GopherJS installation instructions to support being installed with Go 1.12 and newer versions of Go. The Go distribution version check is added to build.NewSession. That check may fail, and so it was necessary to add an error return value to the signature of build.NewSession. The build API is deemed semi-internal, so a breaking API change is unfortunate but acceptable. Regenerate ./compiler/natives with: go generate ./... Fixes #941
413cd88
to
991490c
Compare
/cc @hajimehoshi Feel free take a look if you have time (and it's okay if not, due to #894). If there aren't major problems with this, I plan to merge this later today, and follow up if any problems are discovered in the near future. I've been using the less polished pre-force-push version of this change locally for many months now and didn't spot any problems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for reviewing. I'll be watching the issue tracker and follow up if anything comes up. |
This is possible because the GopherJS compiler supports being built with newer versions of Go as of gopherjs/gopherjs#966. As of Go 1.12, go tool vet is no longer supported.¹ Start using the go vet command instead. Use RCS format for gofmt diff. It results in cleaner, easier to read gofmt diffs. ¹ https://golang.org/doc/go1.12#vet
I'll bump the (minor) version of GopherJS and advertise this change on Twitter. |
This is the first version of GopherJS that can be built and used with a newer major version of Go (PR #966). Give it a new version number so it's easier to refer to it.
This change removes the build-time check that GopherJS was built
with Go version 1.12, and replaces it with a runtime check instead.
Add and document a new GopherJS-specific environment variable:
The main reason that GopherJS required Go 1.12 to be built in the
past was as a way of ensuring that the Go 1.12 standard library
code is available on disk, which GopherJS 1.12-2 needs to build
Go code. Now that the Go distribution can provided to GopherJS
with convenience via the GOPHERJS_GOROOT environment variable,
we can allow GopherJS to be built with a newer version of Go,
as long as a Go 1.12 distribution is provided via GOPHERJS_GOROOT.
Update GopherJS installation instructions to support being installed
with Go 1.12 and newer versions of Go.
The Go distribution version check is added to build.NewSession.
That check may fail, and so it was necessary to add an error return
value to the signature of build.NewSession. The build API is deemed
semi-internal, so a breaking API change is unfortunate but acceptable.
Regenerate ./compiler/natives with:
Fixes #941