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

Add darwin arm64 target #34

Merged
merged 15 commits into from
Mar 31, 2021
Merged

Add darwin arm64 target #34

merged 15 commits into from
Mar 31, 2021

Conversation

lucor
Copy link
Member

@lucor lucor commented Mar 7, 2021

This PR add support for the darwin arm64 target along with the following changes:

  • Update Go to v1.16.2
  • Update fyne cli to v2.0.1
  • Add darwin arm64 target
  • Add the darwin-image command to build the darwin docker image
  • Add dedicated docker image for windows
  • Remove darwin 386 target
  • Remove the dependency from the docker/golang-cross image for the base image

Fixes #33

To test the darwin image:

  1. Clone this branch
  2. compile fyne-cross from this branch
  3. Download Command Line Tools for Xcode >= 12.4
  4. Run make base to build the new fyneio/fyne-cross:base-latest image with Go 1.16.x (Note this step is needed until the new base image is released and published on dockerhub)
  5. Run: fyne-cross darwin-image --xcode-path /path/to/Command_Line_Tools_for_Xcode_<version>.dmg
  6. build and test your app

NOTE: the creation of the image may take several minutes and may require more than 25 GB of free disk space.

To test the windows image:

  1. Clone this branch
  2. Run make base to build the new fyneio/fyne-cross:base-latest image with Go 1.16
  3. Run make windows to build the fyneio/fyne-cross:windows-latest image
  4. compile fyne-cross from this branch
  5. build and test your app

This commit add support for the darwin arm64 target.

Additionally provides:
- Update Go to v1.16.0
- Update fyne cli to v2.0.1
- Add darwin arm64 target
- Remove darwin 386 target

Fixes fyne-io#33
@lucor lucor mentioned this pull request Mar 7, 2021
@andydotxyz
Copy link
Member

This looks like a really great addition, thanks.
Unfortunately I don't have access to an M1 to test, which is probably a large chunk of this change.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Just a few comments and ideas while I wait for the images to build:

  • Would it be possible to have some sort of fyne-cross build-darwin pathtoxcode command to avoid having to cd into the project root and run make commands? Just a thought to make darwin builds easier. I don't think there would be much use for doing this for the base images.
  • Would it be possible to just download the Command Line Tools instead? According to Apple, they contain all the SDK and headers needed either way. This means downloading 400 MB instead of 11 GB and make our lives a lot easier.
    image

@andydotxyz
Copy link
Member

andydotxyz commented Mar 8, 2021

  • Would it be possible to just download the Command Line Tools instead? According to Apple, they contain all the SDK and headers needed either way. This means downloading 400 MB instead of 11 GB and make our lives a lot easier.

I think you are mis-reading the information there. the 400MB file does not contain all the SDKs, it enables their use on the commandline. Those tools require XCode (and the SDKs it includes) to be present first.
(This is based on my understanding, and extreme skepticism that their massive SDKs are possible to compress that far!)

@Jacalz
Copy link
Member

Jacalz commented Mar 8, 2021

  • Would it be possible to just download the Command Line Tools instead? According to Apple, they contain all the SDK and headers needed either way. This means downloading 400 MB instead of 11 GB and make our lives a lot easier.

I think you are mis-reading the information there. the 400MB file does not contain all the SDKs, it enables their use on the commandline. Those tools require XCode (and the SDKs it includes) to be present first.
(This is based on my understanding, and extreme skepticism that their massive SDKs are possible to compress that far!)

Ah. I see now. It looks like you probably are correct.

@Jacalz
Copy link
Member

Jacalz commented Mar 8, 2021

Perhaps some of the people from fyne-io/fyne#1922, like @zdima and @sirkon could try this out as they have M1 machines? If so, it would be greatly appreciated 🙂

@lucor
Copy link
Member Author

lucor commented Mar 8, 2021

@Jacalz my first understanding was the same of @andydotxyz but looking closer at the osxcross doc it seems that starting from Xcode command line tools 12.x it is known to work. Let's give it a try.

Would it be possible to have some sort of fyne-cross build-darwin pathtoxcode command to avoid having to cd into the project root and run make commands? Just a thought to make darwin builds easier. I don't think there would be much use for doing this for the base images.

Sure, in the plan this was the next step. Before implement that just want to be sure the macOS cross toolchain and image work as expected ;-)

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Compiling

Running cross-compilation for Darwin (amd64, arm64), Linux (amd64, arm64) and FreeBSD (amd64) all completed without issues. The darwin build felt a bit slower than before, I think, now not too slow by any means (excluding the image build time).

However, the windows build seemed to fail:

~/go/bin/fyne-cross windows -arch amd64 -app-id com.github.jacalz.wormhole-gui -icon internal/assets/icon/icon-512.png
[i] Target: windows/amd64
[i] Cleaning target directories...
[✓] "bin" dir cleaned: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/bin/windows-amd64
[✓] "dist" dir cleaned: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/dist/windows-amd64
[✓] "temp" dir cleaned: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/fyne-cross/tmp/windows-amd64
[i] Checking for go.mod: /home/jacob/go/src/github.com/Jacalz/wormhole-gui/go.mod
[✓] go.mod found
Could not create windows resource exec: "x86_64-w64-mingw32-windres": executable file not found in $PATH
Debug output: 
[✗] could not package the Fyne app: exit status 1
make: *** [Makefile:54: windows] Error 1

Running

I don't have any M1 mac to test that part on, but the following systems have been tested:

  • Linux 5.11.3 on amd64: No issues
  • macOS 10.13 on amd64: No issues
  • FreeBSD (GhostBSD) 12.2 on amd64:* No issues
  • Windows 10 on amd64: Could not test. See compilation section above.

Jacalz added a commit to Jacalz/rymdport that referenced this pull request Mar 8, 2021
@lucor
Copy link
Member Author

lucor commented Mar 8, 2021

Thanks @Jacalz going to check the error on windows.

Btw it seems from first tests that using the Command_Line_Tools_for_Xcode works, at least on complilation side (does not have macOS >= 10.12 to test it).

@Jacalz
Copy link
Member

Jacalz commented Mar 8, 2021

Btw it seems from first tests that using the Command_Line_Tools_for_Xcode works, at least on complilation side (does not have macOS >= 10.12 to test it).

If you have any patch for getting that working, I’ll happily test it out on 10.13 🙂

@Jacalz
Copy link
Member

Jacalz commented Mar 8, 2021

This might not be the most elegant solution out there (with all talk about not downloading random binaries from the internet). However, if anyone want to help out and test Darwin arm64 binaries on M1 machines without having to compile the fyne-cross images, I have a binary available for download here: Jacalz/rymdport#7 (comment)

@lucor
Copy link
Member Author

lucor commented Mar 8, 2021

@Jacalz added with e072d73

@zdima
Copy link

zdima commented Mar 8, 2021 via email

@lucor
Copy link
Member Author

lucor commented Mar 8, 2021

@Jacalz windows build is fixed in 1d0ae5d. The commit also introduce a dedicated docker image for windows, to test you need to run make windows first.

@zdima could you please run from the terminal the wormhole-gui.app/Contents/MacOS/warmhole-gui binary and report the error, if any ? Thanks!

@zdima
Copy link

zdima commented Mar 8, 2021

@zdima could you please run from the terminal the wormhole-gui.app/Contents/MacOS/warmhole-gui binary and report the error, if any ? Thanks!

Actually I run it from the finder and from command line. It reports damaged file in both cases.

@zdima
Copy link

zdima commented Mar 8, 2021

@zdima could you please run from the terminal the wormhole-gui.app/Contents/MacOS/warmhole-gui binary and report the error, if any ? Thanks!

Actually I run it from the finder and from command line. It reports damaged file in both cases.

I checked the system log file. Seems like MAC security is not allowing this command to run:
default 13:35:54.152787-0500 kernel ASP: Security policy would not allow process: 4186, /Users/zdima/Downloads/wormhole-gui.app/Contents/MacOS/wormhole-gui

Is this process trying to access some protected data?

@Jacalz
Copy link
Member

Jacalz commented Mar 8, 2021

Another user reported a similar error on M1. Jacalz/rymdport#7 (comment)

@Jacalz
Copy link
Member

Jacalz commented Mar 8, 2021

@zdima could you please run from the terminal the wormhole-gui.app/Contents/MacOS/warmhole-gui binary and report the error, if any ? Thanks!

Actually I run it from the finder and from command line. It reports damaged file in both cases.

I checked the system log file. Seems like MAC security is not allowing this command to run:
default 13:35:54.152787-0500 kernel ASP: Security policy would not allow process: 4186, /Users/zdima/Downloads/wormhole-gui.app/Contents/MacOS/wormhole-gui

Is this process trying to access some protected data?

It shouldn’t, as far as I know. We should probably try with something else than my project to be sure (fyne_demo perhaps). I just added a binary as I was compiling it to test fyne-cross.

@Jacalz
Copy link
Member

Jacalz commented Mar 8, 2021

@lucor If we are stopping to use the docker/golang-cross image for Darwin and Windows, should we maybe stop using it altogether? The Linux support shouldn’t be too hard to wire up as is and FreeBSD doesn’t really use the either way. Just a thought 🙂

@zdima
Copy link

zdima commented Mar 8, 2021

Another user reported a similar error on M1. Jacalz/wormhole-gui#7 (comment)

The latest BigSur OS is very strict. You can't even exec ps command from the app.
I suspect the network layer may get restriction as well as I see many times security warnings like "app xyzy is trying access network share". A simple test app can confirm if this is the case.

@lucor
Copy link
Member Author

lucor commented Mar 8, 2021

@lucor If we are stopping to use the docker/golang-cross image for Darwin and Windows, should we maybe stop using it altogether? The Linux support shouldn’t be too hard to wire up as is and FreeBSD doesn’t really use the either way. Just a thought slightly_smiling_face

Updated the PR descrition, we already do this :) The dependency from docker/golang-cross hase been removed from the base image.

Another user reported a similar error on M1. Jacalz/wormhole-gui#7 (comment)

The latest BigSur OS is very strict. You can't even exec ps command from the app.
I suspect the network layer may get restriction as well as I see many times security warnings like "app xyzy is trying access network share". A simple test app can confirm if this is the case.

Agreed, test with a minimal "hello world app" would be great.

@Jacalz
Copy link
Member

Jacalz commented Mar 8, 2021

I ran make windows and got this error:

