Skip to content
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

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

Merged
merged 4 commits into from
Aug 22, 2024

Conversation

m-rph
Copy link
Contributor

@m-rph m-rph commented Aug 16, 2024

Adds a patch for autoconf 2.72 for alpine3.20.

Fixes: #144

Target: Custom Docker Image

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

Copy link
Contributor Author

@m-rph m-rph left a comment

Choose a reason for hiding this comment

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

Diff of "effectively modified segments".

However, we compile libcurl without openssl. So this is effectively no-op.

4,8c4,8
< if test "${with_secure_transport+set}" = set; then :
<   withval=$with_secure_transport; OPT_SECURETRANSPORT=$withval
<   test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }Secure-Transport"
---
> if test ${with_secure_transport+y}
> then :
>   withval=$with_secure_transport;
>   OPT_SECURETRANSPORT=$withval
>   test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
16,20c16,21
< if test "${with_amissl+set}" = set; then :
<   withval=$with_amissl; OPT_AMISSL=$withval
<   test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }AmiSSL"
---
> if test ${with_amissl+y}
> then :
>   withval=$with_amissl;
>   OPT_AMISSL=$withval
>   test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL"
> 
23a25
> 
28,29c30,33
< if test "${with_ssl+set}" = set; then :
<   withval=$with_ssl; OPT_SSL=$withval
---
> if test ${with_ssl+y}
> then :
>   withval=$with_ssl;
>   OPT_SSL=$withval
32,34c36,38
<     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }OpenSSL"
---
>     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
>   fi
> 
37d40
<   fi
41,42c44,47
< if test "${with_openssl+set}" = set; then :
<   withval=$with_openssl; OPT_OPENSSL=$withval
---
> if test ${with_openssl+y}
> then :
>   withval=$with_openssl;
>   OPT_OPENSSL=$withval
44,46c49,51
<     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }OpenSSL"
---
>     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
>   fi
> 
49d53
<   fi
54,55c58,61
< if test "${with_gnutls+set}" = set; then :
<   withval=$with_gnutls; OPT_GNUTLS=$withval
---
> if test ${with_gnutls+y}
> then :
>   withval=$with_gnutls;
>   OPT_GNUTLS=$withval
57,59c63,65
<     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }GnuTLS"
---
>     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS"
>   fi
> 
62d67
<   fi
67,68c72,75
< if test "${with_mbedtls+set}" = set; then :
<   withval=$with_mbedtls; OPT_MBEDTLS=$withval
---
> if test ${with_mbedtls+y}
> then :
>   withval=$with_mbedtls;
>   OPT_MBEDTLS=$withval
70,72c77,79
<     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }mbedTLS"
---
>     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS"
>   fi
> 
75d81
<   fi
80,81c86,89
< if test "${with_wolfssl+set}" = set; then :
<   withval=$with_wolfssl; OPT_WOLFSSL=$withval
---
> if test ${with_wolfssl+y}
> then :
>   withval=$with_wolfssl;
>   OPT_WOLFSSL=$withval
83,85c91,93
<     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }wolfSSL"
---
>     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL"
>   fi
> 
88d95
<   fi
93,94c100,103
< if test "${with_bearssl+set}" = set; then :
<   withval=$with_bearssl; OPT_BEARSSL=$withval
---
> if test ${with_bearssl+y}
> then :
>   withval=$with_bearssl;
>   OPT_BEARSSL=$withval
96,98c105,107
<     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }BearSSL"
---
>     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL"
>   fi
> 
101d109
<   fi
106,107c114,117
< if test "${with_rustls+set}" = set; then :
<   withval=$with_rustls; OPT_RUSTLS=$withval
---
> if test ${with_rustls+y}
> then :
>   withval=$with_rustls;
>   OPT_RUSTLS=$withval
109,111c119,121
<     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }rustls"
---
>     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls"
>   fi
> 
114d123
<   fi
119,120c128,131
< if test "${with_nss_deprecated+set}" = set; then :
<   withval=$with_nss_deprecated; if test X"$withval" != Xno; then
---
> if test ${with_nss_deprecated+y}
> then :
>   withval=$with_nss_deprecated;
>   if test X"$withval" != Xno; then
130,131c141,144
< if test "${with_nss+set}" = set; then :
<   withval=$with_nss; OPT_NSS=$withval
---
> if test ${with_nss+y}
> then :
>   withval=$with_nss;
>   OPT_NSS=$withval
138,140c151
<     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE
< else
<   }NSS"
---
>     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }NSS"
168c179,180
< if test "${with_darwinssl+set}" = set; then :
---
> if test ${with_darwinssl+y}
> then :
170a183
> 

@m-rph m-rph marked this pull request as ready for review August 16, 2024 19:09
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
@m-rph m-rph requested review from smirnoal and maxday August 19, 2024 14:52

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 ()

Copy link
Contributor Author

@m-rph m-rph left a comment

Choose a reason for hiding this comment

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

Needs some tidying but otherwise I am satisfied with the end result.

(
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.

@m-rph
Copy link
Contributor Author

m-rph commented Aug 22, 2024

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

Also builds therefore the latest commit is patched properly.

Contents of the tar can be verified by running scripts/update_deps.sh and unpacking / diffing the contents.

@m-rph m-rph merged commit 9425d49 into main Aug 22, 2024
6 checks passed
@m-rph m-rph deleted the python-ric-144 branch August 22, 2024 13:42
m-rph added a commit to aws/aws-lambda-nodejs-runtime-interface-client that referenced this pull request Aug 26, 2024
This is a port of
[aws-lambda-python-runtime-interface-client#168](aws/aws-lambda-python-runtime-interface-client#168).

It applied a patch to the configure script of curl. The patch fixes some
inlining templating issues introduced with autoconf of 2.72.
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.

pip install awslambdaric breaks on alpine linux with autoconf=2.72-r0
3 participants