spotube icon indicating copy to clipboard operation
spotube copied to clipboard

M1 Mac Support

Open KRTirtho opened this issue 3 years ago β€’ 23 comments

Is there a way you can make the app a universal app (aka add support for m1) instead of only an intel app?

Originally posted by @highjeans in https://github.com/KRTirtho/spotube/issues/9#issuecomment-1027525326

KRTirtho avatar Feb 02 '22 04:02 KRTirtho

@highjeans, The M1 Mac Support can take a bit of time. Currently have no way to build the app on ARM architecture due to github action only supports x86_64 runners. If you've a M1 mac, you can contribute to the project

KRTirtho avatar Feb 02 '22 04:02 KRTirtho

I am currently on an M1 Mac, so yes I can do that.

highjeans avatar Feb 02 '22 04:02 highjeans

Can you add me as a contributor? I will need that in order to do anything.

highjeans avatar Feb 02 '22 04:02 highjeans

I don't have to. You can fork the project & then do modifications/enhancements you want to. Then create a PR. I'll then review it & merge accordingly For further help see: Your First Code Contribution

KRTirtho avatar Feb 02 '22 04:02 KRTirtho

So I was able to get an arm version compiled, but the way to do it was to change a file that was generated when we ran flutter build macos.

highjeans avatar Feb 02 '22 05:02 highjeans

Seems like we have to wait until building for arm is supported natively as changing the generated file caused tons of errors.

highjeans avatar Feb 02 '22 17:02 highjeans

M1 Mac support is now only not possible due to unavailability of MacOS VM support with M1 hardware in Github Actions https://github.com/actions/virtual-environments/issues/2187

KRTirtho avatar Mar 23 '22 08:03 KRTirtho

It doesn't matter if M1 hardware is required, it matters if flutter can build an M1 version or a universal version or not

highjeans avatar Mar 23 '22 14:03 highjeans

M1 is supported natively in Flutter we just don't have the hardware/VMs to build the app now

KRTirtho avatar Mar 23 '22 16:03 KRTirtho

@KRTirtho I just learned that flutter 3 now build universal binaries, so I think building for m1 should work now

highjeans avatar May 13 '22 05:05 highjeans

@highjeans That's great. Can you try running Spotube with Flutter 3 since I don't have a m1 mac?

KRTirtho avatar May 13 '22 05:05 KRTirtho

@KRTirtho currently the build it's failing because of this I believe: https://github.com/bitsdojo/bitsdojo_window/issues/169

What I did:

flutter upgrade
flutter clean
flutter pub get
flutter build macos --release

Similar output as: https://github.com/flutter/flutter/issues/103571#issuecomment-1125705625

karniv00l avatar May 13 '22 14:05 karniv00l

@karniv00l There is a pull request regarding the issue: https://github.com/bitsdojo/bitsdojo_window/pull/155

highjeans avatar May 13 '22 14:05 highjeans

@KRTirtho I tried building it through Github Actions and it failed from the same issue in bitsdojo.

highjeans avatar May 13 '22 16:05 highjeans

That's great news. Now we've to wait

KRTirtho avatar May 13 '22 17:05 KRTirtho

M1 Mac support (through Rosetta) was added by https://github.com/KRTirtho/spotube/pull/87. Thanks to Flutter 3.0 MacOS Universal binary package support, the M1 Mac executable is available now Can you see if the latest version 2.3.0 works or not?

KRTirtho avatar Jul 11 '22 06:07 KRTirtho

It's been working fine via Rosetta for some time. I believe this issue can be closed, native arm64/universal binary it's a different story though (no M1 machines available yet in GH actions)

karniv00l avatar Jul 11 '22 07:07 karniv00l

@karniv00l Yeah, native M1 macs gonna take a while Btw, can you check if Media Controls in MacOS works or not?

KRTirtho avatar Jul 11 '22 08:07 KRTirtho

It's working great!

Screenshot 2022-07-11 at 11 10 14

However, there are a couple of UI quirks, some of them related to mac:

Screenshot 2022-07-11 at 11 11 10

I might open a new issue for others, so I don't clog up this thread, but generally try to test some views while resizing.

karniv00l avatar Jul 11 '22 09:07 karniv00l

Glad to hear that.... Thanks πŸ‘

KRTirtho avatar Jul 11 '22 09:07 KRTirtho

I'm not sure I've misunderstood anything, but I download v2.3.0 and use it.

It was a native apple silicon app in the system monitor app. It works well. ζˆͺεœ– 2022-07-15 δΈ‹εˆ5 58 37

yoyo930021 avatar Jul 15 '22 10:07 yoyo930021

Oh yes! You don't actually need M1 to build the universal binary, so the latest release (2.3.0) that I've just tested is actually universal:

$ file spotube.app/Contents/MacOS/spotube

spotube.app/Contents/MacOS/spotube: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64
- Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64
- Mach-O 64-bit executable arm64]
spotube.app/Contents/MacOS/spotube (for architecture x86_64):	Mach-O 64-bit executable x86_64
spotube.app/Contents/MacOS/spotube (for architecture arm64):	Mach-O 64-bit executable arm64

karniv00l avatar Jul 16 '22 08:07 karniv00l

Wow, we unknowingly have support for M1 Mac! Maybe that's because Flutter 3.0 now builds & ships Universal Binaries by default. That's just awesome

KRTirtho avatar Jul 16 '22 08:07 KRTirtho