Skip to content
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

[draft] add ARM64 support to Linux CI #12411

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 32 additions & 25 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- 'Stable*'
tags:
- 'v*'
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/linux.yml'
Expand All @@ -20,20 +21,29 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ${{ matrix.runs-on }}

strategy:
matrix:
BuildType: [Debug, Release]
# Arch: [x64] # Arm64
runs-on: [ubuntu-24.04-arm, ubuntu-22.04]
include:
- runs-on: ubuntu-24.04-arm
ARTIFACT: QGroundControl-aarch64.AppImage
PACKAGE: QGroundControl-aarch64
host: linux_arm64
arch: linux_gcc_arm64
- runs-on: ubuntu-22.04
ARTIFACT: QGroundControl-x86_64.AppImage
PACKAGE: QGroundControl-x86_64
host: linux
arch: linux_gcc_64

defaults:
run:
shell: bash

env:
ARTIFACT: QGroundControl-x86_64.AppImage
PACKAGE: QGroundControl-x86_64
QT_VERSION: 6.8.1
GST_VERSION: 1.22.12
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
Expand All @@ -55,33 +65,30 @@ jobs:

- name: Install Vulkan
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt update
sudo apt install vulkan-sdk

- name: Install Compiler
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
sudo update-alternatives --set gcc /usr/bin/gcc-11
sudo apt install -y --quiet libvulkan-dev
if apt-cache show vulkan-validationlayers-dev >/dev/null 2>&1 && apt-cache show vulkan-validationlayers-dev 2>/dev/null | grep -q "^Package: vulkan-validationlayers-dev"; then
sudo apt-get install -y --quiet vulkan-validationlayers-dev
fi
if apt-cache show vulkan-utility-libraries-dev >/dev/null 2>&1 && apt-cache show vulkan-utility-libraries-dev 2>/dev/null | grep -q "^Package: apt-cache show vulkan-utility-libraries-dev"; then
sudo apt-get install -y --quiet vulkan-utility-libraries-dev
fi

- name: Setup Caching
if: ${{ matrix.arch=='linux_gcc_64' }}
uses: ./.github/actions/cache
with:
host: linux
target: linux_gcc_64
host: ${{ matrix.host }}
target: desktop
build-type: ${{ matrix.BuildType }}
cpm-modules: ${{ env.CPM_SOURCE_CACHE }}

- name: Install Qt for Linux (x64)
uses: jurplel/install-qt-action@v4
- name: Install Qt for Linux
uses: jdpurcell/install-qt-action@b45c67aaa9e0ea77e59a7031ec14a12d5ddf4b35
with:
version: ${{ env.QT_VERSION }}
host: linux
host: ${{ matrix.host }}
target: desktop
arch: linux_gcc_64
arch: ${{ matrix.arch }}
dir: ${{ runner.temp }}
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors

Expand All @@ -106,19 +113,19 @@ jobs:
- name: Sanity check release excecutable
if: matrix.BuildType == 'Release'
working-directory: ${{ runner.temp }}/shadow_build_dir
run: xvfb-run -a ./${{ env.ARTIFACT }} --simple-boot-test
run: xvfb-run -a ./${{ matrix.ARTIFACT }} --simple-boot-test

- name: Run unit tests
if: matrix.BuildType == 'Debug'
working-directory: ${{ runner.temp }}/shadow_build_dir
run: xvfb-run -a ./${{ env.ARTIFACT }} --unittest
run: xvfb-run -a ./${{ matrix.ARTIFACT }} --unittest

- name: Upload Build File
if: matrix.BuildType == 'Release'
uses: ./.github/actions/upload
with:
artifact_name: ${{ env.ARTIFACT }}
package_name: ${{ env.PACKAGE }}
artifact_name: ${{ matrix.ARTIFACT }}
package_name: ${{ matrix.PACKAGE }}
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,10 @@ elseif(LINUX)
FILES ${CMAKE_SOURCE_DIR}/deploy/linux/AppRun
DESTINATION ${CMAKE_BINARY_DIR}
)
install(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/CreateAppImage.cmake")
install(CODE "
set(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")
include(\"${CMAKE_SOURCE_DIR}/cmake/CreateAppImage.cmake\")
")
elseif(WIN32)
install(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/CreateWinInstaller.cmake")
elseif(MACOS)
Expand Down
30 changes: 19 additions & 11 deletions cmake/CreateAppImage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,31 @@ message(STATUS "Creating AppImage")
# TODO: https://github.com/AppImageCommunity/AppImageUpdate

set(APPDIR_PATH "${CMAKE_BINARY_DIR}/AppDir")
set(APPIMAGETOOL_PATH "${CMAKE_BINARY_DIR}/appimagetool-x86_64.AppImage")
set(LD_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-x86_64.AppImage")
# set(LD_APPIMAGEPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-appimage-x86_64.AppImage")
# set(LD_QTPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-qt-x86_64.AppImage")
set(APPIMAGETOOL_PATH "${CMAKE_BINARY_DIR}/appimagetool-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
set(LD_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
# set(LD_APPIMAGEPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-appimage-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
# set(LD_QTPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-qt-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
# set(LD_GSTPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-gstreamer.sh")
# set(LD_GTKPLUGIN_PATH "${CMAKE_BINARY_DIR}/linuxdeploy-plugin-gtk.sh")
set(FETCHCONTENT_QUIET FALSE)

if(NOT EXISTS "${APPIMAGETOOL_PATH}")
file(DOWNLOAD https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage "${APPIMAGETOOL_PATH}")
message(STATUS "Downloading appimagetool")
file(DOWNLOAD https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${CMAKE_SYSTEM_PROCESSOR}.AppImage "${APPIMAGETOOL_PATH}")
# file(DOWNLOAD https://github.com/probonopd/go-appimage/releases/download/832/appimagetool-823-x86_64.AppImage "${APPIMAGETOOL_PATH}") # TODO: Use Continuous Release
execute_process(COMMAND chmod a+x "${APPIMAGETOOL_PATH}")
endif()
if(NOT EXISTS "${LD_PATH}")
file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage "${LD_PATH}")
message(STATUS "Downloading linuxdeploy")
file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${CMAKE_SYSTEM_PROCESSOR}.AppImage "${LD_PATH}")
execute_process(COMMAND chmod a+x "${LD_PATH}")
endif()
# if(NOT EXISTS "${LD_APPIMAGEPLUGIN_PATH}")
# file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage "${LD_APPIMAGEPLUGIN_PATH}")
# file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-${CMAKE_SYSTEM_PROCESSOR}.AppImage "${LD_APPIMAGEPLUGIN_PATH}")
# execute_process(COMMAND chmod a+x "${LD_APPIMAGEPLUGIN_PATH}")
# endif()
# if(NOT EXISTS "${LD_QTPLUGIN_PATH}")
# file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage "${LD_QTPLUGIN_PATH}")
# file(DOWNLOAD https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${CMAKE_SYSTEM_PROCESSOR}.AppImage "${LD_QTPLUGIN_PATH}")
# execute_process(COMMAND chmod a+x "${LD_QTPLUGIN_PATH}")
# endif()
# if(NOT EXISTS "${LD_GTKPLUGIN_PATH}")
Expand All @@ -35,14 +38,19 @@ endif()
# execute_process(COMMAND chmod a+x "${LD_GSTPLUGIN_PATH}")
# endif()

message(STATUS "Executing linuxdeploy")
execute_process(COMMAND ${LD_PATH}
--appdir ${APPDIR_PATH}
--executable ${APPDIR_PATH}/usr/bin/QGroundControl
--desktop-file ${APPDIR_PATH}/usr/share/applications/org.mavlink.qgroundcontrol.desktop
--custom-apprun ${CMAKE_BINARY_DIR}/AppRun)
--custom-apprun ${CMAKE_BINARY_DIR}/AppRun
COMMAND_ERROR_IS_FATAL ANY)
# --exclude-library "libgst*"
# --plugin qt --plugin gtk --plugin gstreamer

set(ENV{ARCH} x86_64)
set(ENV{ARCH} ${CMAKE_SYSTEM_PROCESSOR})
# set(ENV{VERSION} 5.0)
execute_process(COMMAND ${APPIMAGETOOL_PATH} ${APPDIR_PATH})

message(STATUS "Executing appimagetool")
execute_process(COMMAND ${APPIMAGETOOL_PATH} ${APPDIR_PATH}
COMMAND_ERROR_IS_FATAL ANY)
4 changes: 2 additions & 2 deletions cmake/find-modules/FindGStreamer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ elseif(MACOS)
set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/pkgconfig:${GSTREAMER_PREFIX}/lib/gstreamer-1.0/pkgconfig:$ENV{PKG_CONFIG_PATH}")
elseif(LINUX)
set(GSTREAMER_PREFIX "/usr")
set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu/pkgconfig:${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu/gstreamer-1.0/pkgconfig:$ENV{PKG_CONFIG_PATH}")
set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/pkgconfig:${GSTREAMER_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/gstreamer-1.0/pkgconfig:$ENV{PKG_CONFIG_PATH}")
elseif(IOS)
list(APPEND CMAKE_FRAMEWORK_PATH "~/Library/Developer/GStreamer/iPhone.sdk")
if(DEFINED ENV{GSTREAMER_PREFIX_IOS} AND EXISTS $ENV{GSTREAMER_PREFIX_IOS})
Expand Down Expand Up @@ -102,7 +102,7 @@ cmake_print_variables(GSTREAMER_PREFIX)

# TODO: find_path, Change x86_64-linux-gnu based on host
if(LINUX)
set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib/x86_64-linux-gnu)
set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu)
elseif(MACOS OR ANDROID OR WIN32)
set(GSTREAMER_LIB_PATH ${GSTREAMER_PREFIX}/lib)
elseif(IOS)
Expand Down
5 changes: 4 additions & 1 deletion tools/setup/install-dependencies-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \
flex \
gobject-introspection \
gvfs \
intel-media-va-driver \
libasound2-dev \
libass-dev \
libdrm-dev \
Expand Down Expand Up @@ -190,6 +189,10 @@ DEBIAN_FRONTEND=noninteractive apt-get -y --quiet install \
vainfo \
wayland-protocols

if apt-cache show intel-media-va-driver >/dev/null 2>&1 && apt-cache show intel-media-va-driver 2>/dev/null | grep -q "^Package: intel-media-va-driver"; then
DEBIAN_FRONTEND=noninteractive apt-get install -y --quiet intel-media-va-driver
fi

if apt-cache show libdav1d-dev >/dev/null 2>&1 && apt-cache show libdav1d-dev 2>/dev/null | grep -q "^Package: libdav1d-dev"; then
DEBIAN_FRONTEND=noninteractive apt-get install -y --quiet libdav1d-dev
fi
Expand Down
Loading