-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
Build For Apple Silicon (new Github runners) #2912
Comments
The build process for macos would need to work on Qt6 to do that I guess. And I'm lacking M1 hardware to be able to test the result 😁 |
I'm happy to help however I can. Unfortunately know nothing about QT to actually prepare a full PR, but if you want me to run a certain GitHub action or script, or test the result happy to do so. BTW QTOwnNotes do sometimes freeze for a few seconds on M1. I don't know if it's just a bug, or related to not being built for apple Silicon, but in the past I've seen weird behaviors like this happen on intel apps run on M1 |
Thank you! QOwnNotes/.github/workflows/build-release.yml Lines 331 to 395 in 952a368
Most of the actual process is abstracted to https://github.com/pbek/QOwnNotes/blob/main/build-systems/github/macos/create-dmg.sh. In case Qt6 is needed, this is where I experimentally build the macOS build with Qt6: QOwnNotes/.github/workflows/build-release-qt6.yml Lines 355 to 410 in 952a368
Any debug logs? |
Building should maybe even work with Qt5 and qmake says: https://doc-snapshots.qt.io/qt5-5.15/macos.html#architectures @gal064, so in theory you could try to fork the QOwnNotes repository and add QOwnNotes/.github/workflows/build-release.yml Line 377 in 952a368
If you enabled GitHub actions and push your changes to the |
Tried to run it but I'm getting: Also tried to comment out the x86 config in I'm not sure if that error is unrelated or making changes to the pri file created that error. I was pretty much guessing |
I guess Botan is able to compile for ARM, so it must be something with the settings... 🤔 |
Yep. I have no idea how to push forward here, so if you or anyone else want to pick this up would be greatly appreciated. Anyway I'll submit a bug on the small freezes when it happens next |
I tried just adding |
I wonder if any of the notes here on cross compilation might help/work? |
Looking at the logs, can the failure might be due to this:
|
I ran into the same issue but wasn't sure how to set it up |
Ah, good find! Hm... 🤔 |
I have a MBPro M3 Pro and was able to build for Apple Silicon. I did the fallowing: brew install qt-creator brew install qt brew install qt@5 open QT Creator then I think there was a 'configure project' button but it's not there now and I don't recall exactly, sorry. But that did it's thing for a while. I've never used QT Creator before so going by memory. then I built it and ran it and it worked, building an Apple Silicon version |
hmmm... ran into a hitch, I copied the .app to my Mac Mini M2 and it crashed on start until I installed qt@5 |
You could try to use the package manager nix to install QOwnNotes on the mac. 🤔 |
ok, not bad idea, but the nix version is 24.4.0 and current release is 24.4.2. But it is Apple Silicon which is nice. |
Will be surely in the build pipeline. QOwnNotes is at 24.4.2 in nix. |
I'd like to know if it worked in case you try 😉 |
It does not build even with nix 24.11, and nix lists it as available for aarch64 darwin, it is not. Same error as I reported elsewhere here:
|
Hm, that's just to run the (graphical) application to generate the shell completion. 🤔 |
But nix errors out so stuff does not build. What's the solution? xvfd was not included on Macs anymore long ago. xquartz might make it happen I suppose. |
Can you please try building the app without the whole block from https://github.com/NixOS/nixpkgs/blob/d0797a04b81caeae77bcff10a9dde78bc17f5661/pkgs/applications/office/qownnotes/default.nix#L56-L61? |
The whole build chain, release process and update mechanism is structured around one single macOS package...
Hm, can you turn on the internal icon theme?
If there is no other way, then the nix release could be that build. Nix can also update that package. |
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
The nixos package from https://github.com/pbek/QOwnNotes/blob/main/default.nix should build now. But I wonder which platform the regular macOS app build is current running on... It does look as if @sfatula, @KwisatzJim could you maybe send the first paragraph from the debug settings when running the regular build? |
If I get a chance before flying out I can try it. Meanwhile, I turned on the internal theme (restarted of course), same issue. So, I turned off dark mode icon theme, still no change. Here's my debug settings from the regular intel build: `## General Info Current Date: |
x86_64, thank you. |
For the one I built somewhat and mostly works but has (at least) the icon issues, it looks like this on Apple Silicon: `## General Info Current Date: |
Thank you. |
Signed-off-by: Patrizio Bekerle <[email protected]>
24.12.2
|
So, I did use that default.nix file, it does run to completion. I do not find a .app file, I searched everything under /nix/store. And it's not in /Applications/Nix Apps either. A find command finds it nowhere. I do see the binary file again (in my case at /nix/store/d929s2zwg8lybx9yd3g504w359c4820f-qownnotes-24.11.2/bin/) but that's not a Mac app. It can be run but it should be packaged like all other Mac apps with a .app extension and a bunch of stuff underneath that. I would guess most any Mac app on nix has a packager to do so. An example might be the commonLinux program remmina which I use. The other good news is the icons all look good. I'm leaving town for a week to visit family so won't be able to do much more, but maybe look at remmina builder on nix, it should have an example of how to package it for OSX. I can run the new version for now, I can wrap something around it so it's an app if you think that useful to make sure all the various features work on Apple Silicon, in my case a Mac Studio which has an M1 processor. |
If you compile something that is not part of your nix configuration, nix creates a
The icons from which build? |
I made it part of my nix configuration as I didn't know how to compile something outside of my nix configuration, no ./result folder. I overlaid the nix default.nix with this one and did a darwin-rebuild. So, just as if someone used nix to build it, no .app (Mac app) file, just the binary that gets included amongst other things in the .app file (which is actually a folder). I only had one app being built with nix, remmina as it was the only source for Apple Silicon version. So, not much need to learn anything about it. The icons from the new build work fine. From previous build as I had noted above a few days ago, it did not. I can turn the binary into a app "file" via automator or other simple method. I just htink it should build a proper .app "file" so others than may use it don't have to mnss around. |
The aarch64_darwin nix build or the x86 macOS release build?
I've found some hints of packages dealing with an app file, but I'm not sure yet why it wasn't created in the build process. https://github.com/search?q=repo%3ANixOS%2Fnixpkgs+%22.app%22+path%3A*.nix&type=code In the release build, I create the app file in the build script with macOS tooling... |
The aarch64_darwin build, icons work perfectly (as did the original x86 build). It did not work with the first nix build made originally with your initial nix changes. I don't have a x86 machine. Mac with m# chip can run x86 binaries but it's via a code translater and you have to install it. Thus far, everything works with the arm build. Been using it for a day. How nix works is beyond me, never looked at the developer doc. But you asked them so hopefully they have an answer or maybe it just works once included in their entire system. |
Signed-off-by: Patrizio Bekerle <[email protected]>
NixOS/nixpkgs#363327 is now merged into |
Signed-off-by: Patrizio Bekerle <[email protected]>
Github runners for M1 are now available and I'm not familiar with QT, but it looks like you could even build an M1 version on intel silicon.
Would it be possible to have an M1 build?
The text was updated successfully, but these errors were encountered: