-
Notifications
You must be signed in to change notification settings - Fork 570
Go 1.16 standard library support #989
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
use https://github.com/goplusjs/gopherjs any source code no problem. https://github.com/goplusjs/gopherjs natives use tags for easy support high version. ( It's easier than you think )
|
@visualfc thanks for the permission, I appreciate that a lot. Supporting multiple older versions of the library is nice, but it also has a cost that grows over time. If a certain library function changes its behavior between two versions, we'd have to keep two copies of it. The more versions of the standard library we support going back in time, the more redundant code we'll have to carry with us, maintain it, and fix bugs in. In principle, I'd be happy to do that, but I'm currently very cautious of expanding the scope of the project so that that we won't be able to handle it and would let it stall again. If we manage to build up a bigger, more active community that is capable of carrying the increased complexity (and I how we eventually will), no one would object to keeping support for more versions of the standard library. Until then, though, it is better for the project health to focus on things with the biggest value per time invested. And assuming we will be able to update GopherJS consistently for each new Go version, people still using older Go versions will be able to use a matching GopherJS version without an issue, since it all will persist in the repository. I hope that makes sense, if not — feel free to ping me or @flimzy in Gopherjs Slack and we can discuss more :) |
I have started a new branch https://github.com/gopherjs/gopherjs/tree/go1.16-stdlib for this work. Currently it is failing to build (unsurprisingly). Anyone interesting in helping may follow the steps below:
|
- Update CicleCI to use Go 1.16. - Update version check to allow running against 1.16 GOROOT.
I think we are getting really close to having all the tests passing. The only tricky one remaining is
The upstream gets around it by using |
goplusjs/gopherjs#2 support //go:linkname localname [importpath.name] |
Thanks, I have been actually looking at your implementation, and it gave me a bit better understanding of the problem we are dealing with 🙂 There are, unfortunately, several issues with it, which are likely to bite us at some later stage:
I posted a few more general thoughts here: #1000 (comment). |
Because it's loaded gopherjs build pkg.a from disk. rewrite not need on rebuild all ( gopherjs build -a) .
Yes, insert not implement. this function no need. |
I admit I don't fully understand the problem that was fixed in goplusjs/gopherjs@ffac742, but from my understanding of how compilers work in general, a well-designed build system should not need to rewrite a build artifact if inputs didn't change. Even though GopherJS doesn't have a well-defined linker, the
After doing some more research, I agree. The only place where the "insert"-style linkname is used is the runtime package and it looks like it doesn't work very reliably even in the upstream Go in the first place. To be honest I'm a bit puzzled why did the Go team did it this way instead of adding an "import"-style linknames in the corresponding packages, but I guess nothing stops us from doing that. Which I think is exactly what you did in your fork. See #1000 (comment) for details. |
Uh oh!
There was an error while loading. Please reload this page.
Go 1.16 has been released just a few days ago, and the latest Go version that GopherJS supported was 1.12, so we need to catch up. Note that this issue covers only the standard library and language support, Go Modules are tracked in #855.
After speaking with @flimzy and other folks we've decided that it's best to jump straight Go 1.16 version, without providing separate releases for intermediate versions. The major reasons behind this choice are:
In terms of how to proceed we have two options:
The text was updated successfully, but these errors were encountered: