Skip to content

fix: support building on Alpine Linux 3.17+ (musl) without libexecinfo-dev#204

Draft
M-Elsaeed wants to merge 5 commits into
aws:mainfrom
M-Elsaeed:fix/alpine-musl-execinfo-build
Draft

fix: support building on Alpine Linux 3.17+ (musl) without libexecinfo-dev#204
M-Elsaeed wants to merge 5 commits into
aws:mainfrom
M-Elsaeed:fix/alpine-musl-execinfo-build

Conversation

@M-Elsaeed

@M-Elsaeed M-Elsaeed commented Jun 9, 2026

Copy link
Copy Markdown

Summary

On Alpine Linux 3.17+, libexecinfo-dev was removed because musl libc does not support execinfo.h. This causes pip install awslambdaric to fail when building from source on Alpine (no musllinux wheels are published):

backward.h:238:22: fatal error: execinfo.h: No such file or directory

Fix

Make backward.cpp compilation conditional on execinfo.h availability in the bundled aws-lambda-cpp-0.2.6 CMakeLists.txt. When execinfo.h is absent, stack trace support is disabled but all Lambda RIC functionality works correctly.

include(CheckIncludeFileCXX)
check_include_file_cxx("execinfo.h" HAVE_EXECINFO_H)
if (HAVE_EXECINFO_H)
    target_sources(${PROJECT_NAME} PRIVATE "src/backward.cpp")
else()
    message("-- execinfo.h not found, stack traces disabled (musl/Alpine Linux)")
endif()

Testing

Verified with Docker on python:3.12-alpine3.20 (autoconf 2.72, no libexecinfo-dev):

  • ✅ Builds successfully
  • import awslambdaric works
  • ✅ No regression on glibc systems (execinfo.h found → backward.cpp compiled as before)

Context

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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 aws#128
Relates to aws#144
@M-Elsaeed M-Elsaeed marked this pull request as draft June 9, 2026 13:43
M-Elsaeed and others added 4 commits June 23, 2026 17:03
…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 aws#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 aws#128. Amazon Linux 2 is omitted as
it does not provide Python 3.14.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error : libexecinfo-dev package not found

1 participant