fix: support building on Alpine Linux 3.17+ (musl) without libexecinfo-dev#204
Merged
Merged
Conversation
On musl-based systems (Alpine Linux 3.17+), execinfo.h is not available as the libexecinfo package was removed. This causes a build failure in the bundled aws-lambda-cpp when backward.cpp is compiled. This change makes backward.cpp compilation conditional on execinfo.h availability via CMake's check_include_file_cxx. When absent, stack trace support is disabled but all RIC functionality works correctly. Fixes #128 Relates to #144
…ball The tarball was repacked on macOS, adding 69 ._* resource-fork files. This strips them; the only real-content change remains the CMakeLists.txt execinfo.h guard. Real file contents are byte-identical to the prior commit.
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.
Per review feedback, collapse the per-Alpine-version matrix into a single representative row per OS family, pinned to the newest Python (3.14): alpine 3.21, debian bookworm, ubuntu 24.04, amazonlinux2023. Reuses the per-OS Dockerfiles + RIE invoke. The Alpine (musl) row still guards the libexecinfo/execinfo.h regression from #128. Amazon Linux 2 is omitted as it does not provide Python 3.14.
Two changes so the suite is non-redundant and matches customer behavior: 1. Remove elfutils-dev from Dockerfile.echo.alpine. With libdw present, backward-cpp uses the DWARF backend and never includes execinfo.h, which masked the musl/Alpine build failure (#128) - the CI built clean even on Alpine 3.17+ while real customers (minimal documented deps, no elfutils-dev) failed. Without it the integration test now exercises the execinfo.h path and genuinely guards the fix. Verified: pre-fix code now fails the Alpine build with 'execinfo.h: No such file', fixed code builds and invokes. 2. Remove the pip-install-from-source job: it reused the same per-OS Dockerfiles + RIE invoke as integration-test, so it duplicated coverage. With change (1), integration-test already covers the customer install path across all supported OS/Python combinations.
The README listed Alpine as supported but only documented Debian/Ubuntu build dependencies. Add an Alpine section: since no musllinux wheels are published, the client always builds from source on Alpine, and the minimal images need the full toolchain via apk. Notes that libexecinfo-dev is no longer required (removed in Alpine 3.17+), reflecting the execinfo.h fix. Verified the documented apk set builds and imports cleanly on python:3.13-alpine3.20.
This reverts commit 87feac8.
benrkia
approved these changes
Jun 24, 2026
M-Elsaeed
added a commit
to M-Elsaeed/aws-lambda-python-runtime-interface-client
that referenced
this pull request
Jun 25, 2026
Bump version to 4.0.1 and update changelog for the Alpine Linux 3.17+ (musl) build fix (aws#204).
M-Elsaeed
added a commit
to M-Elsaeed/aws-lambda-python-runtime-interface-client
that referenced
this pull request
Jun 25, 2026
Bump version to 4.0.1 and update changelog for the Alpine Linux 3.17+ (musl) build fix (aws#204).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Alpine Linux 3.17+,
libexecinfo-devwas removed because musl libc does not supportexecinfo.h. This causespip install awslambdaricto fail when building from source on Alpine (nomusllinuxwheels are published):Fix
Make
backward.cppcompilation conditional onexecinfo.havailability in the bundledaws-lambda-cpp-0.2.6CMakeLists.txt. Whenexecinfo.his absent, stack trace support is disabled but all Lambda RIC functionality works correctly.Testing
Verified with Docker on
python:3.12-alpine3.20(autoconf 2.72, nolibexecinfo-dev):import awslambdaricworksContext
libexecinfo-devin v3.17 (Nov 2022)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.