Skip to content
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

Fix Android builds for darwin/arm64 #2440

Merged
merged 1 commit into from Sep 7, 2021

Conversation

changkun
Copy link
Member

@changkun changkun commented Sep 7, 2021

Description:

fyne package currently does not work on Apple M1 Macs, this change fixes this situation. See relevant gomobile discussion: https://golang.org/cl/346153

Fixes #2439

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@@ -326,6 +326,13 @@ func archNDK() string {
arch = "x86"
case "amd64":
arch = "x86_64"
case "arm64":
// For darwin/arm64, see https://golang.org/cl/346153.
if runtime.GOOS == "darwin" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why if darwin? I thought this was a fix for Android NDK not supporting arm64?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for building android on a darwin/arm64 machine. Hence, GOOS == darwin, and the GOARCH is arm64.

I personally don't want to write the darwin check, but in the Go's CL review process, the Go team suggests to better just check for darwin, because on arm64 platforms, only darwin is (partially )supported in NDK. They don't want to risk an undefined behavior such as someone using linux/arm64 or windows/arm64 where NDK does not yet fully supported.

Besides, on a darwin/arm64 machine, using x86_64 is a temporary solution (yet) because NDK does not have any arm64 distribution at the moment.

@andydotxyz andydotxyz merged commit 0585755 into fyne-io:develop Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants