-
Notifications
You must be signed in to change notification settings - Fork 43
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
Error: android/amd64 requires external (cgo) linking, but cgo is not enabled #50
Comments
Toolchain visibly does not need to be changed. We'll see if it fixes the current release issue. 🤷 cli/gh-extension-precompile#50 See Toolchain documention: https://go.dev/doc/toolchain
Toolchain visibly does not need to be changed. We'll see if it fixes the current release issue. 🤷 cli/gh-extension-precompile#50 See Toolchain documention: https://go.dev/doc/toolchain
Try releasing with Go 1.21 in order to fix the release failure: cli/gh-extension-precompile#50 This reverts commit 4c052b0.
Try releasing with Go 1.21 in order to fix the release failure: cli/gh-extension-precompile#50 This reverts commit 4c052b0.
No error after downgrading Go to |
Try with |
With
Go version: |
Same error here. Since go v1.22 it requires
... maybe more |
@nicokosi @Biswa96 @baruchiro @the-hotmann : firstly, thank you all for raising this issue and starting exploring the nuances. ❤ I'm currently looking into this issue to see how this changing behavior with Go 1.22 should be taken into account here 🙇 Research// MustLinkExternal reports whether goos/goarch requires external linking
// with or without cgo dependencies.
func MustLinkExternal(goos, goarch string, withCgo bool) bool {
if withCgo {
switch goarch {
case "loong64", "mips", "mipsle", "mips64", "mips64le":
// Internally linking cgo is incomplete on some architectures.
// https://go.dev/issue/14449
return true
case "arm64":
if goos == "windows" {
// windows/arm64 internal linking is not implemented.
return true
}
case "ppc64":
// Big Endian PPC64 cgo internal linking is not implemented for aix or linux.
// https://go.dev/issue/8912
if goos == "aix" || goos == "linux" {
return true
}
}
switch goos {
case "android":
return true
case "dragonfly":
// It seems that on Dragonfly thread local storage is
// set up by the dynamic linker, so internal cgo linking
// doesn't work. Test case is "go test runtime/cgo".
return true
}
}
switch goos {
case "android":
if goarch != "arm64" {
return true
}
case "ios":
if goarch == "arm64" {
return true
}
}
return false
} |
UpdateDoing a bit of digging, one option I need to carve out a little more time to try comes from golang/go#42725 (comment), which highlights the need to override
This should live within Finding similar approaches in the wild
|
For what it's worth, I've been able to work around this problem by forking the action and removing Android build targets from platforms=(
darwin-amd64
darwin-arm64
freebsd-386
freebsd-amd64
freebsd-arm64
linux-386
linux-amd64
linux-arm
linux-arm64
windows-386
windows-amd64
windows-arm64
) I'm uninformed regarding the rationale for maintaining Android as a build target for CLI extensions in the first place. In our case, we decided that the accessibility of recent Go versions was more important than maintaining support for a build target we expect to be used rarely (if ever) by the end users of our particular extension. |
Hello,
I cannot release nicokosi/gh-collab-scanner, cf. this GitHub Actions' job:
The last release that succeeded,
v1.5.3
:github.com/cli/go-gh
which has not been updated to v2 yet ;I tried several changes: enable CGO (not sure it is correct), use a Windows runner etc. but I could not make the release succeed (see the GitHub Actions build history).
Do you have any advice/tip? Thank you!
The text was updated successfully, but these errors were encountered: