aws / aws-lambda-python-runtime-interface-client

Apache License 2.0
255 stars 72 forks source link

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

Open heerener opened 1 month ago

heerener commented 1 month ago

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
m-rph commented 22 hours ago

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