From d54fbbcb2eacbce6b4e9bfb8a23a9ce43fd7524a Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Sat, 18 Jan 2025 14:39:32 +1100 Subject: [PATCH] Support GitHub's Linux arm64 preview hosts Squashed commit of the following: commit a3916a5671fe0ba67de0abeb76ad629a6e6495a5 Author: Paul Colby Date: Sat Jan 18 14:38:50 2025 +1100 Reinstate all macOS and Windows builds commit bd0c6be29ded53aa7f6e0a6d67e9e4805bdb5306 Author: Paul Colby Date: Sat Jan 18 14:24:42 2025 +1100 Use x86-64 as the arch matrix value For consistency with other workflow jobs. commit 987f22e6725033360a63ac2c9a008c095b269ea0 Author: Paul Colby Date: Sat Jan 18 14:04:59 2025 +1100 Avoid workflow expressions in `uses` GitHub Actions does not support that. commit 30c27940ab48dc5ac4353aebcd52f6261fc7dc42 Author: Paul Colby Date: Sat Jan 18 14:00:51 2025 +1100 Use jdpurcell's patch on linux-arm runners for now At least until https://github.com/jurplel/install-qt-action/issues/248 is resolved. commit b7e5bf1572f67fffef8863d1f70126fb974f4811 Author: Paul Colby Date: Sat Jan 18 13:51:26 2025 +1100 Auto-detect linuxdeploy-aarch64.AppImage too commit ec94af3b7db17f14305bac2cd58644dfd480d6c9 Author: Paul Colby Date: Sat Jan 18 13:12:29 2025 +1100 Set the correct host type (default the arch) commit de316e8a1a21a1b9736c0b10380610dff387ff03 Author: Paul Colby Date: Sat Jan 18 13:01:00 2025 +1100 Tell coveralls the correct arch commit e1176d09a5b8291c254ccecefee3a7067407c287 Author: Paul Colby Date: Sat Jan 18 12:09:22 2025 +1100 Exclude Qt versions not supported by Qt's online installer Thus, not supported by aqtinstall, and thus not supported by install-qt-action. commit ef98409757142158c826051f5a344399c2fc4baa Author: Paul Colby Date: Sat Jan 18 12:02:58 2025 +1100 Install Qt for the right arch commit eb6384781a1bd11b79591c5be5017d25085abe96 Author: Paul Colby Date: Sat Jan 18 11:57:30 2025 +1100 Include the right arch in the Linux build IDs commit 34427ce1f01f672722930f857b922e1ff84e9af0 Merge: 20ce8fe9f 18872c52a Author: Paul Colby Date: Sat Jan 18 11:35:51 2025 +1100 Merge branch 'main' into linux-arm64 commit 20ce8fe9f40f4874b8481118035eee338079aa6c Author: Paul Colby Date: Thu Jan 16 18:01:56 2025 +1100 Hold the correct EFI package commit 5370b0e66278ee8cf86af4c5c4331579d4dd46c1 Author: Paul Colby Date: Thu Jan 16 18:00:00 2025 +1100 Try out GitHub's new Linux arm64 runners Now in public preview: https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/ --- .github/workflows/build.yaml | 50 +++++++++++++++++++++++++++++++++--- src/cli/CMakeLists.txt | 2 +- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index edd6b19c3..38fd8c9fb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ env: jobs: linux: - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04${{ matrix.arch == 'arm64' && '-arm' || '' }} strategy: fail-fast: false matrix: @@ -35,13 +35,31 @@ jobs: - 6.7.3 - 6.8.1 - 6.9.0 + arch: + - arm64 + - x86-64 cc: - clang - gcc + exclude: + # Qt's online installer only provides arm64 builds from Qt 6.7 onwards. Note, Ubuntu (Debian) does provide + # arm64 Qt builds, so we don't exclude `5` nor `6`, just the Qt online versions (5.x.y and 6.[0-6].y). + - { qt: 5.9.9, arch: arm64 } + - { qt: 5.10.1, arch: arm64 } + - { qt: 5.11.3, arch: arm64 } + - { qt: 5.12.12, arch: arm64 } + - { qt: 5.13.2, arch: arm64 } + - { qt: 5.14.2, arch: arm64 } + - { qt: 5.15.2, arch: arm64 } + - { qt: 6.2.4, arch: arm64 } + - { qt: 6.3.2, arch: arm64 } + - { qt: 6.4.3, arch: arm64 } + - { qt: 6.5.3, arch: arm64 } + - { qt: 6.6.3, arch: arm64 } steps: - name: Upgrade OS run: | - sudo apt-mark hold firefox grub-efi-amd64-signed + sudo apt-mark hold firefox grub-efi-${{ matrix.arch == 'arm64' && 'arm64' || 'amd64' }}-signed sudo apt update && sudo apt upgrade sudo apt install lcov llvm - uses: actions/setup-python@v5 @@ -55,7 +73,7 @@ jobs: run: > sudo apt install qt6-{base-{dev{,-tools},doc-dev},connectivity-{dev,doc-html},l10n-tools,tools-dev{,-tools}} - name: Install online Qt version - if: contains(matrix.qt, '.') # ie if not using Ubuntu's Qt5/Qt6. + if: contains(matrix.qt, '.') && matrix.arch != 'arm64' # ie if not using Ubuntu's Qt5/Qt6. uses: jurplel/install-qt-action@v4 with: version: ${{ matrix.qt }} @@ -71,6 +89,27 @@ jobs: aqtsource: >- ${{ (startsWith(matrix.qt, '6.8') || startsWith(matrix.qt, '6.9')) && 'git+https://github.com/miurahr/aqtinstall.git' || '' }} + - name: Install online Qt version for arm64 + # \todo Revert to only using jurplel's action when issue #248 is resolved. + # Note, can probably remove the host property below at the same time. + # \todo See https://github.com/jurplel/install-qt-action/issues/248 + if: contains(matrix.qt, '.') && matrix.arch == 'arm64' # ie if not using Ubuntu's Qt5/Qt6. + uses: jdpurcell/install-qt-action@b45c67aaa9e0ea77e59a7031ec14a12d5ddf4b35 + with: + version: ${{ matrix.qt }} + host: linux_arm64 + modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }} + setup-python: false + documentation: true + doc-archives: >- + ${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' || + (startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }} + doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }} + # \todo Use aqtinstall HEAD for Qt 6.8.1 and 6.9.0 support, until the fix for #843 is released (presumably in + # aqtinstall 3.1.22. See https://github.com/miurahr/aqtinstall/issues/843 + aqtsource: >- + ${{ (startsWith(matrix.qt, '6.8') || startsWith(matrix.qt, '6.9')) && + 'git+https://github.com/miurahr/aqtinstall.git' || '' }} - name: Upload aqtinstall log file if: failure() uses: actions/upload-artifact@v4 @@ -88,7 +127,7 @@ jobs: env: CC: ${{ matrix.cc }} CXX: ${{ matrix.cc == 'gcc' && 'g++' || 'clang++' }} - PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.cc }}.qt-${{ matrix.qt }} + PROJECT_BUILD_ID: ${{ github.run_number }}.linux.${{ matrix.arch }}.${{ matrix.cc }}.qt-${{ matrix.qt }} run: | [[ '${{ matrix.qt }}' =~ ^[56]$ ]] || qtInstallDocs="$RUNNER_WORKSPACE/Qt/Docs/Qt-${QT_VERSION:-${{ matrix.qt }}}" @@ -133,6 +172,9 @@ jobs: if: github.event_name == 'push' && github.actor != 'dependabot[bot]' uses: coverallsapp/github-action@v2 with: + # Note, the coverage-reporter-platform option is currently undocumented. See + # https://github.com/coverallsapp/github-action/issues/218#issuecomment-2436338747 + coverage-reporter-platform: ${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }} file: ${{ runner.temp }}/coverage/coverage.info format: lcov flag-name: linux-${{ matrix.cc }}-${{ matrix.qt }} diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt index 9a6611aa6..72987b6d3 100644 --- a/src/cli/CMakeLists.txt +++ b/src/cli/CMakeLists.txt @@ -82,7 +82,7 @@ target_link_libraries( PRIVATE Qt${QT_VERSION_MAJOR}::Core PRIVATE Qt${QT_VERSION_MAJOR}::Bluetooth) -find_program(LINUXDEPLOY NAMES linuxdeploy linuxdeploy-x86_64.AppImage) +find_program(LINUXDEPLOY NAMES linuxdeploy linuxdeploy-aarch64.AppImage linuxdeploy-x86_64.AppImage) if (LINUXDEPLOY) message(STATUS "Found linuxdeploy: ${LINUXDEPLOY}") configure_file(desktop.in dokit.desktop)