Skip to content

Commit ce865f5

Browse files
authored
Merge pull request #273 from jdpurcell/arm64-hosts
Support ARM64 hosts
2 parents d005d18 + 8377c56 commit ce865f5

File tree

4 files changed

+45
-17
lines changed

4 files changed

+45
-17
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,17 @@ jobs:
9696
qt:
9797
tools-only-build: true
9898
add-tools-to-path: false
99+
- os: ubuntu-24.04-arm
100+
qt:
101+
version: "6.8.1"
102+
requested: "6.8.1"
103+
modules: qtwebengine qtpositioning qtwebchannel
104+
- os: windows-11-arm
105+
skip-test-project: true
106+
qt:
107+
version: "6.8.1"
108+
requested: "6.8.1"
109+
modules: qtpositioning qtwebchannel
99110

100111

101112
steps:
@@ -123,7 +134,7 @@ jobs:
123134
dir: ${{ matrix.dir }}
124135
modules: ${{ matrix.qt.modules }}
125136
version: ${{ matrix.qt.requested }}
126-
tools: tools_ifw tools_qtcreator,qt.tools.qtcreator
137+
tools: tools_qtcreator_gui,qt.tools.qtcreator_gui
127138
cache: ${{ matrix.cache == 'cached' }}
128139

129140
- name: Install Qt with options and specified aqtversion
@@ -134,7 +145,7 @@ jobs:
134145
dir: ${{ matrix.dir }}
135146
modules: ${{ matrix.qt.modules }}
136147
version: ${{ matrix.qt.requested }}
137-
tools: tools_ifw tools_qtcreator,qt.tools.qtcreator
148+
tools: tools_qtcreator_gui,qt.tools.qtcreator_gui
138149
cache: ${{ matrix.cache == 'cached' }}
139150

140151
- name: Test QT_ROOT_DIR
@@ -157,7 +168,7 @@ jobs:
157168
}
158169
159170
- name: Configure test project on windows
160-
if: ${{ matrix.qt.version && startsWith(matrix.os, 'windows') }}
171+
if: ${{ matrix.qt.version && startsWith(matrix.os, 'windows') && !matrix.skip-test-project }}
161172
env:
162173
QT_VERSION: ${{ matrix.qt.version }}
163174
run: |
@@ -169,7 +180,7 @@ jobs:
169180
shell: cmd
170181

171182
- name: Configure test project on unix
172-
if: ${{ matrix.qt.version && !startsWith(matrix.os, 'windows') }}
183+
if: ${{ matrix.qt.version && !startsWith(matrix.os, 'windows') && !matrix.skip-test-project }}
173184
env:
174185
QT_VERSION: ${{ matrix.qt.version }}
175186
run: |
@@ -228,7 +239,7 @@ jobs:
228239
with:
229240
dir: ${{ matrix.dir }}
230241
tools-only: true
231-
tools: tools_ifw tools_qtcreator,qt.tools.qtcreator tools_cmake tools_ninja tools_conan
242+
tools: tools_ifw tools_qtcreator_gui,qt.tools.qtcreator_gui tools_cmake tools_ninja tools_conan
232243
add-tools-to-path: ${{ matrix.qt.add-tools-to-path }}
233244
cache: ${{ matrix.cache == 'cached' }}
234245

@@ -240,7 +251,7 @@ jobs:
240251
set -x
241252
242253
# tools_ifw: use `archivegen` to test that Tools/QtInstallerFramework/4.7/bin is added to path
243-
# tools_qtcreator: use `qbs` to test that Tools/QtCreator/bin or "Qt Creator.app/Contents/MacOS/" is added to path
254+
# tools_qtcreator_gui: use `qbs` to test that Tools/QtCreator/bin or "Qt Creator.app/Contents/MacOS/" is added to path
244255
# tools_cmake: test that Tools/CMake/bin or Tools/CMake/CMake.app/Contents/bin is added to path
245256
# tools_ninja: test that Tools/Ninja is added to path
246257
# tools_conan: test that Tools/Conan is added to path
@@ -270,7 +281,7 @@ jobs:
270281
[[ -e "../Qt/Tools/Conan/conan" ]]
271282
272283
# tools_ifw: use `archivegen` to test that Tools/QtInstallerFramework/4.7/bin is not added to path
273-
# tools_qtcreator: use `qbs` to test that Tools/QtCreator/bin or "Qt Creator.app/Contents/MacOS/" is not added to path
284+
# tools_qtcreator_gui: use `qbs` to test that Tools/QtCreator/bin or "Qt Creator.app/Contents/MacOS/" is not added to path
274285
# tools_cmake: test that Tools/CMake/bin or Tools/CMake/CMake.app/Contents/bin is not added to path
275286
# tools_ninja: test that Tools/Ninja is not added to path
276287
# tools_conan: test that Tools/Conan is not added to path

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This is the host platform of the Qt version you will be installing. It's unlikel
3232

3333
For example, if you are building on Linux and targeting desktop, you would set host to `linux`. If you are building on Linux and targeting android, you would set host to `linux` also. The host platform is the platform that your application will build on, not its target platform.
3434

35-
Possible values: `windows`, `mac`, `linux` or `all_os`.
35+
Possible values: `windows`, `windows_arm64`, `mac`, `linux`, `linux_arm64` or `all_os`.
3636
`all_os` is used for wasm, and incompatible with `aqtinstall < 3.2.0`.
3737

