-
Notifications
You must be signed in to change notification settings - Fork 11
playground: Update for Go 1.9. #67
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
Comments
I'm investigating this right now. Everything seems to work okay, except that something causes gopherjs.github.io/playground/update.sh Lines 135 to 138 in b7ffcc8
I tried adding it to that list, and that fixes the problem: diff --git a/playground/update.sh b/playground/update.sh
index 5d62c70..578a5fa 100755
--- a/playground/update.sh
+++ b/playground/update.sh
@@ -134,7 +135,8 @@ gopherjs install -m \
time \
unicode \
unicode/utf16 \
- unicode/utf8
+ unicode/utf8 \
+ unsafe
cp -a "$GOROOT"/pkg/*_js_min/* pkg/
cp -a "$GOROOT"/pkg/*_amd64_js_min/* pkg/ However, I want to look around first to see if there's a better fix, and whether this is indicative of a problem somewhere in GopherJS 1.9-1. |
The "unsafe" package is special-cased here: I want to see what changed related to that causing it to be included as part of a build, where previously it wasn't. |
This is the generated code for the $packages["unsafe"] = (function() {
var $pkg = {}, $init;
$init = function() {
$pkg.$init = function() {};
/* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
/* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
};
$pkg.$init = $init;
return $pkg;
})(); It's basically empty (aside from bookkeeping related to goroutines and blocking calls). It contains an empty |
Figured it out. It's due to an API change in
Compare https://gotools.org/go/types?rev=go1.8.3#package.go-L54-L55 vs https://gotools.org/go/types?rev=go1.9#package.go-L50-L51. |
If its code were to be generated, package unsafe ends up largely empty: $packages["unsafe"] = (function() { var $pkg = {}, $init; $init = function() { $pkg.$init = function() {}; ... }; $pkg.$init = $init; return $pkg; })(); It contains an empty (aside from goroutine/blocking bookkeeping code) init function, and that's the only thing that gets called by other packages. So, we don't want to start including it. This change restores the previous behavior (with Go 1.8) of skipping it. Helps gopherjs/gopherjs.github.io#67 (comment). Related to https://golang.org/cl/37694.
I might need to make additional changes, so I've undone the deploy of 8bcc3f3 for now. |
If its code were to be generated, package unsafe ends up largely empty: $packages["unsafe"] = (function() { var $pkg = {}, $init; $init = function() { $pkg.$init = function() {}; ... }; $pkg.$init = $init; return $pkg; })(); It contains an empty (aside from goroutine/blocking bookkeeping code) init function, and that's the only thing that gets called by other packages. So, we don't want to start including it. This change restores the previous behavior (with Go 1.8) of skipping it. Helps gopherjs/gopherjs.github.io#67 (comment). Related to https://golang.org/cl/37694.
This should be done with GopherJS version 1.9-1.
The text was updated successfully, but these errors were encountered: