-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: fails to perform concurrent compilation on darwin/arm64 #48496
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've manually reviewed all uses of ctxt.Flag_shared and they all look concurrency-safe to me. And I manually tested with the race detector and found no issues. I'm going to send a CL removing that particular check. |
Change https://golang.org/cl/353871 mentions this issue: |
Funny enough the M1 shows all 4 fat cores at 100% when compiling gotip. |
@andig that probably due to process-level concurrency. |
Maybe. For what its worth: recompiling gotip with this CL applied does not provide a speedup afaikt:
but:
|
Yes, make.bash has ample process level parallelism. That is not true of all build graphs. |
I've manually reviewed all uses of ctxt.Flag_shared for concurrency safety. And I manually tested with the race detector and found no issues. Allow -shared to be used with compiler concurrency, thereby re-enabling concurrent compilation on darwin/arm64. Fixes golang#48496 Change-Id: I8a084cb08e6050950e404ceb9bd7e3a20e07e9c5 Reviewed-on: https://go-review.googlesource.com/c/go/+/353871 Trust: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit 579ff8b)
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, both go1.16.8 and go1.17.1
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
grep -c -- -c=
should return non-zero.What did you see instead?
The problem seems that with arm64, there's
-shared
passed to the compiler:go/src/cmd/go/internal/work/init.go
Line 173 in 79159f2
cause
gcBackendConcurrency
return 1:go/src/cmd/go/internal/work/gc.go
Line 214 in 79159f2
The text was updated successfully, but these errors were encountered: