Permalink
Browse files

build: Detect vendored js package and return error. (#572)

This follows #538.

Vendoring github.com/gopherjs/gopherjs/js package is not supported, and can cause
hard to understand runtime errors. Better catch it earlier and print a clear error message.

Helps #569.
  • Loading branch information...
1 parent dcd7ed0 commit 0203db228191af09ef6f5644c623f25280d22ba3 @shurcooL shurcooL committed on GitHub Jan 13, 2017
Showing with 5 additions and 0 deletions.
  1. +5 −0 build/build.go
View
@@ -79,6 +79,11 @@ func importWithSrcDir(path string, srcDir string, mode build.ImportMode, install
return nil, err
}
+ // TODO: Resolve issue #415 and remove this temporary workaround.
+ if strings.HasSuffix(pkg.ImportPath, "/vendor/github.com/gopherjs/gopherjs/js") {
+ return nil, fmt.Errorf("vendoring github.com/gopherjs/gopherjs/js package is not supported, see https://github.com/gopherjs/gopherjs/issues/415")
+ }
+
switch path {
case "runtime":
pkg.GoFiles = []string{"error.go"}

0 comments on commit 0203db2

Please sign in to comment.