Skip to content

pip install awslambdaric breaks on alpine linux with autoconf=2.72-r0 #144

Closed
@heerener

Description

@heerener

I'm installing awslambdaric in the python:3.9-alpine container:

FROM python:3.9-alpine

RUN apk add autoconf automake bash binutils cmake g++ gcc libtool make nodejs

# it has to be 3.16, too, after that it was removed :'(
RUN apk add --no-cache --update --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main/ libexecinfo-dev

RUN python3 -m pip install awslambdaric

This fails since they updated autoconf to 2.72-r0:

Collecting awslambdaric
  Downloading awslambdaric-2.0.11.tar.gz (4.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 55.2 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [66 lines of output]
      *** Do not use buildconf. Instead, just use: autoreconf -fi
      libtoolize: putting auxiliary files in '.'.
      libtoolize: copying file './ltmain.sh'
      libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
      libtoolize: copying file 'm4/libtool.m4'
      libtoolize: copying file 'm4/ltoptions.m4'
      libtoolize: copying file 'm4/ltsugar.m4'
      libtoolize: copying file 'm4/ltversion.m4'
      libtoolize: copying file 'm4/lt~obsolete.m4'
      libtoolize: Remember to add 'LT_INIT' to configure.ac.
      configure.ac:120: installing './compile'
      configure.ac:125: installing './missing'
      docs/examples/Makefile.am: installing './depcomp'
      checking whether to enable maintainer-specific portions of Makefiles... no
      checking whether make supports nested variables... yes
      checking whether to enable debug build options... no
      checking whether to enable compiler optimizer... (assumed) yes
      checking whether to enable strict compiler warnings... no
      checking whether to enable compiler warnings as errors... no
      checking whether to enable curl debug memory tracking... no
      checking whether to enable hiding of library internal symbols... yes
      checking whether to enable c-ares for DNS lookups... no
      checking whether to disable dependency on -lrt... (assumed no)
      checking whether to enable ECH support... no
      checking for path separator... :
      checking for sed... /bin/sed
      checking for grep... /bin/grep
      checking for egrep... /bin/grep -E
      checking for ar... /usr/bin/ar
      checking for a BSD-compatible install... /usr/bin/install -c
      checking for gcc... gcc
      checking whether the C compiler works... yes
      checking for C compiler default output file name... a.out
      checking for suffix of executables...
      checking whether we are cross compiling... no
      checking for suffix of object files... o
      checking whether the compiler supports GNU C... yes
      checking whether gcc accepts -g... yes
      checking for gcc option to enable C11 features... none needed
      checking whether gcc understands -c and -o together... yes
      checking how to run the C preprocessor... gcc -E
      checking for a sed that does not truncate output... (cached) /bin/sed
      checking for code coverage support... no
      checking whether build environment is sane... yes
      checking for a race-free mkdir -p... /bin/mkdir -p
      checking for gawk... no
      checking for mawk... no
      checking for nawk... no
      checking for awk... awk
      checking whether make sets $(MAKE)... yes
      checking whether make supports the include directive... yes (GNU style)
      checking dependency style of gcc... gcc3
      checking curl version... 7.83.1
      ./configure: line 6673: syntax error: unexpected ";;" (expecting "fi")
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-nre869p4/awslambdaric_a25006ec5ec64e83b66a94f0ce40e6c9/setup.py", line 98, in <module>
          ext_modules=get_runtime_client_extension(),
        File "/tmp/pip-install-nre869p4/awslambdaric_a25006ec5ec64e83b66a94f0ce40e6c9/setup.py", line 46, in get_runtime_client_extension
          extra_link_args=get_curl_extra_linker_flags(),
        File "/tmp/pip-install-nre869p4/awslambdaric_a25006ec5ec64e83b66a94f0ce40e6c9/setup.py", line 19, in get_curl_extra_linker_flags
          check_call(["./scripts/preinstall.sh"])
        File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['./scripts/preinstall.sh']' returned non-zero exit status 2.
      [end of output]

As a workaround, I can go back to autoconf=2.71-r2 but ideally this would be fixed:

FROM python:3.9-alpine

# to go back to autoconf=2.71-r2; the upgrade to 2.72-r0 breaks the awslambdaric install
RUN echo https://dl-cdn.alpinelinux.org/alpine/v3.19/main >> /etc/apk/repositories
RUN echo https://dl-cdn.alpinelinux.org/alpine/v3.19/community >> /etc/apk/repositories

RUN apk add autoconf=2.71-r2 automake bash binutils cmake g++ gcc libtool make nodejs

# it has to be 3.16, too, after that it was removed :'(
RUN apk add --no-cache --update --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main/ libexecinfo-dev

RUN python3 -m pip install awslambdaric

Activity

PartiallyUntyped

PartiallyUntyped commented on Jul 16, 2024

@PartiallyUntyped
Contributor

Hi, we are aware of the issue.

This is caused by the dependency on libcurl and the update on autoconf. We use libcurl to ensure consistent performance and minimize overhead. The update on autoconf included a change that broke some macros defined in the libcurl version used by the runtime interface client.

Our current recommendation is to pin the autoconf version with the provided work-around.

Thanks,
Quinn

unacceptable

unacceptable commented on Aug 20, 2024

@unacceptable

I just tested the branch associated with the PR via

pip install https://github.com/aws/aws-lambda-python-runtime-interface-client/archive/refs/heads/python-ric-144.zip

I still ended up with the configure syntax error:

... TRUNCATED
      checking curl version... 7.83.1
      ./configure: line 6673: syntax error: unexpected ";;" (expecting "fi")
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-30oz2fln/setup.py", line 98, in <module>
          ext_modules=get_runtime_client_extension(),
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-req-build-30oz2fln/setup.py", line 46, in get_runtime_client_extension
          extra_link_args=get_curl_extra_linker_flags(),
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-req-build-30oz2fln/setup.py", line 19, in get_curl_extra_linker_flags
          check_call(["./scripts/preinstall.sh"])
        File "/usr/local/lib/python3.12/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['./scripts/preinstall.sh']' returned non-zero exit status 2.
      [end of output]
... TRUNCATED
PartiallyUntyped

PartiallyUntyped commented on Aug 20, 2024

@PartiallyUntyped
Contributor

Hi, it is expected that that PR right now, will not fix generic builds and builds from pip. The PR, at the moment, only intends to show the fix could work on the docker images that build the package.

The PR will be updated to apply the patch to the build process which will fix installations through pip directly.

Thanks!

PartiallyUntyped

PartiallyUntyped commented on Aug 22, 2024

@PartiallyUntyped
Contributor

@unacceptable Could you try once more with the latest commit?

Syed-Mujeeb

Syed-Mujeeb commented on May 29, 2025

@Syed-Mujeeb

Hi @heerener @PartiallyUntyped

Is it resolved? Because still am not able to use alphine + awslambdaric to run my python function in AWS lambda
Please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @unacceptable@PartiallyUntyped@Syed-Mujeeb@heerener

      Issue actions

        pip install awslambdaric breaks on alpine linux with autoconf=2.72-r0 · Issue #144 · aws/aws-lambda-python-runtime-interface-client