Skip to content

Patch libcurl configure.ac to work with later versions of autoconf #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,8 @@ cython_debug/

# Test files generated
tmp*.py

# dependencies
deps/artifacts/
deps/aws-lambda-cpp-*/
deps/curl-*/
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ target:
init:
pip3 install -r requirements/base.txt -r requirements/dev.txt

.PHONY: patch-libcurl-configure-template
patch-libcurl-configure-template:
sh ./scripts/patch_libcurl_config.sh

.PHONY: test
test: check-format
pytest --cov awslambdaric --cov-report term-missing --cov-fail-under 90 tests
Expand Down
131 changes: 131 additions & 0 deletions deps/patches/libcurl-configure-template.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
diff --git a/configure.ac b/configure.ac
index d24daea..64aca7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -193,87 +193,96 @@ AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),

OPT_SECURETRANSPORT=no
AC_ARG_WITH(secure-transport,dnl
-AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),
+AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),[
OPT_SECURETRANSPORT=$withval
test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
-)
+])

OPT_AMISSL=no
AC_ARG_WITH(amissl,dnl
-AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),
+AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[
OPT_AMISSL=$withval
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL")
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL"
+])
+

OPT_OPENSSL=no
dnl Default to no CA bundle
ca="no"
AC_ARG_WITH(ssl,dnl
AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
-AS_HELP_STRING([--without-ssl], [build without any TLS library]),
+AS_HELP_STRING([--without-ssl], [build without any TLS library]),[
OPT_SSL=$withval
OPT_OPENSSL=$withval
if test X"$withval" != Xno; then
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL")
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
fi
+])

AC_ARG_WITH(openssl,dnl
-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]),
+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]),[
OPT_OPENSSL=$withval
if test X"$withval" != Xno; then
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL")
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
fi
+])

OPT_GNUTLS=no
AC_ARG_WITH(gnutls,dnl
-AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),
+AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[
OPT_GNUTLS=$withval
if test X"$withval" != Xno; then
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS")
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS"
fi
+])

OPT_MBEDTLS=no
AC_ARG_WITH(mbedtls,dnl
-AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),
+AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[
OPT_MBEDTLS=$withval
if test X"$withval" != Xno; then
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS")
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS"
fi
+])

OPT_WOLFSSL=no
AC_ARG_WITH(wolfssl,dnl
-AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),
+AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),[
OPT_WOLFSSL=$withval
if test X"$withval" != Xno; then
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL")
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL"
fi
+])

OPT_BEARSSL=no
AC_ARG_WITH(bearssl,dnl
-AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),
+AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),[
OPT_BEARSSL=$withval
if test X"$withval" != Xno; then
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL")
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL"
fi
+])

OPT_RUSTLS=no
AC_ARG_WITH(rustls,dnl
-AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),
+AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),[
OPT_RUSTLS=$withval
if test X"$withval" != Xno; then
- test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls")
+ test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls"
fi
+])

OPT_NSS_AWARE=no
AC_ARG_WITH(nss-deprecated,dnl
-AS_HELP_STRING([--with-nss-deprecated],[confirm you realize NSS is going away]),
+AS_HELP_STRING([--with-nss-deprecated],[confirm you realize NSS is going away]),[
if test X"$withval" != Xno; then
OPT_NSS_AWARE=$withval
fi
-)
+])

OPT_NSS=no
AC_ARG_WITH(nss,dnl
-AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]),
+AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]),[
OPT_NSS=$withval
if test X"$withval" != Xno; then

@@ -283,7 +292,7 @@ AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the inst

test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }NSS"
fi
-)
+])

dnl If no TLS choice has been made, check if it was explicitly disabled or
dnl error out to force the user to decide.
15 changes: 15 additions & 0 deletions scripts/patch_libcurl_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.

set -x

(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: don't see a strong reason to use ()

cd deps
. versions
LIBCURL="curl-${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be used in the tar stmts.

tar -xf "curl-${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION}.tar.gz" --no-same-owner && \
cd $LIBCURL && \
patch -p1 < ../patches/libcurl-configure-template.patch && \
cd - && \
tar -czvf "curl-${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION}.tar.gz" $LIBCURL --no-same-owner
)
3 changes: 1 addition & 2 deletions tests/integration/codebuild/buildspec.os.alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ batch:
env:
variables:
DISTRO_VERSION:
- "3.17"
- "3.18"
- "3.19"
- "3.20"
RUNTIME_VERSION:
- "3.9"
- "3.10"
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/docker/Dockerfile.echo.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ RUN mkdir -p ${RIC_BUILD_DIR}
# Copy function code and Runtime Interface Client .tgz
WORKDIR ${RIC_BUILD_DIR}
COPY . .
RUN make init build test && \
RUN make init patch-libcurl-configure-template && \
make build test && \
mv ./dist/awslambdaric-*.tar.gz ./dist/awslambdaric-test.tar.gz

# Include global args in this stage of the build
Expand Down