Skip to content

Commit 480ea4f

Browse files
Patched libcurl/configure.ac on alpine
This commit adds a patch for curl/configure.ac that replaces the inlined flags/conditionals with scoped ones. What's happening? 1. We have build failures in later versions of autoconf. 1. Why ? ./configure script for libcurl breaks during execution. 2. Why ? Control flow structures are not correctly closed which results in a parse error. 3. Why ? The structures in the m4 template in ./configure.ac for the 7.83.1 release of libcurl rely on inlined scripts. 4. Why [now]? The 2.72 update on autoconf changed the behaviour of the script generator. What do we do to ameliorate this? 1. Corrected the config script 2. Created a patch 3. Added the patch for alpine 4. Updated alpine to 3.20 which includes the autoconf change
1 parent a287869 commit 480ea4f

File tree

6 files changed

+160
-5
lines changed

6 files changed

+160
-5
lines changed

Diff for: .gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,8 @@ cython_debug/
148148

149149
# Test files generated
150150
tmp*.py
151+
152+
# dependencies
153+
deps/artifacts/
154+
deps/aws-lambda-cpp-*/
155+
deps/curl-*/

Diff for: Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ target:
77
init:
88
pip3 install -r requirements/base.txt -r requirements/dev.txt
99

10+
.PHONY: patch-libcurl-configure-template
11+
patch-libcurl-configure-template:
12+
sh ./scripts/patch_libcurl_config.sh
13+
1014
.PHONY: test
1115
test: check-format
1216
pytest --cov awslambdaric --cov-report term-missing --cov-fail-under 90 tests

Diff for: deps/patches/libcurl-configure-template.patch

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index d24daea..64aca7f 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -193,87 +193,96 @@ AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),
6+
7+
OPT_SECURETRANSPORT=no
8+
AC_ARG_WITH(secure-transport,dnl
9+
-AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),
10+
+AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),[
11+
OPT_SECURETRANSPORT=$withval
12+
test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
13+
-)
14+
+])
15+
16+
OPT_AMISSL=no
17+
AC_ARG_WITH(amissl,dnl
18+
-AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),
19+
+AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[
20+
OPT_AMISSL=$withval
21+
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL")
22+
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL"
23+
+])
24+
+
25+
26+
OPT_OPENSSL=no
27+
dnl Default to no CA bundle
28+
ca="no"
29+
AC_ARG_WITH(ssl,dnl
30+
AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
31+
-AS_HELP_STRING([--without-ssl], [build without any TLS library]),
32+
+AS_HELP_STRING([--without-ssl], [build without any TLS library]),[
33+
OPT_SSL=$withval
34+
OPT_OPENSSL=$withval
35+
if test X"$withval" != Xno; then
36+
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL")
37+
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
38+
fi
39+
+])
40+
41+
AC_ARG_WITH(openssl,dnl
42+
-AS_HELP_STRING([--with-openssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]),
43+
+AS_HELP_STRING([--with-openssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]),[
44+
OPT_OPENSSL=$withval
45+
if test X"$withval" != Xno; then
46+
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL")
47+
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
48+
fi
49+
+])
50+
51+
OPT_GNUTLS=no
52+
AC_ARG_WITH(gnutls,dnl
53+
-AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),
54+
+AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[
55+
OPT_GNUTLS=$withval
56+
if test X"$withval" != Xno; then
57+
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS")
58+
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS"
59+
fi
60+
+])
61+
62+
OPT_MBEDTLS=no
63+
AC_ARG_WITH(mbedtls,dnl
64+
-AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),
65+
+AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[
66+
OPT_MBEDTLS=$withval
67+
if test X"$withval" != Xno; then
68+
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS")
69+
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS"
70+
fi
71+
+])
72+
73+
OPT_WOLFSSL=no
74+
AC_ARG_WITH(wolfssl,dnl
75+
-AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),
76+
+AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),[
77+
OPT_WOLFSSL=$withval
78+
if test X"$withval" != Xno; then
79+
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL")
80+
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL"
81+
fi
82+
+])
83+
84+
OPT_BEARSSL=no
85+
AC_ARG_WITH(bearssl,dnl
86+
-AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),
87+
+AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),[
88+
OPT_BEARSSL=$withval
89+
if test X"$withval" != Xno; then
90+
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL")
91+
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL"
92+
fi
93+
+])
94+
95+
OPT_RUSTLS=no
96+
AC_ARG_WITH(rustls,dnl
97+
-AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),
98+
+AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),[
99+
OPT_RUSTLS=$withval
100+
if test X"$withval" != Xno; then
101+
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls")
102+
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls"
103+
fi
104+
+])
105+
106+
OPT_NSS_AWARE=no
107+
AC_ARG_WITH(nss-deprecated,dnl
108+
-AS_HELP_STRING([--with-nss-deprecated],[confirm you realize NSS is going away]),
109+
+AS_HELP_STRING([--with-nss-deprecated],[confirm you realize NSS is going away]),[
110+
if test X"$withval" != Xno; then
111+
OPT_NSS_AWARE=$withval
112+
fi
113+
-)
114+
+])
115+
116+
OPT_NSS=no
117+
AC_ARG_WITH(nss,dnl
118+
-AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]),
119+
+AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]),[
120+
OPT_NSS=$withval
121+
if test X"$withval" != Xno; then
122+
123+
@@ -283,7 +292,7 @@ AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the inst
124+
125+
test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }NSS"
126+
fi
127+
-)
128+
+])
129+
130+
dnl If no TLS choice has been made, check if it was explicitly disabled or
131+
dnl error out to force the user to decide.

Diff for: scripts/patch_libcurl_config.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
4+
set -x
5+
6+
(
7+
cd deps
8+
. versions
9+
LIBCURL="curl-${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION}"
10+
tar -xf "curl-${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION}.tar.gz" --no-same-owner && \
11+
cd $LIBCURL && \
12+
patch -p1 < ../patches/libcurl-configure-template.patch && \
13+
cd - && \
14+
tar -czvf "curl-${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION}.tar.gz" $LIBCURL --no-same-owner
15+
)

Diff for: tests/integration/codebuild/buildspec.os.alpine.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ batch:
1515
env:
1616
variables:
1717
DISTRO_VERSION:
18-
- "3.17"
19-
- "3.18"
2018
- "3.19"
19+
- "3.20"
2120
RUNTIME_VERSION:
2221
- "3.9"
2322
- "3.10"

Diff for: tests/integration/docker/Dockerfile.echo.alpine

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@ RUN apk add --no-cache \
2222
elfutils-dev \
2323
make \
2424
cmake \
25-
libcurl
26-
25+
libcurl\
26+
git
2727
# Include global args in this stage of the build
2828
ARG RIC_BUILD_DIR="/home/build/"
2929
# Create function directory
3030
RUN mkdir -p ${RIC_BUILD_DIR}
3131
# Copy function code and Runtime Interface Client .tgz
3232
WORKDIR ${RIC_BUILD_DIR}
3333
COPY . .
34-
RUN make init build test && \
34+
RUN make init patch-libcurl-configure-template && \
35+
make build test && \
3536
mv ./dist/awslambdaric-*.tar.gz ./dist/awslambdaric-test.tar.gz
3637

3738
# Include global args in this stage of the build

0 commit comments

Comments
 (0)