FedoraQt / MediaWriter

Fedora Media Writer - Write Fedora Images to Portable Media
GNU General Public License v2.0
708 stars 154 forks source link

Add macOS arm64 build #665

Closed sebdanielsson closed 10 months ago

sebdanielsson commented 10 months ago

Current universal build doesn't work. I added another job to build a separate macOS arm64 version. Having them separated also reduces the size of the application.

Closes #380

grulja commented 10 months ago

Have you verified the new build on apple silicon? I have only old Intel based MacBook.

sebdanielsson commented 10 months ago

I've tested to start the build created from this PR and macOS starts it as a native application without using Rosetta.

Screenshot 2023-11-02 at 15 21 55

However I wasn't able to test the functionality since both this build and the previous build from the PR before mine result in this error when flashing the USB flash drive. Error: @rpath/QtDBus.framework/Versions/A/QtDBus

grulja commented 10 months ago

Does https://github.com/FedoraQt/MediaWriter/pull/666 make any difference?

grulja commented 10 months ago

Does #666 make any difference?

Hmm, it does, but the error shifts to QtCore instead.

grulja commented 10 months ago

Alright, I fixed the issue. Can you please rebase? By that I mean to include the same change I just merged in your job?

sebdanielsson commented 10 months ago

Hmm, that's strange. I rebased your fixes on top of my commits and added:

"$Qt6_DIR"/bin/macdeployqt build/src/app/FedoraMediaWriter.app -qmldir=src/app/qml -executable=build/src/app/FedoraMediaWriter.app/Contents/MacOS/helper -appstore-compliant

to the macos-arm64 build but now macOS won't open the app because it's damaged.

grulja commented 10 months ago

Hmm, that's strange. I rebased your fixes on top of my commits and added:

"$Qt6_DIR"/bin/macdeployqt build/src/app/FedoraMediaWriter.app -qmldir=src/app/qml -executable=build/src/app/FedoraMediaWriter.app/Contents/MacOS/helper -appstore-compliant

to the macos-arm64 build but now macOS won't open the app because it's damaged.

I don't think that any change I did could damage the build/bundle somehow, it just added yet another binary to work with in the macdeployqt to fix the libraries and paths, but nothing really fundamental. Does the non-arm64 build work for you? Or both builds are now broken? It at least worked for me yesterday.

sebdanielsson commented 10 months ago

Hmm, that's strange. I rebased your fixes on top of my commits and added:

"$Qt6_DIR"/bin/macdeployqt build/src/app/FedoraMediaWriter.app -qmldir=src/app/qml -executable=build/src/app/FedoraMediaWriter.app/Contents/MacOS/helper -appstore-compliant

to the macos-arm64 build but now macOS won't open the app because it's damaged.

I don't think that any change I did could damage the build/bundle somehow, it just added yet another binary to work with in the macdeployqt to fix the libraries and paths, but nothing really fundamental. Does the non-arm64 build work for you? Or both builds are now broken? It at least worked for me yesterday.

The x86_64 version still works just like before, only the arm64 version is reported as broken.

grulja commented 10 months ago

That's weird. Any chance you can run it in a terminal to get some logs why it reports it's broken? Or it doesn't even mount?

sebdanielsson commented 10 months ago

Starting the app from the terminal doesn't give me any output. I started the macOS Console.app and started the app and got lots of output. Here's the output filtered by MediaWriter:

MediaWriter Console Output ``` default 10:21:00.583832+0100 lsd org.fedoraproject.MediaWriter/Unknown Persona:5:5:1:1:Building bundle record for app default 10:21:00.584050+0100 lsd org.fedoraproject.MediaWriter/Unknown Persona:5:5:2:1:Built bundle record for app default 10:21:00.592417+0100 lsd org.fedoraproject.MediaWriter/Unknown Persona:5:4:2:1:_LSServerRegisterItemInfo result = 0 default 10:21:00.602942+0100 runningboardd Launch request for app[0] is using uid 501 (divined from auid 501 euid 501) default 10:21:00.602998+0100 runningboardd Acquiring assertion targeting app from originator [osservice:1601] with description attributes:[ ]> default 10:21:00.603056+0100 runningboardd Assertion 604-1601-452149 (target:app) will be created as active default 10:21:00.603283+0100 runningboardd Executing launch request for app (LS launch org.fedoraproject.MediaWriter) default 10:21:00.603552+0100 runningboardd Checking PreventLaunch: global:0 exPath:/Applications/FedoraMediaWriter.app/Contents/MacOS/FedoraMediaWriter predicates:(null) allow:(null) default 10:21:00.603929+0100 runningboardd Creating and launching job for: app default 10:21:00.604175+0100 runningboardd _mutateContextIfNeeded called for org.fedoraproject.MediaWriter default 10:21:00.604722+0100 runningboardd app: -[RBPersonaManager personaForIdentity:context:personaUID:personaUniqueString:] required 0.000000 ms (wallclock); resolved to {4294967295, (null)} default 10:21:00.605015+0100 runningboardd 'app' Constructed job description: { count = 23, transaction: 0, voucher = 0x0, contents = "Platform" => : 1 "ProcessType" => { length = 3, contents = "App" } "EnableTransactions" => : false "_ManagedBy" => { length = 22, contents = "com.apple.runningboard" } "CFBundleIdentifier" => { length = 29, contents = "org.fedoraproject.MediaWriter" } "_ResourceCoalition" => { length = 71, contents = "app" } "_DisablePointerAuth" => : true "ThrottleInterval" => : 2147483647 "MachServices" => { count = 0, transaction: 0, voucher = 0x0, contents = } "EnablePressuredExit" => : false "LimitLoadToSessionType" => { count = 2, capacity = 8, contents = 0: { length = 4, contents = "Aqua" } 1: { length = 11, contents = "LoginWindow" } } "InitialTaskRole" => : 2 "EnvironmentVariables" => { count = 12, transaction: 0, voucher = 0x0, contents = "__CF_USER_TEXT_ENCODING" => { length = 9, contents = "0x1F5:0:0" } "TMPDIR" => { length = 49, contents = "/var/folders/dj/g6nlcz0d12sfdbmdfszv8br00000gn/T/" } "SHELL" => { length = 8, contents = "/bin/zsh" } "HOME" => { length = 16, contents = "/Users/sebastian" } "SSH_AUTH_SOCK" => { length = 51, contents = "/private/tmp/com.apple.launchd.CaYk8MHiEo/Listeners" } "LOGNAME" => { length = 9, contents = "sebastian" } "PATH" => { length = 518, contents = "/usr/local/bin:/opt/homebrew/opt/node@18/bin:/opt/homebrew/opt/openjdk/bin:/Users/sebastian/Library/Python/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Applications/Little Snitch.app/Contents/Components:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Users/sebastian/.fig/bin:/Users/sebastian/.local/bin" } "XPC_SERVICE_NAME" => { length = 16, contents = "com.apple.Finder" } "__CFBundleIdentifier" => { length = 29, contents = "org.fedoraproject.MediaWriter" } "COMMAND_MODE" => { length = 8, contents = "unix2003" } "USER" => { length = 9, contents = "sebastian" } "XPC_FLAGS" => { length = 3, contents = "0x0" } } "_AdditionalProperties" => { count = 1, transaction: 0, voucher = 0x0, contents = "RunningBoard" => { count = 4, transaction: 0, voucher = 0x0, contents = "TMPDIR" => { length = 49, contents = "/var/folders/dj/g6nlcz0d12sfdbmdfszv8br00000gn/T/" } "HOME" => { length = 16, contents = "/Users/sebastian" } "RunningBoardLaunchedIdentity" => { count = 5, transaction: 0, voucher = 0x0, contents = "AJL" => { length = 61, contents = "application.org.fedoraproject.MediaWriter.185225543.185225775" } "TYPE" => : 1 "AUID" => : 501 "EAI" => { length = 29, contents = "org.fedoraproject.MediaWriter" } "PLAT" => : 1 } "RunningBoardLaunched" => : true } } "ExitTimeOut" => : 1 "Label" => { length = 61, contents = "application.org.fedoraproject.MediaWriter.185225543.185225775" } "WaitForDebugger" => : true "MaterializeDatalessFiles" => : true "WorkingDirectory" => { length = 1, contents = "/" } "_LaunchType" => : 3 "AbandonProcessGroup" => : true "ProgramArguments" => { count = 1, capacity = 8, contents = 0: { length = 68, contents = "/Applications/FedoraMediaWriter.app/Contents/MacOS/FedoraMediaWriter" } } "Program" => { length = 68, contents = "/Applications/FedoraMediaWriter.app/Contents/MacOS/FedoraMediaWriter" } } default 10:21:00.615334+0100 runningboardd _bundleMatchesProcessWithExecutablePath using realpath and comparing /Applications/FedoraMediaWriter.app/Contents/MacOS/FedoraMediaWriter and /Applications/FedoraMediaWriter.app/Contents/MacOS default 10:21:00.615534+0100 runningboardd [app:16036] Memory Limits: active 0 inactive 0 default 10:21:00.615549+0100 runningboardd [app:16036] This process will not be managed. default 10:21:00.615561+0100 runningboardd Now tracking process: [app:16036] default 10:21:00.615854+0100 runningboardd Calculated state for app: running-active (role: UserInteractive) default 10:21:00.616661+0100 runningboardd Using default underlying assertion for app: [app:16036] default 10:21:00.617177+0100 runningboardd Acquiring assertion targeting [app:16036] from originator [app:16036] with description , ]> default 10:21:00.617402+0100 runningboardd Assertion 604-604-452150 (target:[app:16036]) will be created as active default 10:21:00.617695+0100 runningboardd [app:16036] Ignoring jetsam update because this process is not memory-managed default 10:21:00.617856+0100 runningboardd [app:16036] Ignoring suspend because this process is not lifecycle managed default 10:21:00.618267+0100 runningboardd [app:16036] reported to RB as running default 10:21:00.618145+0100 runningboardd [app:16036] Set darwin role to: UserInteractive default 10:21:00.618966+0100 runningboardd [app:16036] Ignoring GPU update because this process is not GPU managed default 10:21:00.619637+0100 runningboardd [app:16036] Ignoring memory limit update because this process is not memory-managed default 10:21:00.619905+0100 runningboardd Calculated state for app: running-active (role: UserInteractive) default 10:21:00.621500+0100 gamepolicyd Hit the server for a process handle 1c8845c500003ea4 that resolved to: [app:16036] default 10:21:00.621540+0100 gamepolicyd Received state update for 16036 (app, running-active-NotVisible default 10:21:00.623260+0100 runningboardd Acquiring assertion targeting [app:16036] from originator [osservice:568] with description ]> default 10:21:00.623429+0100 runningboardd Assertion 604-568-452151 (target:[app:16036]) will be created as active default 10:21:00.624593+0100 runningboardd Calculated state for app: running-active (role: UserInteractive) default 10:21:00.627262+0100 runningboardd Invalidating assertion 604-1601-452149 (target:app) from originator [osservice:1601] default 10:21:00.630646+0100 runningboardd [app:16036] Ignoring jetsam update because this process is not memory-managed default 10:21:00.630990+0100 runningboardd [app:16036] Ignoring suspend because this process is not lifecycle managed default 10:21:00.631145+0100 runningboardd [app:16036] Ignoring GPU update because this process is not GPU managed default 10:21:00.631469+0100 runningboardd [app:16036] Ignoring memory limit update because this process is not memory-managed default 10:21:00.631719+0100 runningboardd [app:16036] Ignoring jetsam update because this process is not memory-managed default 10:21:00.632198+0100 runningboardd [app:16036] Ignoring suspend because this process is not lifecycle managed default 10:21:00.632277+0100 runningboardd Successfully acquired underlying assertion for [app:16036] default 10:21:00.632322+0100 runningboardd [app:16036] Ignoring GPU update because this process is not GPU managed default 10:21:00.632605+0100 runningboardd [app:16036] Ignoring memory limit update because this process is not memory-managed default 10:21:00.625838+0100 distnoted register name: com.apple.sharedfilelist.change object: com.apple.LSSharedFileList.ApplicationRecentDocuments/org.fedoraproject.mediawriter token: 1380000005e pid: 1599 default 10:21:00.643215+0100 runningboardd Calculated state for app: running-active (role: UserInteractiveNonFocal) default 10:21:00.643388+0100 runningboardd [app:16036] Ignoring jetsam update because this process is not memory-managed default 10:21:00.643522+0100 runningboardd [app:16036] Ignoring suspend because this process is not lifecycle managed default 10:21:00.643584+0100 runningboardd [app:16036] Set darwin role to: UserInteractiveNonFocal default 10:21:00.643620+0100 runningboardd [app:16036] Ignoring GPU update because this process is not GPU managed default 10:21:00.643711+0100 runningboardd [app:16036] Ignoring memory limit update because this process is not memory-managed default 10:21:00.649528+0100 loginwindow -[PersistentAppsSupport applicationReady:] | App: FedoraMediaWriter, ready, updating active tracking timer default 10:21:00.649564+0100 loginwindow -[ApplicationManager checkInAppContext:eventData:] | ApplicationManager: Checked in app : FedoraMediaWriter default 10:21:00.651648+0100 gamepolicyd Received state update for 16036 (app, running-active-NotVisible default 10:21:00.723470+0100 gamepolicyd Received state update for 16036 (app, running-active-NotVisible default 10:21:00.736493+0100 dmd Received xpc stream event (distributed notification matching) with name: com.apple.LaunchServices.applicationRegistered user info: { CFBundleDisplayName = "Fedora Media Writer"; bundleIDs = ( "org.fedoraproject.MediaWriter" ); isPlaceholder = 0; } default 10:21:02.223534+0100 tccd AUTHREQ_ATTRIBUTION: msgID=703.123, attribution={accessing={TCCDProcess: identifier=FedoraMediaWriter, pid=16036, auid=501, euid=501, binary_path=/Applications/FedoraMediaWriter.app/Contents/MacOS/FedoraMediaWriter}, requesting={TCCDProcess: identifier=com.apple.syspolicyd, pid=703, auid=0, euid=0, binary_path=/usr/libexec/syspolicyd}, }, default 10:21:02.237401+0100 tccd AUTHREQ_SUBJECT: msgID=703.123, subject=org.fedoraproject.MediaWriter, default 10:21:02.239571+0100 tccd -[TCCDAccessIdentity staticCode]: static code for: identifier org.fedoraproject.MediaWriter, type: 0: 0x124f9f120 at /Applications/FedoraMediaWriter.app default 10:21:02.243864+0100 kernel ASP: Security policy would not allow process: 16036, /Applications/FedoraMediaWriter.app/Contents/MacOS/FedoraMediaWriter default 10:21:02.244656+0100 runningboardd [app:16036] termination reported by launchd (9, 8, 9) default 10:21:02.244718+0100 runningboardd Removing process: [app:16036] default 10:21:02.244960+0100 runningboardd Removing launch job for: [app:16036] default 10:21:02.245208+0100 runningboardd Removed job for [app:16036] default 10:21:02.245242+0100 runningboardd Removing assertions for terminated process: [app:16036] default 10:21:02.254071+0100 runningboardd Calculated state for app: none (role: None) default 10:21:02.254292+0100 runningboardd Calculated state for app: none (role: None) default 10:21:02.256031+0100 gamepolicyd Received state update for 16036 (app, none-NotVisible default 10:21:02.256376+0100 launchservicesd Hit the server for a process handle 1c8845c500003ea4 that resolved to: [app:16036] default 10:21:02.268363+0100 loginwindow -[PersistentAppsSupport applicationQuit:] | for app:FedoraMediaWriter, _appTrackingState = 2 default 10:21:02.268400+0100 loginwindow -[PersistentAppsSupport applicationQuit:] | App: FedoraMediaWriter, quit, updating active tracking timer ```

This line stands out to me. I tried to disable Gatekeeper, but still got the same error.

default 10:21:02.243864+0100    kernel  ASP: Security policy would not allow process: 16036, /Applications/FedoraMediaWriter.app/Contents/MacOS/FedoraMediaWriter
sebdanielsson commented 10 months ago

Whoa!

Actually disabling Gatekeeper and re-enabling it did the trick. It's flashing my USB stick now!

Update: USB stick is flashed and everything is working fine!

sudo spctl --master-disable
spctl --status
sudo spctl --master-enable
spctl --status
Screenshot 2023-11-03 at 10 30 39
sebdanielsson commented 10 months ago

Thank you!

One difference I noticed for builds using the new CI system is that the new app filename doesn't contain spaces. Is this intentional? Many users will probably end up with two versions if it's not the same.

grulja commented 10 months ago

Thank you!

One difference I noticed for builds using the new CI system is that the new app filename doesn't contain spaces. Is this intentional? Many users will probably end up with two versions if it's not the same.

Yes, I changed it to simplify it and avoid potential issues when I omit to escape spaces or things like that in the build script. I don't think we have that many users or that many users who keep using FMW frequently on MacOS so hopefully it won't be a big deal.