-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/dist: loadinternal: cannot find runtime/cgo
during bootstrapping on ios
#57961
Comments
This appears to have started at or around CL 454836, which changed (attn @golang/compiler @golang/ios) |
This comment was marked as outdated.
This comment was marked as outdated.
@cherrymui points out that this is related to #31544. It's not obvious to me whether this failure mode (on It isn't clear to me whether the |
To be clear, the The last "ok" on the iOS builder https://build.golang.org/log/4c18d54f1d9bc8e08844d19e57b7873640c2729e also has the message for go_bootstrap (not other binaries), and it worked fine. (I'm pretty sure this was the case for quite some time, at least a couple of years.)
Currently ios build requires external linking. I'm not sure we explicitly say external linking requires the runtime/cgo package. But as the C linker will likely pull in C stuff to the binary, it is pretty much a C/Go mixed binary, linking in runtime/cgo seems reasonable. If I understand correctly cmd/go tries to add runtime/cgo dependency when external linking, but sometimes doesn't? (I think that is #31544.) It might be possible to make ios internal linking work. But I'm not sure it's worth it, as users for iOS build use external linking, as the Go code would be linked with C/objective-C/swift/etc. for their iOS app. Or, maybe we could make sure external linking work without runtime/cgo, document it and test it. This would also fix #31544. Not sure how hard that would be (on all platforms). Also not sure it's worth it, as most users don't do this? And the C toolchain (C linker) is used anyway, so disable runtime/cgo doesn't to help much. |
I'm not sure this is a linker bug. Unless we decide to implement internal linking on iOS. |
loadinternal: cannot find runtime/cgo
during bootstrapping on ios
loadinternal: cannot find runtime/cgo
during bootstrapping on ios
This also occurs on the To me, that reinforces that the log message is not appropriate — it adds a huge amount of noise that can bury the real errors (such as in https://storage.googleapis.com/go-build-log/b968f088/android-amd64-emu_65dfd1a1.log). |
Change https://go.dev/cl/463739 mentions this issue: |
Or, I guess, to put it a different way: if |
If we want to emit an error, I'd hope
Otherwise |
Certain ios and android configurations do not yet support internal linking. On ios, attempting to build without cgo causes tests to fail on essentially every run (golang#57961). On android, it produces a lot of warning spam from the linker, obscuring real problems. Since external linking makes the result of `go install` depend on the installed C toolchain either way, the reproducibility benefit of disabling cgo seems minimal on these platforms anyway. Fixes golang#57961. For golang#24904. Updates golang#57007. Change-Id: Ied2454804e958dd670467db3d5e9ab50a40bb899 Reviewed-on: https://go-review.googlesource.com/c/go/+/463739 Reviewed-by: Russ Cox <[email protected]> Run-TryBot: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Cherry Mui <[email protected]> TryBot-Bypass: Bryan Mills <[email protected]>
https://build.golang.org/log/baada2af5f73ef484b066c8c6495db12b3ee442d:
It looks like the
loadinternal
call is happening here:https://cs.opensource.google/go/go/+/master:src/cmd/link/internal/ld/lib.go;l=576-592;drc=ba913774543d7388b7bb1843fc7c1b935aebedda
It isn't clear to me whether this message is actually indicating a problem, or just noisy. If it does not indicate a real problem, it should be adjusted to avoid logging to
stderr
.The text was updated successfully, but these errors were encountered: