Skip to content

Commit a9ec424

Browse files
authored
GH-700: Windows 11 ARM plugin compatibility (#703)
Force Windows 11 ARM builds to use the x86_64 release of protoc and related plugins to enable interop via Prism emulation. This enables Windows 11 ARM to use this plugin out of the box. Fixes GH-700.
1 parent e2579c1 commit a9ec424

5 files changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ jobs:
7878
java-version: 11
7979
maven-version: "${{ needs.validate.outputs.default_maven_version }}"
8080

81-
#- title: Windows arm64 - jdk21
82-
# os-name: windows-11-arm
83-
# java-version: 21 # This is the earliest-supported version on Windows ARM
84-
# maven-version: "${{ needs.validate.outputs.default_maven_version }}"
81+
- title: Windows arm64 - jdk21
82+
os-name: windows-11-arm
83+
java-version: 21 # This is the earliest-supported version on Windows ARM
84+
maven-version: "${{ needs.validate.outputs.default_maven_version }}"
8585

8686
- title: Linux arm64 - jdk11
8787
os-name: ubuntu-24.04-arm

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/dependencies/PlatformClassifierFactory.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ public final class PlatformClassifierFactory {
5454
"amd64", "windows-x86_64",
5555
"x86", "windows-x86_32",
5656
"x86_32", "windows-x86_32",
57-
"x86_64", "windows-x86_64"
57+
"x86_64", "windows-x86_64",
58+
// Protoc's developers have no plans to support an ARM release of
59+
// protoc. The Prism emulator is included in Windows 10 and Windows
60+
// 11 to execute x86 binaries on the ARM instruction set.
61+
// Reportedly, Windows 10 only supports 32-bit ARM emulation, whereas
62+
// Windows 11 supports both.
63+
// At this time, we pin to the 64 bit version since Windows 10 is
64+
// near EOL at the time of writing, and more support in protoc
65+
// plugins will be available by vendors for 64 bit releases.
66+
"aarch64", "windows-x86_64"
5867
);
5968

6069
private static final Map<String, String> FALLBACK_MAPPING = Map.of();

protobuf-maven-plugin/src/site/markdown/requirements.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ architectures and operating systems. These are listed below:
5454
<ul>
5555
<li>amd64 (x86_64)</li>
5656
<li>x86 (x86_32)</li>
57+
<li>aarch64</li>
5758
</ul>
5859
</td>
5960
<td>
@@ -77,16 +78,15 @@ Refer to the `protocVersion` parameter documentation on the
7778

7879
### Windows on ARM
7980

80-
As of right now, no official binaries for `aarch64` Windows systems are provided.
81-
You may be able to use x86 emulation to get this to work. To do this, refer to
82-
the Microsoft ARM emulation documentation.
81+
As of right now, no official binaries for `aarch64` Windows systems are provided,
82+
and there has been no sign of plans at the time of writing to support this from
83+
Google.
8384

84-
Pass the `-Dos.arch=x86_64 -Dos.name=Windows` flag to Maven to force the use of the
85-
amd64 binary for Windows.
85+
Windows 11 ARM releases support x86 emulation via the Prism emulator.
8686

87-
Alternatively, you can build `protoc` yourself. Refer to the `protobufCompiler`
88-
parameter documentation on the [goals page](plugin-info.html) for how you can override
89-
the binary being used.
87+
To enable users to build on Windows ARM machines, this plugin will always download the
88+
x86_64 release of `protoc` and any corresponding plugins, with the assumption that
89+
emulation will work successfully.
9090

9191
### BSDs, Linux on unsupported CPUs, MINIX, Solaris, etc
9292

protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/dependencies/PlatformClassifierFactoryTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ static Stream<Arguments> validClassifierCases() {
9595
arguments(windows().and(arch("amd64")), "windows-x86_64"),
9696
arguments(windows().and(arch("x86_64")), "windows-x86_64"),
9797
arguments(windows().and(arch("x86")), "windows-x86_32"),
98-
arguments(windows().and(arch("x86_32")), "windows-x86_32")
98+
arguments(windows().and(arch("x86_32")), "windows-x86_32"),
99+
arguments(windows().and(arch("aarch64")), "windows-x86_64")
99100
);
100101
}
101102

scripts/install-protoc-to-github-runner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -o errexit
1010
set -o nounset
1111
[[ -n ${DEBUG+defined} ]] && set -o xtrace
1212

13-
readonly version=4.30.1
13+
readonly version=4.31.1
1414

1515
case "$(uname)" in
1616
Linux)

0 commit comments

Comments
 (0)