3838
Defaults to the current platform it is being run on.
@@ -68,6 +68,8 @@ Windows w/ Qt >= 5.15 && Qt < 6.8: `win64_msvc2019_64`
6868

6969
Windows w/ Qt >= 6.8: `win64_msvc2022_64`
7070

71+
Windows (ARM64) w/ Qt >= 6.8: `win64_msvc2022_arm64`
72+
7173
Android: `android_armv7`
7274

7375
### `dir`

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ runs:
9797
uses: actions/setup-python@v5
9898
with:
9999
python-version: '3.10.x - 3.12.x'
100+
# Workaround for https://codeberg.org/miurahr/pyppmd/issues/128
101+
architecture: ${{ runner.os == 'Windows' && runner.arch == 'ARM64' && 'x64' || '' }}
100102

101103
- name: Setup and run aqtinstall
102104
uses: ./action

action/src/main.ts

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,23 @@ const flaggedList = (flag: string, listArgs: readonly string[]): string[] => {
7272
return listArgs.length ? [flag, ...listArgs] : [];
7373
};
7474

75-
const locateQtArchDir = (installDir: string): [string, boolean] => {
75+
const locateQtArchDir = (installDir: string, host: string): [string, boolean] => {
7676
// For 6.4.2/gcc, qmake is at 'installDir/6.4.2/gcc_64/bin/qmake'.
7777
// This makes a list of all the viable arch directories that contain a qmake file.
7878
const qtArchDirs = glob
7979
.sync(`${installDir}/[0-9]*/*/bin/qmake*`)
8080
.map((s) => path.resolve(s, "..", ".."));
8181

82-
// For Qt6 mobile and wasm installations, and Qt6 Windows on ARM installations,
82+
// For Qt6 mobile and wasm installations, and Qt6 Windows on ARM cross-compiled installations,
8383
// a standard desktop Qt installation must exist alongside the requested architecture.
8484
// In these cases, we must select the first item that ends with 'android*', 'ios', 'wasm*' or 'msvc*_arm64'.
8585
const requiresParallelDesktop = qtArchDirs.filter((archPath) => {
8686
const archDir = path.basename(archPath);
8787
const versionDir = path.basename(path.join(archPath, ".."));
8888
return (
89-
versionDir.match(/^6\.\d+\.\d+$/) && archDir.match(/^(android.*|ios|wasm.*|msvc.*_arm64)$/)
89+
versionDir.match(/^6\.\d+\.\d+$/) &&
90+
(archDir.match(/^(android.*|ios|wasm.*)$/) ||
91+
(archDir.match(/^msvc.*_arm64$/) && host !== "windows_arm64"))
9092
);
9193
});
9294
if (requiresParallelDesktop.length) {
@@ -107,7 +109,7 @@ const isAutodesktopSupported = async (): Promise<boolean> => {
107109
};
108110

109111
class Inputs {
110-
readonly host: "windows" | "mac" | "linux" | "all_os";
112+
readonly host: "windows" | "windows_arm64" | "mac" | "linux" | "linux_arm64" | "all_os";
111113
readonly target: "desktop" | "android" | "ios" | "wasm";
112114
readonly version: string;
113115
readonly arch: string;
@@ -149,24 +151,33 @@ class Inputs {
149151
if (!host) {
150152
switch (process.platform) {
151153
case "win32": {
152-
this.host = "windows";
154+
this.host = process.arch === "arm64" ? "windows_arm64" : "windows";
153155
break;
154156
}
155157
case "darwin": {
156158
this.host = "mac";
157159
break;
158160
}
159161
default: {
160-
this.host = "linux";
162+
this.host = process.arch === "arm64" ? "linux_arm64" : "linux";
161163
break;
162164
}
163165
}
164166
} else {
165167
// Make sure host is one of the allowed values
166-
if (host === "windows" || host === "mac" || host === "linux" || host === "all_os") {
168+
if (
169+
host === "windows" ||
170+
host === "windows_arm64" ||
171+
host === "mac" ||
172+
host === "linux" ||
173+
host === "linux_arm64" ||
174+
host === "all_os"
175+
) {
167176
this.host = host;
168177
} else {
169-
throw TypeError(`host: "${host}" is not one of "windows" | "mac" | "linux" | "all_os"`);
178+
throw TypeError(
179+
`host: "${host}" is not one of "windows" | "windows_arm64" | "mac" | "linux" | "linux_arm64" | "all_os"`
180+
);
170181
}
171182
}
172183

@@ -205,6 +216,8 @@ class Inputs {
205216
} else {
206217
this.arch = "win64_msvc2017_64";
207218
}
219+
} else if (this.host === "windows_arm64") {
220+
this.arch = "win64_msvc2022_arm64";
208221
}
209222
}
210223

@@ -482,7 +495,7 @@ const run = async (): Promise<void> => {
482495
}
483496
// Set environment variables/outputs for binaries
484497
if (inputs.isInstallQtBinaries) {
485-
const [qtPath, requiresParallelDesktop] = locateQtArchDir(inputs.dir);
498+
const [qtPath, requiresParallelDesktop] = locateQtArchDir(inputs.dir, inputs.host);
486499
// Set outputs
487500
core.setOutput("qtPath", qtPath);
488501

0 commit comments

Comments
 (0)