diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f9a4d587..dedb54c0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,9 +40,7 @@ jobs: if: runner.os == 'macOS' run: | export OPENSSL_PREFIX=`brew --prefix openssl@1.1` - export LIBSSH2_PREFIX=`brew --prefix libssh2` - export LIBGIT2_VERSION=1.7.1 - /bin/sh build.sh test + LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.1 /bin/sh build.sh test aarch64: runs-on: ubuntu-22.04 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8afa93de..59848f52 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - fixci tags: - 'v*' @@ -13,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, macos-latest] + os: [macos-latest] steps: - uses: actions/checkout@v3 @@ -32,14 +33,14 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BEFORE_ALL: sh build.sh - CIBW_ENVIRONMENT: LIBGIT2_VERSION=1.7.1 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.0.9 LIBGIT2=/project/ci - CIBW_ENVIRONMENT_MACOS: LIBGIT2_VERSION=1.7.1 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.0.9 DYLD_LIBRARY_PATH=/usr/local/lib - CIBW_SKIP: "*-musllinux* *pypy*" + CIBW_ENVIRONMENT: LIBGIT2_VERSION=1.7.1 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.1.2 LIBGIT2=/project/ci + CIBW_ENVIRONMENT_MACOS: LIBGIT2_VERSION=1.7.1 LIBSSH2_VERSION=1.11.0 OPENSSL_VERSION=3.1.2 LIBGIT2=/Users/runner/work/pygit2/pygit2/ci + CIBW_SKIP: "*musl* pp3* cp312*" CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014" CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014" CIBW_REPAIR_WHEEL_COMMAND_LINUX: "LD_LIBRARY_PATH=/project/ci/lib64 auditwheel repair -w {dest_dir} {wheel}" - CIBW_REPAIR_WHEEL_COMMAND_MACOS: "DYLD_LIBRARY_PATH=/usr/local/lib delocate-listdeps {wheel} && DYLD_LIBRARY_PATH=/usr/local/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}" - CIBW_ARCHS_MACOS: x86_64 universal2 + CIBW_REPAIR_WHEEL_COMMAND_MACOS: "DYLD_LIBRARY_PATH=/Users/runner/work/pygit2/pygit2/ci/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}" + CIBW_ARCHS_MACOS: universal2 CIBW_ARCHS_LINUX: x86_64 aarch64 - uses: actions/upload-artifact@v3 diff --git a/build.sh b/build.sh index a463e0c0..70184b49 100644 --- a/build.sh +++ b/build.sh @@ -11,15 +11,11 @@ # # AUDITWHEEL_PLAT - Linux platform for auditwheel repair # LIBSSH2_OPENSSL - Where to find openssl -# LIBSSH2_PREFIX - Where to find libssh2 # LIBSSH2_VERSION= - Build the given version of libssh2 # LIBGIT2_VERSION= - Build the given version of libgit2 # OPENSSL_VERSION= - Build the given version of OpenSSL # (only needed for Mac universal on CI) # -# Either use LIBSSH2_PREFIX, or LIBSSH2_VERSION, or none (if libssh2 is already -# in the path, or if you don't want to use it). -# # Examples. # # Build inplace, libgit2 must be available in the path: @@ -35,11 +31,6 @@ # # LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.1 sh build.sh # -# Tell where libssh2 is installed, build libgit2 1.7.1, then build pygit2 -# inplace: -# -# LIBSSH2_PREFIX=/usr/local LIBGIT2_VERSION=1.7.1 sh build.sh -# # Build inplace and run the tests: # # sh build.sh test @@ -170,7 +161,6 @@ if [ -n "$LIBSSH2_VERSION" ]; then fi cmake --build . --target install cd .. - LIBSSH2_PREFIX=$PREFIX USE_SSH=ON else USE_SSH=OFF @@ -185,7 +175,7 @@ if [ -n "$LIBGIT2_VERSION" ]; then mkdir build -p cd build if [ "$KERNEL" = "Darwin" ] && [ "$CIBUILDWHEEL" = "1" ]; then - CMAKE_PREFIX_PATH=$OPENSSL_PREFIX:$LIBSSH2_PREFIX cmake .. \ + CMAKE_PREFIX_PATH=$OPENSSL_PREFIX:$PREFIX cmake .. \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTS=OFF \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ @@ -193,10 +183,11 @@ if [ -n "$LIBGIT2_VERSION" ]; then -DOPENSSL_CRYPTO_LIBRARY="../openssl-universal/$LIBCRYPTO" \ -DOPENSSL_SSL_LIBRARY="../openssl-universal/$LIBSSL" \ -DOPENSSL_INCLUDE_DIR="../openssl-x86/include" \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DUSE_SSH=$USE_SSH else export CFLAGS=-I$PREFIX/include - CMAKE_PREFIX_PATH=$OPENSSL_PREFIX:$LIBSSH2_PREFIX cmake .. \ + CMAKE_PREFIX_PATH=$OPENSSL_PREFIX:$PREFIX cmake .. \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTS=OFF \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ @@ -211,12 +202,12 @@ fi if [ "$CIBUILDWHEEL" = "1" ]; then if [ "$KERNEL" = "Darwin" ]; then - # Copy libraries where delocate-wheel can find them. - # In Linux we use LD_LIBRARY_PATH to avoid this, maybe - # DYLD_LIBRARY_PATH would work for macOS. - cp -r $OPENSSL_PREFIX/*.dylib /usr/local/lib - cp -r $LIBSSH2_PREFIX/lib/*.dylib /usr/local/lib - cp -r $FILENAME/build/*.dylib /usr/local/lib + cp $OPENSSL_PREFIX/*.dylib $PREFIX/lib/ + cp $OPENSSL_PREFIX/*.dylib $PREFIX/lib/ + echo "PREFIX " $PREFIX + echo "OPENSSL_PREFIX" $OPENSSL_PREFIX + ls -l /Users/runner/work/pygit2/pygit2/ci/ + ls -l $PREFIX/lib fi # we're done building dependencies, cibuildwheel action will take over exit 0