Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
support being built and used with newer versions of Go #966
This change removes the build-time check that GopherJS was built
Add and document a new GopherJS-specific environment variable:
The main reason that GopherJS required Go 1.12 to be built in the
Update GopherJS installation instructions to support being installed
The Go distribution version check is added to build.NewSession.
Regenerate ./compiler/natives with:
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
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.
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