Skip to content

Commit df849c8

Browse files
author
Mohammed Ehab
committed
ci: add pip-install-from-source job to guard Alpine/musl build
Adds a job that runs the documented end-user 'pip install .' flow (BUILD unset, so the native aws-lambda-cpp extension is actually compiled) and asserts the runtime_client extension imports. Covers the full Alpine range that dropped libexecinfo-dev (3.17-3.21) - the integration-test matrix only starts at 3.19 - plus a glibc Debian check to ensure stack-trace support still compiles where execinfo.h exists. Directly guards against regressions of issue #128.
1 parent 7b499ae commit df849c8

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

.github/workflows/test-on-push-and-pr.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,77 @@ jobs:
245245
TEST_NAME="ric-integ-test"
246246
docker rm -f "${TEST_NAME}-app" "${TEST_NAME}-tester" 2>/dev/null || true
247247
docker network rm "${TEST_NAME}-net" 2>/dev/null || true
248+
249+
# Verifies the documented end-user `pip install` source build works, including
250+
# the native aws-lambda-cpp compile triggered by scripts/preinstall.sh (i.e. a
251+
# real install where BUILD is NOT set, so the C++ extension is actually built).
252+
#
253+
# This specifically guards the Alpine/musl regression in issue #128: Alpine 3.17
254+
# removed the libexecinfo-dev package (no execinfo.h on musl), which broke the
255+
# backward.cpp compile. These jobs intentionally do NOT install libexecinfo-dev
256+
# and cover the full affected Alpine range (3.17+), which the integration-test
257+
# matrix above does not (it starts at 3.19).
258+
pip-install-from-source:
259+
runs-on: ubuntu-latest
260+
strategy:
261+
fail-fast: false
262+
matrix:
263+
include:
264+
# Alpine (musl) - full range that dropped libexecinfo-dev (3.17+)
265+
- distro: alpine
266+
distro_version: "3.17"
267+
runtime_version: "3.11"
268+
- distro: alpine
269+
distro_version: "3.18"
270+
runtime_version: "3.11"
271+
- distro: alpine
272+
distro_version: "3.19"
273+
runtime_version: "3.12"
274+
- distro: alpine
275+
distro_version: "3.20"
276+
runtime_version: "3.13"
277+
- distro: alpine
278+
distro_version: "3.21"
279+
runtime_version: "3.13"
280+
# Debian (glibc) - ensure execinfo.h is still detected and stack
281+
# traces remain compiled in (no regression on glibc systems).
282+
- distro: debian
283+
distro_version: bookworm
284+
runtime_version: "3.12"
285+
286+
name: "pip install / ${{ matrix.distro }} ${{ matrix.distro_version }} / python ${{ matrix.runtime_version }}"
287+
288+
steps:
289+
- uses: actions/checkout@v4
290+
291+
- name: pip install from source and import native extension
292+
run: |
293+
set -euo pipefail
294+
295+
if [ "${{ matrix.distro }}" = "alpine" ]; then
296+
IMAGE="public.ecr.aws/docker/library/python:${{ matrix.runtime_version }}-alpine${{ matrix.distro_version }}"
297+
# Build deps per README/Dockerfile.echo.alpine. Note: libexecinfo-dev
298+
# is deliberately omitted - the fix must build without it.
299+
INSTALL_DEPS="apk add --no-cache build-base libtool autoconf automake elfutils-dev make cmake libcurl"
300+
else
301+
IMAGE="public.ecr.aws/docker/library/python:${{ matrix.runtime_version }}-${{ matrix.distro_version }}"
302+
INSTALL_DEPS="apt-get update && apt-get install -y --no-install-recommends g++ make cmake libcurl4-openssl-dev"
303+
fi
304+
305+
echo "Testing 'pip install .' on ${IMAGE}"
306+
307+
# Mount the checkout read-only and build from a writable copy so the
308+
# host workspace is not polluted with build artifacts.
309+
docker run --rm \
310+
-v "$PWD":/src:ro \
311+
"$IMAGE" \
312+
sh -euc "
313+
$INSTALL_DEPS
314+
cp -r /src /build
315+
cd /build
316+
python -m pip install --no-cache-dir .
317+
# The native extension only imports if the C++ build (including the
318+
# backward.cpp / execinfo.h path) compiled and linked successfully.
319+
python -c 'import runtime_client; print(\"native runtime_client extension: OK\")'
320+
python -c 'import awslambdaric; print(\"awslambdaric\", awslambdaric.__version__, \"import: OK\")'
321+
"

0 commit comments

Comments
 (0)