Skip to content

Commit 8c884b6

Browse files
use arm wheel?
1 parent aa7333d commit 8c884b6

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

ci/input_files/build.yaml.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ lint python:
6767
image: registry.ddbuild.io/images/mirror/python:{{ $runtime.image }}
6868
cache: &{{ $runtime.name }}-{{ $runtime.arch }}-cache
6969
before_script:
70-
- PYTHON_VERSION={{ $runtime.python_version }} ./scripts/setup_python_env.sh
70+
- PYTHON_VERSION={{ $runtime.python_version }} ARCH={{ $runtime.arch }} ./scripts/setup_python_env.sh
7171
script:
7272
- source venv/bin/activate
7373
- ./scripts/check_format.sh
@@ -85,7 +85,7 @@ unit-test ({{ $runtime.name }}-{{ $runtime.arch }}):
8585
PYTHONFAULTHANDLER: "1"
8686
cache: &{{ $runtime.name }}-{{ $runtime.arch }}-cache
8787
before_script:
88-
- PYTHON_VERSION={{ $runtime.python_version }} ./scripts/setup_python_env.sh
88+
- PYTHON_VERSION={{ $runtime.python_version }} ARCH={{ $runtime.arch }} ./scripts/setup_python_env.sh
8989
script:
9090
- source venv/bin/activate
9191
- pytest -vv

scripts/_spec_ddtrace_dep.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,15 @@ spec_ddtrace_dep() {
7070
fi
7171
S3_BASE="https://dd-trace-py-builds.s3.amazonaws.com/${UPSTREAM_PIPELINE_ID}"
7272
PY_TAG="cp$(echo "$PYTHON_VERSION" | tr -d '.')"
73-
if [ "${ARCH:-amd64}" = "amd64" ]; then
73+
# Wheel platform tag must match the machine that runs pip (or CI matrix arch).
74+
# Default used to be amd64 when unset; prefer host arch so ARM runners/local dev work.
75+
if [ -z "${ARCH:-}" ]; then
76+
case "$(uname -m)" in
77+
aarch64 | arm64) ARCH=arm64 ;;
78+
*) ARCH=amd64 ;;
79+
esac
80+
fi
81+
if [ "$ARCH" = "amd64" ]; then
7482
PLATFORM="manylinux2014_x86_64"
7583
else
7684
PLATFORM="manylinux2014_aarch64"

scripts/setup_python_env.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
# Environment variables:
4040
# PYTHON_VERSION Python minor version (e.g. 3.12 or just 12). Required
4141
# when the UPSTREAM_PIPELINE_ID branch is taken.
42+
# ARCH "amd64" or "arm64". Required for correct ddtrace wheel
43+
# selection when UPSTREAM_PIPELINE_ID is set (GitLab matrix
44+
# should pass the runtime arch; if unset, host arch is used).
4245

4346
set -e
4447

0 commit comments

Comments
 (0)