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

Autobuild: Add Linux .deb aarch64 (Raspberry) 64bit builds #2895

Merged
merged 3 commits into from
Oct 7, 2022
Merged
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
3 changes: 3 additions & 0 deletions .github/autobuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ The scripts in this folder are used by the Github autobuild actions in .github/w
They are responsible for setting up the Github environment, building the binaries and passing the resulting artifacts back to the workflow.

The scripts may work outside of Github, but haven't been designed or tested for that use case.
Some of the scripts modify global system settings, install software or create files in directories which are usually managed by package managers.
In short: They should probably only used in throw-away environments.

See the various platform-specific build scripts in their own folders for standalone builds (e.g. windows/deploy_windows.ps1).
11 changes: 8 additions & 3 deletions .github/autobuild/linux_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ case "${TARGET_ARCH}" in
armhf)
ABI_NAME="arm-linux-gnueabihf"
;;
arm64)
ABI_NAME="aarch64-linux-gnu"
;;
*)
echo "Unsupported TARGET_ARCH ${TARGET_ARCH}"
exit 1
Expand All @@ -37,7 +40,9 @@ setup_cross_compilation_apt_sources() {
return
fi
sudo dpkg --add-architecture "${TARGET_ARCH}"
# Duplicate the original Ubuntu sources and modify them to refer to the TARGET_ARCH:
sed -rne "s|^deb.*/ ([^ -]+(-updates)?) main.*|deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports \1 main universe multiverse restricted|p" /etc/apt/sources.list | sudo dd of=/etc/apt/sources.list.d/"${TARGET_ARCH}".list
# Now take the original Ubuntu sources and limit those to the build host (i.e. non-TARGET_ARCH) architectures:
pljones marked this conversation as resolved.
Show resolved Hide resolved
sudo sed -re 's/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list
}

Expand All @@ -50,10 +55,10 @@ setup_cross_compiler() {
sudo update-alternatives --install "/usr/bin/${ABI_NAME}-g++" g++ "/usr/bin/${ABI_NAME}-g++-${GCC_VERSION}" 10
pljones marked this conversation as resolved.
Show resolved Hide resolved
sudo update-alternatives --install "/usr/bin/${ABI_NAME}-gcc" gcc "/usr/bin/${ABI_NAME}-gcc-${GCC_VERSION}" 10

if [[ "${TARGET_ARCH}" == armhf ]]; then
# Ubuntu's Qt version only ships a profile for gnueabi, but not for gnueabihf. Therefore, build a custom one:
# Ubuntu's Qt version only ships a profile for gnueabi, but not for gnueabihf or aarch64. Therefore, build a custom one:
if [[ $ABI_NAME ]]; then
sudo cp -R "/usr/lib/${ABI_NAME}/qt5/mkspecs/linux-arm-gnueabi-g++/" "/usr/lib/${ABI_NAME}/qt5/mkspecs/${ABI_NAME}-g++/"
sudo sed -re 's/-gnueabi/-gnueabihf/' -i "/usr/lib/${ABI_NAME}/qt5/mkspecs/${ABI_NAME}-g++/qmake.conf"
sudo sed -re "s/arm-linux-gnueabi/${ABI_NAME}/" -i "/usr/lib/${ABI_NAME}/qt5/mkspecs/${ABI_NAME}-g++/qmake.conf"
fi
}

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ jobs:
base_command: TARGET_ARCH=armhf ./.github/autobuild/linux_deb.sh
run_codeql: false

- config_name: Linux .deb arm64 (artifacts)
target_os: linux
building_on_os: ubuntu-22.04
building_container: ubuntu:18.04
base_command: TARGET_ARCH=arm64 ./.github/autobuild/linux_deb.sh
run_codeql: false

- config_name: MacOS (artifacts)
target_os: macos
building_on_os: macos-12
Expand Down