Skip to content
  • Dmitri Shuralyov's avatar
    support being built and used with newer versions of Go · f9cef593
    Dmitri Shuralyov authored
    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.
    
    GitHub-Pull-Request: #966
    f9cef593