/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `docker build -f /home/jacob/Downloads/fyne-io-fyne-cross-darwin-arm64 (1)/docker/base/Dockerfile -t fyneio/fyne-cross:base-latest .'
make: *** [Makefile:4: base] Error 2

@Jacalz
Copy link
Member

Jacalz commented Mar 8, 2021

Here is a test compile of the hello world example of https://github.com/fyne-io/fyne/blob/develop/cmd/hello/main.go:
fyne-hello-test-darwin-arm64.zip

If any M1 users want to check if it works.

@zdima
Copy link

zdima commented Mar 8, 2021

Here is a test compile of the hello world example of https://github.com/fyne-io/fyne/blob/develop/cmd/hello/main.go:
fyne-hello-test-darwin-arm64.zip

If any M1 users want to check if it works.

No luck.
However the logs are different but yet related to security.


default	14:46:08.783782-0500	lsd	Non-fatal error enumerating at <private>, continuing: Error Domain=NSCocoaErrorDomain Code=260 "The file “PlugIns” couldn’t be opened because there is no such file." UserInfo={NSURL=PlugIns/ -- file:///Users/zdima/Downloads/Test.app/Contents/, NSFilePath=/Users/zdima/Downloads/Test.app/Contents/PlugIns, NSUnderlyingError=0x14fe22b90 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
default	14:46:08.783852-0500	lsd	- 45683955: Checking whether application is managed at file:///Users/zdima/Downloads/Test.app//io.fyne.hello
default	14:46:08.816973-0500	lsd	SecTranslocateCreateSecureDirectoryForURL: created /private/var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app
default	14:46:08.848562-0500	kernel	AMFI: '/private/var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app/Contents/MacOS/Test' has no CMS blob?
default	14:46:08.848581-0500	kernel	AMFI: '/private/var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app/Contents/MacOS/Test': Unrecoverable CT signature issue, bailing out.
default	14:46:08.859123-0500	tccd	AUTHREQ_ATTRIBUTION: msgID=139.35, attribution={accessing={identifier=a.out, pid=4421, auid=501, euid=501, binary_path=/private/var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app/Contents/MacOS/Test}, requesting={identifier=com.apple.syspolicyd, pid=139, auid=0, euid=0, binary_path=/usr/libexec/syspolicyd}, },
default	14:46:08.862232-0500	runningboardd	Acquiring assertion targeting [app<application.io.fyne.hello.7158211.7158215(501)>:4421] from originator [daemon<com.apple.coreservices.appleevents(55)>:309] with description <RBSAssertionDescriptor| "AE/Test" ID:162-309-2950 target:4421 attributes:[
	<RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"LSNotification" sourceEnvironment:"(null)">
	]>
default	14:46:08.864725-0500	loginwindow	-[PersistentAppsSupport applicationReady:] | App: Test, ready, updating active tracking timer
default	14:46:08.864787-0500	loginwindow	-[ApplicationManager checkInAppContext:eventData:] | ApplicationManager: Checked in app : Test
default	14:46:08.904558-0500	lsd	Non-fatal error enumerating at <private>, continuing: Error Domain=NSCocoaErrorDomain Code=260 "The file “PlugIns” couldn’t be opened because there is no such file." UserInfo={NSURL=PlugIns/ -- file:///var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app/Contents/, NSFilePath=/var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app/Contents/PlugIns, NSUnderlyingError=0x152e0a770 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
default	14:46:08.904797-0500	lsd	- 45683955: Checking whether application is managed at file:///var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app//io.fyne.hello
default	14:46:08.921931-0500	lsd	Non-fatal error enumerating at <private>, continuing: Error Domain=NSCocoaErrorDomain Code=260 "The file “PlugIns” couldn’t be opened because there is no such file." UserInfo={NSURL=PlugIns/ -- file:///var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app/Contents/, NSFilePath=/var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app/Contents/PlugIns, NSUnderlyingError=0x154046810 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
default	14:46:08.922158-0500	lsd	- 45683955: Checking whether application is managed at file:///var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app//io.fyne.hello
default	14:46:08.924581-0500	tccd	-[TCCDAccessIdentity staticCode]: static code for: identifier io.fyne.hello, type: 0: 0x10a812ec0 at /var/folders/0l/3mf0k_35553cjfstjtm5sgj40000gn/T/AppTranslocation/24A68833-65E1-4BEC-A05F-0E2A469487CD/d/Test.app
default	14:46:08.967648-0500	trustd	could not enable test hierarchy: no UAT pinning preferences set
default	14:46:08.988074-0500	trustd	could not enable test hierarchy: no UAT pinning preferences set
default	14:46:11.163599-0500	kernel	ASP: Security policy would not allow process: 4421, /Users/zdima/Downloads/Test.app/Contents/MacOS/Test

@lucor
Copy link
Member Author

lucor commented Mar 12, 2021

Updated to Go v1.16.2 in c95deca

@lucor
Copy link
Member Author

lucor commented Mar 12, 2021

Root cause could be the wrong macos min version used to compile for arm64, updated in 0d36b99
Feedback using that commit for fyne-cross and the latest docker image with 1.16.2 would be great.
If possible please test using the --no-string-debug flag too:

  • fyne-cross darwin --app-id com.example.test --arch arm64 --no-cache
  • fyne-cross darwin --app-id com.example.test --arch arm64 --no-cache --no-strip-debug

@Jacalz
Copy link
Member

Jacalz commented Mar 13, 2021

Here are two new M1 test applications for testing. One is without debug and the other is with debug symbols:
fyne-cross-darwin-arm64-test-no-debug.zip
fyne-cross-darwin-arm64-test-with-debug.zip

@Jacalz
Copy link
Member

Jacalz commented Mar 13, 2021

Things are looking much better now. I am getting the same deprecation warnings as fyne-io/fyne#1833, which I take as a good sign that the binaries are correctly built 🙂

@zdima
Copy link

zdima commented Mar 13, 2021

Here are two new M1 test applications for testing. One is without debug and the other is with debug symbols:
fyne-cross-darwin-arm64-test-no-debug.zip
fyne-cross-darwin-arm64-test-with-debug.zip
A bit different this time:
default 08:10:50.334913-0500 kernel ASP: Security policy would not allow process: 12374, /Users/zdima/Downloads/Test-2.app/Contents/MacOS/Test

Are these binaries signed with developer profile?
There could be a latest OS restriction to not run any app unless there is a developer profile behind it.
These are only options OS allowed, and I assume app will not run unless there is a signature that can be verified.
Screen Shot 2021-03-13 at 8 09 06 AM

OS not even ask to allow execute the app, just ask to move directly to a trash bin.

@zdima
Copy link

zdima commented Mar 13, 2021

Check this article. Perhaps adding entitlement com.apple.developer.endpoint-security.client will solve security issue.
https://developer.apple.com/forums/thread/666123
and this:
https://www.yellowduck.be/posts/golang-vs-apple-silicon/

@lucor
Copy link
Member Author

lucor commented Mar 13, 2021

Oh, great! So it looks like is working :-)

With regard to the warning above, this is expected. Go is using an ad-hoc signature, so unless you sign again the binary with a cert with a vality identity it cannot pass through Gatekeeper (see golang/go#42684 (comment) and the official docs https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-universal-apps-release-notes#Code-Signing for details)

Details on how open a developer-signed or notarized app can be found on the apple support site: https://support.apple.com/en-us/HT202491

The plan is to found a way to sign the binary using a valid cartificate directly from linux, but I'd say that this is another issue.

On macOS you would sing using a developer certificate using either the fyne release command or directly the codesign tool.

@zdima could you please confirm if it runs after allowing the execution from an unidentified developer?

@zdima
Copy link

zdima commented Mar 13, 2021

That is the thing. Latest Big Sur don't have an option to run the app from unidentified source. I am not getting "Open anyway" option and can't find if I can enable it.

@lucor
Copy link
Member Author

lucor commented Mar 13, 2021

Did you tried by any chance the steps reported from the macOS user guide: https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac ?

If you try to open an app that isn’t registered with Apple by an identified developer, you get a warning dialog. This doesn’t necessarily mean that something’s wrong with the app. For example, some apps were written before developer ID registration began. However, the app has not been reviewed, and macOS can’t check whether the app has been modified or broken since it was released.

A common way to distribute malware is to take an app and insert harmful code into it, and then redistribute the infected app. So an app that isn’t registered by an unidentified developer might contain harmful code.

The safest approach is to look for a later version of the app from the Mac App Store or look for an alternative app.
To override your security settings and open the app anyway follow these steps:

  1. In the Finder on your Mac, locate the app you want to open.
    Don’t use Launchpad to do this. Launchpad doesn’t allow you to access the shortcut menu.
  2. Control-click the app icon, then choose Open from the shortcut menu.
  3. Click Open.
    The app is saved as an exception to your security settings, and you can open it in the future by double-clicking it just as you can any registered app.

Note: You can also grant an exception for a blocked app by clicking the Open Anyway button in the General pane of Security & Privacy preferences. This button is available for about an hour after you try to open the app.

To change these preferences on your Mac, choose Apple menu > System Preferences, click Security & Privacy, then click General.

@zdima
Copy link

zdima commented Mar 13, 2021

Yes. I did. Multiple times.
I think without developer certificate this not going to work. At least on M1 with latest OS.
Do we know if it works on Mac with x86-64?
I believe the developer certificate can be obtained for free once you register as developer on apple dev site. Unless you want to publish the app in the store, no payment require.

@Jacalz
Copy link
Member

Jacalz commented Mar 13, 2021

I found this article https://www.kencochrane.com/2020/08/01/build-and-sign-golang-binaries-for-macos-with-github-actions/. It might be kind of useful. However, it still looks like you need a paid developer account to be able to get signing certificates https://developer.apple.com/support/compare-memberships.

@lucor
Copy link
Member Author

lucor commented Mar 13, 2021

Yes. I did. Multiple times.
I think without developer certificate this not going to work. At least on M1 with latest OS.

It could be, but it is hard to debug without a physical access to an M1 :-(

@zdima To check if the if the signature is valid could you please run: codesign -v -vvvv —ignore-resources <path/to/binary> on both binaries above ?

Do we know if it works on Mac with x86-64?

Yes, it works as reported by @Jacalz above. The restriction applies only to latest macOS on M1

@Jacalz
Copy link
Member

Jacalz commented Mar 13, 2021

Do we know if it works on Mac with x86-64?

Yes, it works as reported by @Jacalz above. The restriction applies only to latest macOS on M1

Though, we should keep in mind that it was tested on MacOS 10.13. Someone running Big Sur on an amd64 machine should probably test as well. I think @andydotxyz has one?

@zdima
Copy link

zdima commented Mar 13, 2021

@zdima To check if the if the signature is valid could you please run: codesign -v -vvvv —ignore-resources <path/to/binary> on both binaries above ?

This is output:

/Applications/Test-2.app/Contents/MacOS/Test: valid on disk (not all contents verified)
/Applications/Test-2.app/Contents/MacOS/Test: satisfies its Designated Requirement

@lucor
Copy link
Member Author

lucor commented Mar 13, 2021

@zdima To check if the if the signature is valid could you please run: codesign -v -vvvv —ignore-resources <path/to/binary> on both binaries above ?

This is output:

/Applications/Test-2.app/Contents/MacOS/Test: valid on disk (not all contents verified)
/Applications/Test-2.app/Contents/MacOS/Test: satisfies its Designated Requirement

Thanks @zdima. This is weird... as per the official doc the signature is valid for the policy:

To check the validity of a signature, run codesign -v -vvvv —ignore-resources . If the command indicates “valid on disk (not all contents verified)” and “satisfies its Designated Requirement”, the code is valid under this policy.

Let's try to recap where we are so far:

  • fyne application is cross compiled for arm64 using Go 1.16.2 against the SDK 11.1
  • the application is signed using an ad hoc certificate by Go
  • the signature is valid when checked with codesign
  • the application is downloaded from internet
  • fyne apps built natively on arm64 are known to work out of the box.
  • cross-compiled app runs on macOS 10.13 amd64, we expect it should also run on macOS 11.x amd64 since codesigning is required only on arm64.

Issue: we are unable to run on macOS 11.x arm64 a cross-compiled app with fyne-cross on macOS amd64 due to Gatekeeper policy issues. We have not found a way yet to open an app from an unidentiefied developer despite the doc says it should be possible.

Things comes in mind to debug the issue above:

  1. build a fyne app natively on arm64 -> upload somewhere -> download and run on arm64
  2. build a fyne app with fyne-cross on arm64 for arm64 -> run locally
  3. check additional steps that would allow installation of apps from unidentiefied developer (and downloaded from internet ?)

Missed something ? Any additional ideas ?

@andydotxyz
Copy link
Member

Though, we should keep in mind that it was tested on MacOS 10.13. Someone running Big Sur on an amd64 machine should probably test as well. I think @andydotxyz has one?

Current build tools work on BigSur for x86_64 yes - no signing required (though you will get warnings if the file was downloaded without signing).

@andydotxyz
Copy link
Member

Obviously on an x86_64 BigSur those built M1 binaries won't run.
However I ran fyne-cross to build for darwin and that ran on BigSur for me (x86_64).

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

I built for FreeBSD and got this error:

[i] Building binary...
# runtime/cgo
/usr/local/bin/x86_64-unknown-freebsd11-clang: 2: exec: clang: not found
[✗] exit status 2
make: *** [Makefile:45: freebsd] Error 1

@Jacalz
Copy link
Member

Jacalz commented Mar 15, 2021

Thanks @lucor. That works now 👍

@lucor
Copy link
Member Author

lucor commented Mar 15, 2021

Here is a new M1 test applications for testing: test.zip

It tries a possible fix for the linker.

@lucor lucor mentioned this pull request Mar 18, 2021
@lucor lucor merged commit 5e2241a into fyne-io:develop Mar 31, 2021
@lucor lucor mentioned this pull request Mar 31, 2021
@lucor
Copy link
Member Author

lucor commented Mar 31, 2021

The PR has been closed automatically by mistake :(
I've created a follow-up in #39 based on the recent docker image refactoring.

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.

4 participants