From 4807077e3cadb10016937007ed65e208af5c1782 Mon Sep 17 00:00:00 2001 From: Barret Rennie Date: Wed, 4 Oct 2023 15:47:02 -0400 Subject: [PATCH] Use linux2004 to build linux experimenter megazords --- .../transforms/server_megazord.py | 7 +++++-- taskcluster/ci/server-megazord-build/kind.yml | 10 ++++++++-- taskcluster/docker/linux2004/Dockerfile | 8 ++++++-- taskcluster/scripts/detect-target.sh | 2 +- taskcluster/scripts/server-megazord-build.py | 2 ++ 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/taskcluster/app_services_taskgraph/transforms/server_megazord.py b/taskcluster/app_services_taskgraph/transforms/server_megazord.py index 5029824f36..b03a504030 100644 --- a/taskcluster/app_services_taskgraph/transforms/server_megazord.py +++ b/taskcluster/app_services_taskgraph/transforms/server_megazord.py @@ -9,7 +9,7 @@ build = TransformSequence() LINUX_BUILD_TARGETS = ( - 'aarch64-unknown-linux-musl', + 'aarch64-unknown-linux-gnu', 'x86_64-unknown-linux-gnu', 'x86_64-unknown-linux-musl', 'x86_64-pc-windows-gnu', @@ -36,9 +36,12 @@ def setup_build_tasks(config, tasks): def setup_linux_build_task(task, target, binary): task['description'] = f'Build {binary} ({target})' task['worker-type'] = 'b-linux' + docker_image = 'linux' + if target in ('aarch64-unknown-linux-gnu', 'x86_64-unknown-linux-gnu'): + docker_image = 'linux2004' task['worker'] = { 'max-run-time': 1800, - 'docker-image': { 'in-tree': 'linux' }, + 'docker-image': { 'in-tree': docker_image }, 'artifacts': [ { 'name': f'public/build/{binary}-{target}.zip', diff --git a/taskcluster/ci/server-megazord-build/kind.yml b/taskcluster/ci/server-megazord-build/kind.yml index 55b5b26d77..f35edc36cd 100644 --- a/taskcluster/ci/server-megazord-build/kind.yml +++ b/taskcluster/ci/server-megazord-build/kind.yml @@ -23,10 +23,16 @@ task-defaults: - project:releng:services/tooltool/api/download/internal tasks: - nimbus-experimenter-linux-x86_64: + nimbus-experimenter-linux-x86_64-gnu: attributes: megazord: nimbus-experimenter - target: x86_64-unknown-linux-musl + target: x86_64-unknown-linux-gnu + + nimbus-experimenter-linux-aarch64-gnu: + attributes: + megazord: nimbus-experimenter + target: aarch64-unknown-linux-gnu + nimbus-experimenter-macos: attributes: diff --git a/taskcluster/docker/linux2004/Dockerfile b/taskcluster/docker/linux2004/Dockerfile index 27adde793f..6f556a3061 100644 --- a/taskcluster/docker/linux2004/Dockerfile +++ b/taskcluster/docker/linux2004/Dockerfile @@ -2,8 +2,9 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# This is intended to be a minimal Dockerfile only to build nimbus-fml and -# nimbus-cli with an older version of glibc. +# This is intended to be a minimal Dockerfile only to build nimbus-fml, +# nimbus-cli, and the nimbus-experimenter megazord with an older version of +# glibc. FROM ubuntu:20.04 @@ -58,10 +59,13 @@ RUN apt-get update -qq \ gcc-aarch64-linux-gnu \ libc6-dev-arm64-cross \ binutils-aarch64-linux-gnu \ + # Required to build nimbus-experimenter megazord + yapf \ && apt-get clean RUN pip3 install --upgrade pip RUN pip3 install \ + pytest \ pyyaml \ toml \ taskcluster diff --git a/taskcluster/scripts/detect-target.sh b/taskcluster/scripts/detect-target.sh index 006264bb7e..055b493c77 100755 --- a/taskcluster/scripts/detect-target.sh +++ b/taskcluster/scripts/detect-target.sh @@ -64,7 +64,7 @@ guess_target() { local DOUBLE="" case "$OS" in "darwin") DOUBLE="apple-darwin" ;; - "linux") DOUBLE="unknown-linux-musl" ;; + "linux") DOUBLE="unknown-linux-gnu" ;; "windows") DOUBLE="pc-windows-gnu" ;; esac TARGET="$ARCH-$DOUBLE" diff --git a/taskcluster/scripts/server-megazord-build.py b/taskcluster/scripts/server-megazord-build.py index 33dc0e2551..d94679651e 100755 --- a/taskcluster/scripts/server-megazord-build.py +++ b/taskcluster/scripts/server-megazord-build.py @@ -80,6 +80,8 @@ def _build_shared_library(megazord, target, dist_dir): if target == "i686-pc-windows-gnu": env["RUSTFLAGS"] = env.get("RUSTFLAGS", "") + " -C panic=abort" + elif target == 'aarch64-unknown-linux-gnu': + env["CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER"] = 'aarch64-linux-gnu-gcc' subprocess.check_call([ 'cargo', 'build', '--manifest-path', f'{SRC_ROOT}/megazords/{megazord}/Cargo.toml', '--release', '--target', target,