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

Switch autobuild OS to ARM runner #3470

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
19 changes: 13 additions & 6 deletions .github/autobuild/linux_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ esac
setup() {
export DEBIAN_FRONTEND="noninteractive"

APT_ARCH="$(dpkg --print-architecture)"
export APT_ARCH

setup_cross_compilation_apt_sources

echo "Installing dependencies..."
Expand All @@ -61,18 +64,22 @@ setup() {
}

setup_cross_compilation_apt_sources() {
if [[ "${TARGET_ARCH}" == amd64 ]]; then
if [[ "${TARGET_ARCH}" == "${APT_ARCH}" ]]; then
return
fi
echo "Building on ${APT_ARCH} for ${TARGET_ARCH}. Thus modifying apt..."
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:
sudo sed -re 's/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list

if [[ "${APT_ARCH}" == "amd64" ]]; then
# 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:
sudo sed -re 's/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list
fi
}

setup_cross_compiler() {
if [[ "${TARGET_ARCH}" == amd64 ]]; then
if [[ "${TARGET_ARCH}" == "${APT_ARCH}" ]]; then
return
fi
local GCC_VERSION=9 # 9 is the default on 20.04, there is no reason not to update once 20.04 is out of support
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ jobs:

- config_name: Linux .deb armhf (artifacts)
target_os: linux
building_on_os: ubuntu-22.04
building_on_os: ubuntu-22.04-arm
building_container: ubuntu:20.04
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_on_os: ubuntu-22.04-arm
building_container: ubuntu:20.04
base_command: TARGET_ARCH=arm64 ./.github/autobuild/linux_deb.sh
run_codeql: false
Expand Down
Loading