Skip to content

Detect when gopherjs binary Go version != GOROOT version, exit with helpful error. #671

Closed
@dmitshur

Description

@dmitshur

It's possible to do the following set of steps:

  1. Use version Go 1.N.
  2. go get -u github.com/gopherjs/gopherjs.
  3. Update Go to version 1.N+1. (Or downgrade to 1.N-1, or use any other version of Go.)
  4. Run gopherjs.

At step 4, you'll run into problems because the gopherjs binary was built for one version of Go, but you have a different version installed.

We have a compile-time check for version mismatch, but not a runtime one. We should add one, to make the error message more helpful, instead of something unexpected like:

../../../../../../../../usr/local/go/src/runtime/error.go:134:3: undeclared name: throw
../../../../../../../../usr/local/go/src/runtime/error.go:136:12: undeclared name: CallersFrames
../../../../../../../../usr/local/go/src/runtime/error.go:144:3: undeclared name: throw
../../../../../../../../usr/local/go/src/runtime/error.go:148:3: undeclared name: throw
../../../../../../../../usr/local/go/src/runtime/error.go:153:3: undeclared name: throw
../../../../../../../../usr/local/go/src/runtime/error.go:156:3: undeclared name: throw

This idea is inspired by #670.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions