-
Notifications
You must be signed in to change notification settings - Fork 181
Extend support to include win-arm64 #1323
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
Changes from all commits
a879c77
e8487de
98dc253
b4295a3
6083079
5fce452
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ | |
| "linux-ppc64le", | ||
| "linux-s390x", | ||
| "win-64", | ||
| "win-arm64", | ||
| "osx-64", | ||
| "osx-arm64", | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -658,12 +658,23 @@ Function .onInit | |
| # on whether it's a 32-bit or 64-bit installer | ||
| SetRegView {{ BITS }} | ||
| {%- if win64 %} | ||
| # If we're a 64-bit installer, make sure it's 64-bit Windows | ||
| ${IfNot} ${RunningX64} | ||
| # Make sure we're not on 32-bit or native ARM64 Windows (the latter would | ||
| # otherwise silently run this x64 installer under x64 emulation). | ||
| ${IfNot} ${IsNativeAMD64} | ||
| MessageBox MB_OK|MB_ICONEXCLAMATION \ | ||
| "This installer is for a 64-bit version for ${NAME}$\n\ | ||
| but your system is 32-bit. Please use the 32-bit Windows$\n\ | ||
| ${NAME} installer." \ | ||
| "This installer is for the 64-bit (x86_64) version of ${NAME}$\n\ | ||
| but your system is not x86_64. Please use the installer that$\n\ | ||
| matches your system's architecture." \ | ||
| /SD IDOK | ||
| Abort | ||
| ${EndIf} | ||
| {%- elif win_arm64 %} | ||
| # Make sure we're actually on native ARM64 Windows. | ||
| ${IfNot} ${IsNativeARM64} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we have a similar check for the MSI installers?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did some investigation and couldnt find anything that exists today unfortunately. @freakboy3742 do you know if there is anything to check if an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WiX (and therefore Briefcase-generated) installers do some CPU detection by default - if you try to run an ARM64 installer on x86-64, you get an error:
The inverse isn't true, however - ARM64 machines can run x86-64 installers (using CPU emulation mode). It might be possible to prevent this case as well, but it's not currently prevented by default.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, perhaps also due to emulation it currently makes sense not to prevent it by default but perhaps exposing an option in pyproject.toml to enable/disable it would do the job? If you think so, let me know and Im happy to open a new ticket. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exposing it as an option seems plausible as an option; my main concern would be whether there's actually demand for it. From what I've seen, it won't be a trivial addition (as in - it's not a simple "if" statement or pre-existing MSI config option - we'd need to build it from low-level primitives). If this is a case of "theoretical" interest rather than a use case, then I'd rather avoid the complexity. That said, I guess a ticket couldn't hurt from at least an information gathering capacity... |
||
| MessageBox MB_OK|MB_ICONEXCLAMATION \ | ||
| "This installer is for the ARM64 version of ${NAME}$\n\ | ||
| but your system is not ARM64. Please use the installer that$\n\ | ||
| matches your system's architecture." \ | ||
| /SD IDOK | ||
| Abort | ||
| ${EndIf} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ### Enhancements | ||
|
|
||
| * Add support for Windows ARM64. (#1323) | ||
|
|
||
| ### Bug fixes | ||
|
|
||
| * <news item> | ||
|
|
||
| ### Deprecations | ||
|
|
||
| * <news item> | ||
|
|
||
| ### Docs | ||
|
|
||
| * <news item> | ||
|
|
||
| ### Other | ||
|
|
||
| * <news item> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import sys | ||
|
|
||
| import pytest | ||
|
|
||
| # winexe.py needs Pillow, which isn't installed on Linux. Skip this file there | ||
| # and only import winexe inside each test, so collection doesn't fail. | ||
| pytestmark = pytest.mark.skipif(sys.platform != "win32", reason="winexe is Windows-only") | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "platform,expected", | ||
| [ | ||
| ("win-32", ("32-bit", 32)), | ||
| ("win-64", ("64-bit", 64)), | ||
| ("win-arm64", ("ARM64", 64)), | ||
| ], | ||
| ) | ||
| def test_parse_arch(platform, expected): | ||
| from constructor.winexe import parse_arch | ||
|
|
||
| assert parse_arch(platform) == expected |

Uh oh!
There was an error while loading. Please reload this page.