From 34e73e2b995f534fef613fd87824bdadc73a29a5 Mon Sep 17 00:00:00 2001 From: Jay Wu Date: Tue, 26 Dec 2023 17:40:54 +0800 Subject: [PATCH 1/4] fix(curl): build with multiple tls endpoints on macOS --- package.json | 2 +- scripts/ci/build-libcurl.sh | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1cca97853..4b4d87f56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getinsomnia/node-libcurl", - "version": "2.4.1-5", + "version": "2.4.1-6", "description": "The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl", "keywords": [ "node-curl", diff --git a/scripts/ci/build-libcurl.sh b/scripts/ci/build-libcurl.sh index 0b2680839..1feaa7ef5 100755 --- a/scripts/ci/build-libcurl.sh +++ b/scripts/ci/build-libcurl.sh @@ -134,13 +134,15 @@ fi ##### # ssl #### -if [ "${RUNNER_OS}" == "macOS" ]; then - libcurl_args+=("--with-secure-transport") -elif [ ! -z "$OPENSSL_BUILD_FOLDER" ]; then +if [ ! -z "$OPENSSL_BUILD_FOLDER" ]; then CPPFLAGS="$CPPFLAGS -I$OPENSSL_BUILD_FOLDER/include" LDFLAGS="$LDFLAGS -L$OPENSSL_BUILD_FOLDER/lib -Wl,-rpath,$OPENSSL_BUILD_FOLDER/lib" libcurl_args+=("--with-ssl=$OPENSSL_BUILD_FOLDER") + if [ "${RUNNER_OS}" == "macOS" ]; then + libcurl_args+=("--with-secure-transport") + libcurl_args+=("--with-default-ssl-backend=openssl") + fi else libcurl_args+=("--without-ssl") fi From f203a57bce5952094829906179ac9072e7539a73 Mon Sep 17 00:00:00 2001 From: Jay Wu Date: Fri, 5 Jan 2024 22:30:55 +0800 Subject: [PATCH 2/4] force rebuild on macos 1. force rebuild libcurl on macos 2. add three more options for macos --- package.json | 2 +- scripts/ci/build-libcurl.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b4d87f56..0c380a4a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getinsomnia/node-libcurl", - "version": "2.4.1-6", + "version": "2.4.1-8", "description": "The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl", "keywords": [ "node-curl", diff --git a/scripts/ci/build-libcurl.sh b/scripts/ci/build-libcurl.sh index 1feaa7ef5..2767c0cb5 100755 --- a/scripts/ci/build-libcurl.sh +++ b/scripts/ci/build-libcurl.sh @@ -15,6 +15,11 @@ mkdir -p $2/source FORCE_REBUILD=${FORCE_REBUILD:-} FORCE_REBUILD_LIBCURL=${FORCE_REBUILD_LIBCURL:-} +# has a cache issue which will skip the rebuild of libcurl +if [ "${RUNNER_OS}" == "macOS" ]; then + FORCE_REBUILD_LIBCURL="true" +fi + # @TODO We are explicitly checking the static lib if [[ -f $build_folder/lib/libcurl.a ]] && [[ -z $FORCE_REBUILD || $FORCE_REBUILD != "true" ]] && [[ -z $FORCE_REBUILD_LIBCURL || $FORCE_REBUILD_LIBCURL != "true" ]]; then echo "Skipping rebuild of libcurl because lib file already exists" @@ -142,6 +147,9 @@ if [ ! -z "$OPENSSL_BUILD_FOLDER" ]; then if [ "${RUNNER_OS}" == "macOS" ]; then libcurl_args+=("--with-secure-transport") libcurl_args+=("--with-default-ssl-backend=openssl") + libcurl_args+=("--without-ca-bundle") + libcurl_args+=("--without-ca-path") + libcurl_args+=("--with-ca-fallback") fi else libcurl_args+=("--without-ssl") From 7a9455b09104af7ca895630786c5c1259c92fecc Mon Sep 17 00:00:00 2001 From: Jay Wu Date: Mon, 8 Jan 2024 22:12:29 +0800 Subject: [PATCH 3/4] remove some compile flags for macos --- scripts/ci/build-libcurl.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/ci/build-libcurl.sh b/scripts/ci/build-libcurl.sh index 2767c0cb5..45b5a6ec7 100755 --- a/scripts/ci/build-libcurl.sh +++ b/scripts/ci/build-libcurl.sh @@ -147,9 +147,6 @@ if [ ! -z "$OPENSSL_BUILD_FOLDER" ]; then if [ "${RUNNER_OS}" == "macOS" ]; then libcurl_args+=("--with-secure-transport") libcurl_args+=("--with-default-ssl-backend=openssl") - libcurl_args+=("--without-ca-bundle") - libcurl_args+=("--without-ca-path") - libcurl_args+=("--with-ca-fallback") fi else libcurl_args+=("--without-ssl") From 26e197c6ebd9e5cab919f688a2ee67d7cc0adc3f Mon Sep 17 00:00:00 2001 From: Jay Wu Date: Mon, 8 Jan 2024 22:24:00 +0800 Subject: [PATCH 4/4] Update version to 2.4.1-8-alpha.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c380a4a3..294c1c772 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getinsomnia/node-libcurl", - "version": "2.4.1-8", + "version": "2.4.1-8-alpha.2", "description": "The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl", "keywords": [ "node-curl",