Skip to content
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 Rnote and Installer for Windows Arm64 #1211

Closed
wants to merge 13 commits into from
Closed

Conversation

OB0NE
Copy link

@OB0NE OB0NE commented Sep 8, 2024

Following @Doublonmousse 's advice in #1209 ,I made some adjustments to the former request #1209 to add support for building Rnote on Windows ARM64 while not breaking the x86 build process. architecture. The changes include:

  1. Added a new Meson option 'win-arm64-build-environment-path' in meson_options.txt to specify the path for the ARM64 build environment. I also changed the meson.build to detect architecture and chose build environment accordingly.

  2. Modified cargo_build.py to detect the system architecture and set appropriate Rust flags:

    • Added platform detection for Windows ARM64.
    • Set '-C linker=clang' flag for ARM64 builds on Windows.
  3. Updated rnote_inno.iss.in to include ARM64 architecture support for the Windows installer.

And the issue about black borders is fixed. See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7692.

I’ve only been able to test the build on a Microsoft Surface Pro 11, so I'm unsure how it will perform on other ARM devices.

add options for windows arm64 build environment path
Add support for arm64 architecture.
Detecting architecture.
Detecting architecture.
Detecting architecture(the former change was incomplete)
Add windows arm build instructions
@flxzt
Copy link
Owner

flxzt commented Sep 8, 2024

Maybe I am wrong, but I don't directly see the need for the win-arm64-build-environment-path meson variable. Won't win-build-environment-path already cover this? One would just need to configure the project to point to the clangarm64 environment when building on ARM.

@OB0NE
Copy link
Author

OB0NE commented Sep 9, 2024

Maybe I am wrong, but I don't directly see the need for the win-arm64-build-environment-path meson variable. Won't win-build-environment-path already cover this? One would just need to configure the project to point to the clangarm64 environment when building on ARM.

Do you mean git rid of the win-arm64-build-environment-path , and build like this?

meson setup --prefix=/usr -Dwin-build-environment-path=C:\msys64\clangarm64 _mesonbuild

@flxzt
Copy link
Owner

flxzt commented Sep 9, 2024

Do you mean git rid of the win-arm64-build-environment-path , and build like this?

meson setup --prefix=/usr -Dwin-build-environment-path=C:\msys64\clangarm64 _mesonbuild

Yes exactly!

delete option: win-arm64-build-environment-path
delete option win-arm64-build-environment-path
@OB0NE
Copy link
Author

OB0NE commented Sep 10, 2024

Do you mean git rid of the win-arm64-build-environment-path , and build like this?

meson setup --prefix=/usr -Dwin-build-environment-path=C:\msys64\clangarm64 _mesonbuild

Yes exactly!

I've deleted the 'win-arm64-build-environment-path' and changed the build instructions.

else:
rustflags = ''

cargo_call = f"env {cargo_env} RUSTFLAGS='{rustflags}' {cargo_cmd} build {cargo_options}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer that this logic is in the meson build file, not in this script.

Copy link
Author

@OB0NE OB0NE Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback about moving the logic to the meson build file. I want to be transparent - I've been using AI to help me adjust the code as I have very limited knowledge about Rust and the app building process. This approach has proven to be quite inefficient, and despite multiple attempts, I haven't been able to successfully move the logic to the meson build file.

Rather than continue with AI-assisted code adjustments that might not meet the project's standards, I think I can be more helpful by offering to test any changes you implement on my ARM64 device (Surface Pro 11). This would ensure the changes work correctly on ARM64 Windows hardware, which might be valuable for the project.

So, please feel free to change what I have adjusted and let me know if you'd like me to test any changes you make, and I'll be happy to provide detailed feedback about how it works on ARM64.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a few changes.
I think this does what's intended, by moving the logic back into the meson file (and using an extra argument in the cargo_build.py file).
Feel free to check whether this builds or not on your side, though beware of #1228 (that should get fixed at some point)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants