NotepadNext icon indicating copy to clipboard operation
NotepadNext copied to clipboard

Windows ARM Support

Open lingyicute opened this issue 9 months ago • 11 comments

Description

Hi maintainers! First of all, thank you for this great project. Nowadays, Windows on ARM devices like the Surface Pro X are becoming increasingly popular. I would love to use this editor natively on these devices. However, the current build seems to target x86/x64 architectures only. I was wondering if there are any plans to support ARM architecture in the near future?

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

lingyicute avatar Mar 18 '25 16:03 lingyicute

Having ARM support would be desirable, but I have no experience or way to test/debug builds for ARM. If someone was willing to contribute the required changes to the code, project files, CI/CD, etc I'd be very willing to accept it. I wouldn't be able to offer too much help but would try where I could.

dail8859 avatar Mar 20 '25 23:03 dail8859

Hopefully GitHub runner supports Windows ARM soon: https://github.com/github/roadmap/issues/1098

NN--- avatar Apr 11 '25 06:04 NN---

This is great news! However, after checking the documentation, Windows ARM runners are not currently available for public repositories. That said, if someone could submit a PR to address architecture-specific issues, I can immediately build and test it on my Windows ARM device. Additionally, I'm willing to provide remote administrator access to a Windows ARM VM for anyone qualified to tackle this.

lingyicute avatar Apr 11 '25 07:04 lingyicute

So I possibly(?) think I have some good news.

On my PC I was able to install the arm64 libraries for visual studio, and the arm64 libraries for Qt and was able to compile the code and get an executable pretty easily. I of course cannot run the application or verify anything is correct other than I get no errors while building. There's also no windeployqt for arm, so I'm not sure the best way to even begin to test this.

I could potentially zip up the equivalent arm dlls as the normal version has, but that would be a shot in the dark.

dail8859 avatar Apr 11 '25 21:04 dail8859

You can send the binaries here or to my email (available on my Github profile). I'll be able to test them. As a side note: Today I noticed that NotepadNext on Flathub already has an arm64 build. You might consider creating an ARM-architecture AppImage and uploading it to the releases section. If needed, I also have a Linux arm64 device available for testing it. (Of course, Github Actions' newly launched Linux arm runners could also be used for testing, though desktop environments would require manual installation.)

lingyicute avatar Apr 14 '25 15:04 lingyicute

You can send the binaries here or to my email

Give me a few days to try to find some time and I'll package them up and find some way to send them to you.

You might consider creating an ARM-architecture AppImage and uploading it to the releases section

If someone updated the github actions and it is not hard to maintain, I'd be glad to accept it. I have no way to debug if any of it goes wrong. Fighting with github actions is never fun :)

dail8859 avatar Apr 14 '25 15:04 dail8859

@lingyicute Apologies for the delay.

This is a complete shot in the dark so no clue if this will even work.

Extract and run the exe.

arm.zip

dail8859 avatar Apr 20 '25 01:04 dail8859

Sorry, I’ve been busy with exams these past few days. I just got the chance to try it out now.

It seems we’re missing a DLL:

Image

I also tried it with the x64 version of qt6printsupport.dll, but this attempt clearly failed. I got an architecture mismatch error (0xc000007b).

Image

lingyicute avatar Apr 24 '25 08:04 lingyicute

Attempt number 2 which includes the Qt6PrintSupport.dll

arm_v2.zip

dail8859 avatar Apr 25 '25 20:04 dail8859

This is fantastic! I've experimented with it and the software works perfectly. The picture shows the basic tests I did, such as opening files, finding and replacing, changing fonts, and so on. The only thing that is a bit strange is that the arm version of the notepadnext toolbar shows a sort of UWP style. Is this a feature of the new version of qt?

Image Image Image Image Image

lingyicute avatar Apr 27 '25 01:04 lingyicute

the arm version of the notepadnext toolbar shows a sort of UWP style. Is this a feature of the new version of qt?

I'm honestly not sure.

At this point I guess this proves an ARM build is possible but there's still a few things to work through.

  1. I think ARM support is in Qt6.5 but would have to double check. Any Qt version beyond that breaks the single application instance support.
  2. Building the ARM version would have to be set up with github actions. I've already proven you do not need the ARM runners to do this. Would probably need to manually install the ARM libraries for MSVC somehow (no clue how to do that), and the ARM libraries of Qt.
  3. It looks like Qt for ARM doesn't support the windeployqt command line tool, making it very difficult to automate deployment of a new build.

dail8859 avatar Apr 29 '25 21:04 dail8859