Skip to content

Commit

Permalink
Use linux2004 to build linux experimenter megazords
Browse files Browse the repository at this point in the history
  • Loading branch information
Barret Rennie committed Oct 4, 2023
1 parent 399fe73 commit 4807077
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
10 changes: 8 additions & 2 deletions taskcluster/ci/server-megazord-build/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions taskcluster/docker/linux2004/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/scripts/detect-target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions taskcluster/scripts/server-megazord-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4807077

Please sign in to comment.