From d1abd6a40ae486bb247efca61abe7c25f397e1b8 Mon Sep 17 00:00:00 2001 From: Aleksey Komarov Date: Tue, 20 May 2025 19:08:24 +0300 Subject: [PATCH] Add arm64 build. Use container: ubuntu:bionic for both arm64 and amd64 --- .github/workflows/build.yaml | 7 +++++-- tests/tests-ci.sh | 13 +++++++++---- tests/tests-environment.sh | 18 ++++++++++++------ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5f735ebb..9301d8f1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,8 +4,11 @@ on: [push, pull_request, workflow_dispatch] jobs: build: name: Build - runs-on: ubuntu-22.04 - container: ubuntu:xenial + strategy: + matrix: + os: [ubuntu-22.04, ubuntu-22.04-arm] + runs-on: ${{ matrix.os }} + container: ubuntu:bionic env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TRAVIS_BUILD_NUMBER: ${{ github.run_number }} diff --git a/tests/tests-ci.sh b/tests/tests-ci.sh index e054d0d8..9438323b 100755 --- a/tests/tests-ci.sh +++ b/tests/tests-ci.sh @@ -2,8 +2,13 @@ set -x -source /opt/qt*/bin/qt*-env.sh -/opt/qt*/bin/qmake CONFIG+=release CONFIG+=force_debug_info linuxdeployqt.pro +qmake CONFIG+=release CONFIG+=force_debug_info linuxdeployqt.pro; +if [ "$(uname -m)" = "aarch64" ]; then + tool_arch="aarch64"; +else + tool_arch="x86_64"; +fi + make -j$(nproc) # Test (it is commented out because current PVS Studio license is expired, it might be re-enabled later if a new license is granted) @@ -52,7 +57,7 @@ ulimit -a -H set +e # print version number (need to extract the AppImage because we are running in a container, see https://github.com/AppImage/AppImageKit/wiki/FUSE#docker) -./linuxdeployqt-*-x86_64.AppImage --appimage-extract-and-run --version +./linuxdeployqt-*-$tool_arch.AppImage --appimage-extract-and-run --version # TODO: reactivate tests #bash -e tests/tests.sh @@ -63,7 +68,7 @@ if [ $RESULT -ne 0 ]; then echo "FAILURE: linuxdeployqt CRASHED -- uploading files for debugging to transfer.sh" set -v [ -e /tmp/coredump ] && curl --upload-file /tmp/coredump https://transfer.sh/coredump - curl --upload-file linuxdeployqt-*-x86_64.AppImage https://transfer.sh/linuxdeployqt-x86_64.AppImage + curl --upload-file linuxdeployqt-*-$tool_arch.AppImage https://transfer.sh/linuxdeployqt-$tool_arch.AppImage find -type f -iname 'libQt5Core.so*' -exec curl --upload {} https://transfer.sh/libQt5Core.so \; || true exit $RESULT fi diff --git a/tests/tests-environment.sh b/tests/tests-environment.sh index 2092c946..f2affe4d 100755 --- a/tests/tests-environment.sh +++ b/tests/tests-environment.sh @@ -2,15 +2,21 @@ set -e -sudo add-apt-repository --yes ppa:beineri/opt-qt593-xenial sudo apt-get update -qq # wget https://ftp.fau.de/debian/pool/main/p/patchelf/patchelf_0.8-2_amd64.deb # echo "5d506507df7c02766ae6c3ca0d15b4234f4cb79a80799190ded9d3ca0ac28c0c patchelf_0.8-2_amd64.deb" | sha256sum -c -wget http://old-releases.ubuntu.com/ubuntu/pool/universe/p/patchelf/patchelf_0.8-2_amd64.deb -echo "b3b69f346afb16ab9e925b91afc4c77179a70b676c2eb58a2821f8664fd4cae6 patchelf_0.8-2_amd64.deb" | sha256sum -c +if [ "$(uname -m)" = "aarch64" ]; then + wget http://old-releases.ubuntu.com/ubuntu/pool/universe/p/patchelf/patchelf_0.8-2_arm64.deb; + echo "3236b6aa89e891a9ab2da4f4574784b29ebd418b55d30a332ed8e2feff537d3c patchelf_0.8-2_arm64.deb" | sha256sum -c; + tool_arch="aarch64"; +else + wget http://old-releases.ubuntu.com/ubuntu/pool/universe/p/patchelf/patchelf_0.8-2_amd64.deb; + echo "b3b69f346afb16ab9e925b91afc4c77179a70b676c2eb58a2821f8664fd4cae6 patchelf_0.8-2_amd64.deb" | sha256sum -c; + tool_arch="x86_64"; +fi -sudo dpkg -i patchelf_0.8-2_amd64.deb +sudo dpkg -i patchelf_0.8-2_*.deb # We want a newer patchelf since the one above is missing e.g., '--add-needed' which our users might want to use # However, the newer patchelf versions are broken and cripple, e.g., libQt5Core; see https://github.com/NixOS/patchelf/issues/124 # git clone -o e1e39f3 https://github.com/NixOS/patchelf @@ -23,7 +29,7 @@ sudo dpkg -i patchelf_0.8-2_amd64.deb cd /tmp/ # wget -c https://artifacts.assassinate-you.net/artifactory/AppImageKit/travis-2052/appimagetool-x86_64.AppImage # branch last-good, https://travis-ci.org/AppImage/AppImageKit/jobs/507462541 # wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" # See #542 -wget -c "https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage" # Workaround for #542 +wget -c "https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-$tool_arch.AppImage" # Workaround for #542 chmod +x appimagetool*AppImage ./appimagetool*AppImage --appimage-extract sudo cp squashfs-root/usr/bin/* /usr/local/bin/ @@ -31,4 +37,4 @@ sudo cp -r squashfs-root/usr/lib/appimagekit /usr/local/lib/ sudo chmod +rx /usr/local/lib/appimagekit cd - -sudo apt-get -y install qt59base qt59declarative qt59webengine binutils xpra zsync desktop-file-utils gcc g++ make libgl1-mesa-dev fuse psmisc qt59translations +sudo apt-get -y install qt5-default qtbase5-dev qtdeclarative5-dev qtwebengine5-dev qttranslations5-l10n binutils xpra zsync desktop-file-utils gcc g++ make libgl1-mesa-dev fuse psmisc