From 39174fee8f6b0a158f837f1c82fdae56dc438cc5 Mon Sep 17 00:00:00 2001 From: Or Hayat Date: Wed, 23 Sep 2026 11:42:54 +0300 Subject: [PATCH 1/3] CI: build the bundled libgit2 in Release mode for wheels build.sh defaults BUILD_TYPE to Debug and neither cibuildwheel environment set it, so every wheel built through it shipped an unoptimized libgit2. --- .github/workflows/wheels.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 657a5571..6aa0363a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -189,7 +189,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_arch }} CIBW_SKIP: ${{ matrix.cibw_skip }} CIBW_CONTAINER_ENGINE: 'docker; create_args: -v ${{ github.workspace }}/ci:/project/ci' - CIBW_ENVIRONMENT: LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.7 LIBGIT2=/project/ci + CIBW_ENVIRONMENT: LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.7 LIBGIT2=/project/ci BUILD_TYPE=Release - uses: actions/upload-artifact@v7 with: diff --git a/pyproject.toml b/pyproject.toml index 3829aa5c..7bb45840 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ skip = "*musllinux_ppc64le" archs = ["native"] build-frontend = "default" dependency-versions = "pinned" -environment = {LIBGIT2="$(pwd)/ci", LIBGIT2_VERSION="1.9.7", LIBSSH2_VERSION="1.11.1", OPENSSL_VERSION="3.5.7"} +environment = {LIBGIT2="$(pwd)/ci", LIBGIT2_VERSION="1.9.7", LIBSSH2_VERSION="1.11.1", OPENSSL_VERSION="3.5.7", BUILD_TYPE="Release"} before-all = "sh build.sh" test-command = "pytest" From 6774d775f303d4e8378608c16bff4efd86de3b87 Mon Sep 17 00:00:00 2001 From: Or Hayat Date: Wed, 23 Sep 2026 12:18:49 +0300 Subject: [PATCH 2/3] CI: include the build type in the dependency cache stamp build.sh reuses a cached ci/ when the three version numbers in versions.txt match, so a cached Debug build satisfies a Release build and the rebuild is skipped. --- build.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 8f10af14..f1d41a51 100644 --- a/build.sh +++ b/build.sh @@ -83,11 +83,12 @@ if [ "$CIBUILDWHEEL" = "1" ]; then fi fi - # Use cached dependencies if they match the requested versions. + # Use cached dependencies if they match the requested versions and build type. if [ -f ci/versions.txt ] && \ grep -q "^LIBGIT2_VERSION=$LIBGIT2_VERSION$" ci/versions.txt && \ grep -q "^LIBSSH2_VERSION=$LIBSSH2_VERSION$" ci/versions.txt && \ - grep -q "^OPENSSL_VERSION=$OPENSSL_VERSION$" ci/versions.txt; then + grep -q "^OPENSSL_VERSION=$OPENSSL_VERSION$" ci/versions.txt && \ + grep -q "^BUILD_TYPE=$BUILD_TYPE$" ci/versions.txt; then echo "Using cached dependencies" exit 0 fi @@ -216,6 +217,7 @@ if [ "$CIBUILDWHEEL" = "1" ]; then LIBGIT2_VERSION=$LIBGIT2_VERSION LIBSSH2_VERSION=$LIBSSH2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION +BUILD_TYPE=$BUILD_TYPE EOF if [ "$KERNEL" = "Darwin" ]; then echo "PREFIX " $PREFIX From 3110a78980b8da74e5375b377e73e7daf25641e7 Mon Sep 17 00:00:00 2001 From: Or Hayat Date: Wed, 23 Sep 2026 14:25:16 +0300 Subject: [PATCH 3/3] CI: build the bundled libssh2 with the configured build type --- build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.sh b/build.sh index f1d41a51..d5375017 100644 --- a/build.sh +++ b/build.sh @@ -164,6 +164,7 @@ if [ -n "$LIBSSH2_VERSION" ]; then -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_EXAMPLES=OFF \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DCMAKE_OSX_ARCHITECTURES="$ARCH" \ -DBUILD_TESTING=OFF else @@ -171,6 +172,7 @@ if [ -n "$LIBSSH2_VERSION" ]; then -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_EXAMPLES=OFF \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DBUILD_TESTING=OFF fi cmake --build . --target install