-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
vendor: review inclusion of x/sys/cpu #32102
Comments
Yeah, it was vendored in CL 164623 because the decision about not vendoring it wasn't recorded anywhere visible in the source tree. I don't see much discussion on #24843 about the underlying reasoning for that prohibition. The only comments that seem to even mention a concern are #24843 (comment) and #24843 (comment). |
@martisch's concrete concern there was:
|
I dont think we want to vendor in x/sys/cpu (which also pulls in x/sys/unix). My concerns would for keeping x/sys/cpu would be:
Im happy to put in the work to rewrite all uses of x/sys/cpu to internal/cpu so we dont need to ship x/sys/cpu with go1.13. For go1.14 we might want to have rewrite tooling or decide to make internal/cpu be a public cpu package in the std/lib so it can just be used by the vendored in packages even outside std/lib. |
Change https://golang.org/cl/177897 mentions this issue: |
With modules in place it does not seem we can just modify the copies in the vendor directories. What options do we have within the freeze to not include x/sys/unix and x/sys/cpu and run two different cpu packages with differing detection capabilities and features (GODEBUG) in go1.13 std lib? |
Can we instead drop internal/cpu and just use golang.org/x/sys/cpu? |
If the vendoring in process as originally planed and done pre go1.13 can not be adjusted anymore: I would prefer exposing a cpu package which carefully exposes values from internal/cpu instead of using golang.org/x/sys/cpu. Its technically possible to use golang.org/x/sys/cpu with the following work likely needed:
This will leave some not so nice properties:
|
Possible "low risk" alternative for go1.13. Expose a new cpu package from std/lib that only exposes the cpu options needed for vendored in code. These are: S390X.HasVX internal/cpu can stay as is for go1.13 and no other runtime/std lib changes needed. |
(CC @FiloSottile) |
An even-lower-risk option for Go 1.13 is to leave |
We need to make the standard library NOT depend on x/sys/cpu. Whatever link exists needs to be removed. |
It looks like the deps are through poly1305 and chacha20poly1305. At least for Go 1.13, we can have them do init-time hw feature checks on their own, like everyone did before x/sys/cpu existed. |
FWIW my main objection to x/sys/cpu is that it drags in x/sys/unix. That's the real red line from my point of view. If we can make x/sys/cpu NOT depend on x/sys/unix, then it might be OK to live with x/sys/cpu being vendored. |
Russ, is there a technical reason std shouldn't depend on x/sys? |
(Replies crossed in flight.) |
What if std stopped using the syscall package and only used x/sys/unix? |
Change https://golang.org/cl/179178 mentions this issue: |
gccgo support can happen in a future CL. Updates golang/go#32102 Change-Id: Ic9e8d7b3e413079d277bdba565551845a2b78121 Reviewed-on: https://go-review.googlesource.com/c/sys/+/179178 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Russ Cox <[email protected]>
Change https://golang.org/cl/179180 mentions this issue: |
@rsc said in #24843 (comment):
However it looks like it has now been vendored into std as of CL 164623.
My only real concern with this is that AFAICT
x/sys/cpu
doesn't contain the same options asinternal/cpu
to manually enable/disable CPU features using an environment variable.Thoughts?
The text was updated successfully, but these errors were encountered: