-
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
os: package os should not depend on cgo for darwin/arm #10455
Comments
Do you know what package that os depends on uses cgo?
even when cgo is disabled?
$ GOOS=darwin GOARCH=arm go list -f '{{.Deps}}' os
[errors io runtime sync sync/atomic syscall time unsafe]
$ CGO_ENABLED=1 GOOS=darwin GOARCH=arm go list -f '{{.Deps}}' os
[errors io runtime runtime/cgo sync sync/atomic syscall time unsafe]
|
I don't know. But IIRC, darwin/arm needed cgo to function correctly. There's a line in misc/ios/README about |
OK, I know the cause.
https://golang.org/cl/6460 adds cgo dependency to package os to query the
temporary directory.
perhaps we should do that in runtime/cgo.
|
The data structure holding the environment variables is owned by the syscall package. I suppose linker tricks can be used to work around the test. There are many options, but I'm not sure what the right solution is. |
CL https://golang.org/cl/12576 mentions this issue. |
CL https://golang.org/cl/12574 mentions this issue. |
We used to use build.Import to get the dependencies, but that meant we had to repeat the check for every possible GOOS/GOARCH/cgo combination, which took too long. So we made the test in short mode only check the current GOOS/GOARCH/cgo combination. But some combinations can't run the test at all. For example darwin/arm64 does not run tests with a full source file systems, so it cannot test itself, so nothing was testing darwin/arm64. This led to bugs like #10455 not being caught. Rewrite the test to read the imports out of the source files ourselves, so that we can look at all source files in a directory in one pass, regardless of which GOOS/GOARCH/cgo/etc they require. This one complete pass runs in the same amount of time as the old single combination check ran, so we can now test all systems, even in short mode. Change-Id: Ie216303c2515bbf1b6fb717d530a0636e271cb6d Reviewed-on: https://go-review.googlesource.com/12576 Reviewed-by: Ian Lance Taylor <iant@golang.org>
/cc @minux @crawshaw
The text was updated successfully, but these errors were encountered: