NotepadNext icon indicating copy to clipboard operation
NotepadNext copied to clipboard

Native support for ARM-Based Macs

Open GithubGey opened this issue 2 years ago • 12 comments

期待可以出一个mac M1版本的

GithubGey avatar Sep 19 '22 13:09 GithubGey

If the currently available .dmg file on the releases page does not run on mac M1 then I'm not able to do much. I don't use Mac at all so I'm not sure what all this would require. Someone else would have to look into it.

dail8859 avatar Sep 19 '22 13:09 dail8859

QT's native support for Apple Silicon is from QT 6.2

gtn1024 avatar Oct 09 '22 02:10 gtn1024

Maybe I can take this issue, I have a mac and did some Qt development several years ago.

necokeine avatar Oct 09 '22 09:10 necokeine

I'm not sure whether this dmg works too on your side. https://github.com/necokeine/NotepadNext/releases/tag/v0.5.5

necokeine avatar Oct 09 '22 11:10 necokeine

@necokeine

Maybe I can take this issue

Any help would be greatly appreciated! And if it's only possible with Qt6.2 then that's fine. This project will be moving to that at some point in the near future.

dail8859 avatar Oct 09 '22 12:10 dail8859

I'm using M1 Macbook pro, just tried the .dmg in release 0.55, it can work.

xiaoduo avatar Oct 12 '22 05:10 xiaoduo

I’m using a Mac M1 too and the 0.5.5 dmg works fine

PaddyTB avatar Oct 12 '22 08:10 PaddyTB

If the currently available .dmg file on the releases page does not run on mac M1 then I'm not able to do much. I don't use Mac at all so I'm not sure what all this would require. Someone else would have to look into it.

估计他的意思是 希望支持 M1的arm架构 目前是可以通过转译运行。

72min avatar Oct 12 '22 09:10 72min

Yes, it's running the Intel binaries just fine under Rosetta

PaddyTB avatar Oct 12 '22 09:10 PaddyTB

Forgive me for being completely illiterate when it comes to Mac hardware...so is this still a valid issue? Or are there arm-based M1 chips that this application still doesn't work for?

dail8859 avatar Oct 12 '22 15:10 dail8859

Intel binaries get translated at runtime by Rosetta 2 on ARM macs - and this appears to be working fine for me and @xiaoduo. Native ARM support will be cool when it comes along but I believe it’s working well under emulation for now. It’s not a bug / issue so much a a feature request or enhancement IMO as we should (hopefully) get improved performance once it runs natively on ARM. HTH

PaddyTB avatar Oct 12 '22 18:10 PaddyTB

@necokeine

Maybe I can take this issue

Any help would be greatly appreciated! And if it's only possible with Qt6.2 then that's fine. This project will be moving to that at some point in the near future.

Yes, this compilation is only success Qt higher than 6.2, I did it with Qt6.4. I believe that Qt could cross-compile M1 binary on other platform, so all things should be done is just add a new compilation process for M1.

necokeine avatar Oct 13 '22 05:10 necokeine

原谅我在Mac硬件方面完全是文盲...那么这仍然是一个有效的问题吗?或者是否有基于arm的M1芯片,此应用程序仍然不起作用?

转译运行性能跟效率不佳,如果只是简单文本记录影响不大,但是在需要占用大量ram cpu的时候就会表现卡顿。如果可以编译支持arm64架构的应用 会更佳。

72min avatar Oct 18 '22 19:10 72min

https://doc.qt.io/qt-6/macos.html - it seems the fix is trivial. Can anyone with a Mac confirm that the generated binary contains also arm64 support?

diegoiast avatar Oct 18 '22 20:10 diegoiast

https://doc.qt.io/qt-6/macos.html - it seems the fix is trivial. Can anyone with a Mac confirm that the generated binary contains also arm64 support?

Indeed and @necokeine has already done it - see his message earlier in this thread... but the underlying QT version needs to be 6.2+

PaddyTB avatar Oct 18 '22 20:10 PaddyTB

@dail8859 You are currently using Qt 6.2.4 for official builds. IMHO, you can bump this to 6.3.1 without issues. This would fix the official releases, no? If someone wants to locally build against 6.1.x or 6.2.x - some things might be broken. (I am using 6.4.x and its fine, but you might be more conservative).

https://github.com/dail8859/NotepadNext/blob/fe75620eecb2a35e59383acfec98a252dc60a636/.github/workflows/build.yml#L23

diegoiast avatar Oct 21 '22 19:10 diegoiast

@elcuco I'm building with 6.2.4 in the action (and generating the artifact), but the binaries published on the releases page are still using 5.15.

In the next release or two I plan to officially switch to 6.2 (or later) for the 'official' binaries.

dail8859 avatar Oct 21 '22 19:10 dail8859

So now that Qt6.2 (and also Qt6.4) is being used, is this issue as simple as adding:

QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64

To the project file?

dail8859 avatar Dec 06 '22 13:12 dail8859

I've got a new test build (you'll need to unzip it first). This should be a multi-architecture binary that supports ARM.

https://github.com/dail8859/NotepadNext/suites/10221193752/artifacts/500858023

dail8859 avatar Jan 06 '23 13:01 dail8859

I've got a new test build (you'll need to unzip it first). This should be a multi-architecture binary that supports ARM.

https://github.com/dail8859/NotepadNext/suites/10221193752/artifacts/500858023

收到 我试试

GithubGey avatar Jan 07 '23 01:01 GithubGey

I've got a new test build (you'll need to unzip it first). This should be a multi-architecture binary that supports ARM.

https://github.com/dail8859/NotepadNext/suites/10221193752/artifacts/500858023

This is running great as an ARM64 binary on my Mac - fab! Loving the new session retention stuff too - thanks @dail8859!

PaddyTB avatar Jan 10 '23 23:01 PaddyTB

@PaddyTB Thanks for the info and testing it out!

dail8859 avatar Jan 11 '23 00:01 dail8859