-
Notifications
You must be signed in to change notification settings - Fork 569
natives: duplicate aliasing.go in x/crypto #1026
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
Conversation
This file is also present there, and `x/crypto` packages making use of `x/crypto/internal/subtle` need the internal implementation as the one in the stdlib.
Thanks for your investigation and this PR! I am somewhat torn about it though… Technically, In particular, the plans we had for #1021 had an explicit assumption that we only augment standard library sources. Third-party libraries may or may not be available at that stage and specific versions will depend on a particular project. |
@nevkontakte thanks for the response. Imho an exception is necessary here. Our project is running on GopherJS, we invested quite heavily in this stack. As you said, x/crypto has a special status, it is treated kind of like the stdlib. Our code using this library used to work nicely until this issue came up.
We could add this particular internal to the test suite, and add some tests exercising chacha20poly1305 , so it wouldn't regress. It would be great if we could find a solution to this. |
My thoughts, mostly off the top of my head, so I may be overlooking something:
|
@benma my primary concern here is that there are only two active GopherJS maintainers and both of us have very limited time we can dedicate to it. It is barely enough to keep up with the existing scope and taking on more maintenance burden will likely put us back into the state the project was for the previous couple of years. If your team is actively using GopherJS, would you be interested in contributing some of your time to the project? Having an active group of contributors would allow us to be more ambitious about how much we can support. Besides that, there's also a technical problem to consider. A significant technical difference between Echoing @flimzy's comment, maybe we could submit a patch to |
Neither location is absolutely ideal. It's a patch that makes use of:
If added to GopherJS, then GopherJS maintainers need to keep up with x/crypto internal API changes. But if added to x/crypto, then x/crypto maintainers need to keep up with GopherJS internal API changes. This is indeed tricky. |
I was thinking that there could be a version of this patch that avoids pointer arithmetic, but also doesn't use GopherJS APIs. Or maybe we could try to improve GopherJS support for unsafe or reflect so that a patch wouldn't be necessary. I haven't looked at the surrounding code closely to tell for sure though. |
I don't think that x/crypto is the right place to make changes - they should not be concerned with maintaining GopherJS compatibility, unless you can think of a trivial change that is not likely to regress on their end.
While that is true, I don't see it as a great maintenance burden. In my humble opinion, it wouldn't hurt to merge this PR as is, to make GopherJS work with x/crypto like it used to, and leave it at that. Chances are no new issues will come up, and if there will, we can cross the bridge when we get there. |
That would indeed be the best, but I am not familiar enough with the internals to judge if that is possible. |
Ok, here's my plan then:
The caveat: we are unable to guarantee that this fix will work in the long term. I'll try to find a few hours to look at
@flimzy @dmitshur please let me know what you think of this plan. |
Alright, since there don't seem to be any objections, I am merging this PR. Thanks all! |
Thanks a lot! |
For posterity, I've looked into options for implementing So as dissatisfying as this might be, a fork is probably the only long-term option. |
This file is also present there, and
x/crypto
packages making use ofx/crypto/internal/subtle
need the internal implementation as the onein the stdlib.