From 7e8e0c71e3ecf591c9adf4c8122b0c8dfe8196f4 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 09:36:09 -0500 Subject: [PATCH 01/20] Cache PROJ library build when building wheels --- .github/workflows/release.yaml | 9 +++++++++ ci/proj-compile-wheels.sh | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4eb904983..0ed5129e7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -116,6 +116,12 @@ jobs: mkdir -p ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj cp "$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/share/proj/"* ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj/ + - name: Cache PROJ build + uses: actions/cache@v3 + with: + path: ${{ runner.temp }}/proj-${{ env.PROJ_VERSION }} + key: ${{ matrix.os }}-${{ matrix.arch }}-${{ env.PROJ_VERSION }}-${{ hashFiles('ci/proj-compile-wheels.sh') }} + - name: Build wheels uses: pypa/cibuildwheel@v2.16 env: @@ -125,11 +131,13 @@ jobs: PROJ_WHEEL=true PROJ_NETWORK=ON PROJ_VERSION=${{ env.PROJ_VERSION }} + PROJ_CACHE=/host${{ runner.temp }}/proj=${{ env.PROJ_VERSION }}/ PROJ_DIR=/project/pyproj/proj_dir CIBW_ENVIRONMENT_MACOS: PROJ_WHEEL=true PROJ_NETWORK=ON PROJ_VERSION=${{ env.PROJ_VERSION }} + PROJ_CACHE=/host${{ runner.temp }}/proj=${{ env.PROJ_VERSION }}/ PROJ_DIR=${GITHUB_WORKSPACE}/pyproj/proj_dir MACOSX_DEPLOYMENT_TARGET=10.9 CMAKE_OSX_ARCHITECTURES='${{ matrix.cmake_osx_architectures }}' @@ -138,6 +146,7 @@ jobs: PROJ_WHEEL=true PROJ_NETWORK=ON PROJ_VERSION=${{ env.PROJ_VERSION }} + PROJ_CACHE=/host${{ runner.temp }}/proj=${{ env.PROJ_VERSION }}/ PROJ_DIR=$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }} CIBW_BEFORE_BUILD_WINDOWS: "python -m pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 1198ff7f3..1b7133043 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -289,6 +289,20 @@ function build_proj { touch proj-stamp } +function copy_cached_proj { + if [ -d $PROJ_CACHE ] { + exit 1 + } + + cp ${PROJ_CACHE}/* ${PROJ_DIR}/ +} + + +if copy_cached_proj ; then + echo "Using cached PROJ build" + exit 0 +fi + # Run installation process update_env_for_build_prefix suppress build_zlib From 4198d960f9f25c4480986a0b3398f368b105e69e Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 09:40:16 -0500 Subject: [PATCH 02/20] Fix bash if statement It's been a while --- ci/proj-compile-wheels.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 1b7133043..01b633cce 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -290,9 +290,9 @@ function build_proj { } function copy_cached_proj { - if [ -d $PROJ_CACHE ] { + if [ -d $PROJ_CACHE ]; then exit 1 - } + fi cp ${PROJ_CACHE}/* ${PROJ_DIR}/ } From fd5f9c094ef3bea5211dd2f9775efb80d6835650 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 09:41:09 -0500 Subject: [PATCH 03/20] Fix proj cache condition --- ci/proj-compile-wheels.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 01b633cce..3b8561a47 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -290,7 +290,7 @@ function build_proj { } function copy_cached_proj { - if [ -d $PROJ_CACHE ]; then + if [ ! -d $PROJ_CACHE ]; then exit 1 fi From bfb5e1497bd41aa855b22950d8c265961eaed9f0 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 09:44:45 -0500 Subject: [PATCH 04/20] Fix return instead of exit in bash function --- ci/proj-compile-wheels.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 3b8561a47..61ac9f510 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -291,7 +291,7 @@ function build_proj { function copy_cached_proj { if [ ! -d $PROJ_CACHE ]; then - exit 1 + return 1 fi cp ${PROJ_CACHE}/* ${PROJ_DIR}/ From 01bc0162152f80c40f4f9dd69d24f24d67d5d7b1 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 10:27:53 -0500 Subject: [PATCH 05/20] Forgot to copy built PROJ to the cache directory --- ci/proj-compile-wheels.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 61ac9f510..82fab7ecb 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -289,7 +289,7 @@ function build_proj { touch proj-stamp } -function copy_cached_proj { +function copy_cached_proj_to_build { if [ ! -d $PROJ_CACHE ]; then return 1 fi @@ -297,8 +297,13 @@ function copy_cached_proj { cp ${PROJ_CACHE}/* ${PROJ_DIR}/ } +function copy_build_proj_to_cache { + mkdir -p ${PROJ_CACHE} + cp ${PROJ_DIR}/* ${PROJ_CACHE}/ +} + -if copy_cached_proj ; then +if copy_cached_proj_to_build ; then echo "Using cached PROJ build" exit 0 fi @@ -309,3 +314,4 @@ suppress build_zlib suppress build_sqlite suppress build_libtiff build_proj +copy_build_proj_to_cache From 27dc3f9537d430a26a7f5dd965c0cbc324350029 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 10:55:16 -0500 Subject: [PATCH 06/20] Use a recursive copy for PROJ cache --- ci/proj-compile-wheels.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 82fab7ecb..cbeb98657 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -294,12 +294,12 @@ function copy_cached_proj_to_build { return 1 fi - cp ${PROJ_CACHE}/* ${PROJ_DIR}/ + cp -r ${PROJ_CACHE}/* ${PROJ_DIR}/ } function copy_build_proj_to_cache { mkdir -p ${PROJ_CACHE} - cp ${PROJ_DIR}/* ${PROJ_CACHE}/ + cp -r ${PROJ_DIR}/* ${PROJ_CACHE}/ } From 7dda8946f9ef7967cb326c439bd1bc8e636d2282 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 11:14:00 -0500 Subject: [PATCH 07/20] Cleanup typos and cp -R usage --- .github/workflows/release.yaml | 5 ++--- ci/proj-compile-wheels.sh | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0ed5129e7..4551b68b4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -131,13 +131,13 @@ jobs: PROJ_WHEEL=true PROJ_NETWORK=ON PROJ_VERSION=${{ env.PROJ_VERSION }} - PROJ_CACHE=/host${{ runner.temp }}/proj=${{ env.PROJ_VERSION }}/ + PROJ_CACHE=/host${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/ PROJ_DIR=/project/pyproj/proj_dir CIBW_ENVIRONMENT_MACOS: PROJ_WHEEL=true PROJ_NETWORK=ON PROJ_VERSION=${{ env.PROJ_VERSION }} - PROJ_CACHE=/host${{ runner.temp }}/proj=${{ env.PROJ_VERSION }}/ + PROJ_CACHE=${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/ PROJ_DIR=${GITHUB_WORKSPACE}/pyproj/proj_dir MACOSX_DEPLOYMENT_TARGET=10.9 CMAKE_OSX_ARCHITECTURES='${{ matrix.cmake_osx_architectures }}' @@ -146,7 +146,6 @@ jobs: PROJ_WHEEL=true PROJ_NETWORK=ON PROJ_VERSION=${{ env.PROJ_VERSION }} - PROJ_CACHE=/host${{ runner.temp }}/proj=${{ env.PROJ_VERSION }}/ PROJ_DIR=$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }} CIBW_BEFORE_BUILD_WINDOWS: "python -m pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index cbeb98657..046e501d4 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -294,12 +294,12 @@ function copy_cached_proj_to_build { return 1 fi - cp -r ${PROJ_CACHE}/* ${PROJ_DIR}/ + cp -R ${PROJ_CACHE}/* ${PROJ_DIR}/ } function copy_build_proj_to_cache { mkdir -p ${PROJ_CACHE} - cp -r ${PROJ_DIR}/* ${PROJ_CACHE}/ + cp -R ${PROJ_DIR}/* ${PROJ_CACHE}/ } From 38233953c0aa79bf53ab48ced4974df49eedd836 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 12:25:23 -0500 Subject: [PATCH 08/20] Don't cache PROJ build on Windows --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4551b68b4..76b065f7a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -117,6 +117,7 @@ jobs: cp "$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/share/proj/"* ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj/ - name: Cache PROJ build + if: ${{ !contains(matrix.os, 'windows') }} uses: actions/cache@v3 with: path: ${{ runner.temp }}/proj-${{ env.PROJ_VERSION }} From 716f13b76180888971069157c168da3dc37da3a5 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 12:53:35 -0500 Subject: [PATCH 09/20] Add verbose flag to cp to debug what's going on --- .github/workflows/release.yaml | 2 +- ci/proj-compile-wheels.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 76b065f7a..06341d55d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -121,7 +121,7 @@ jobs: uses: actions/cache@v3 with: path: ${{ runner.temp }}/proj-${{ env.PROJ_VERSION }} - key: ${{ matrix.os }}-${{ matrix.arch }}-${{ env.PROJ_VERSION }}-${{ hashFiles('ci/proj-compile-wheels.sh') }} + key: ${{ matrix.os }}-${{ matrix.arch }}-${{ env.PROJ_VERSION }}-${{ hashFiles('ci/proj-compile-wheels.sh') }}-cache0 - name: Build wheels uses: pypa/cibuildwheel@v2.16 diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 046e501d4..dcba823b0 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -294,12 +294,12 @@ function copy_cached_proj_to_build { return 1 fi - cp -R ${PROJ_CACHE}/* ${PROJ_DIR}/ + cp -Rv ${PROJ_CACHE}/* ${PROJ_DIR}/ } function copy_build_proj_to_cache { mkdir -p ${PROJ_CACHE} - cp -R ${PROJ_DIR}/* ${PROJ_CACHE}/ + cp -Rv ${PROJ_DIR}/* ${PROJ_CACHE}/ } From ded8d65cb40804dc2a8eafc9b79e4a219993521c Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 13:40:18 -0500 Subject: [PATCH 10/20] Create PROJ_DIR when copying from cache --- ci/proj-compile-wheels.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index dcba823b0..12ab36e2b 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -294,6 +294,7 @@ function copy_cached_proj_to_build { return 1 fi + mkdir -p ${PROJ_DIR}/ cp -Rv ${PROJ_CACHE}/* ${PROJ_DIR}/ } From dd62f2ae53942efda967a12d8da83252cbcb2106 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 14:50:45 -0500 Subject: [PATCH 11/20] Try installing PROJ dependencies directly in cache --- .github/workflows/release.yaml | 6 ++++-- ci/proj-compile-wheels.sh | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 06341d55d..c60a22156 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -132,13 +132,15 @@ jobs: PROJ_WHEEL=true PROJ_NETWORK=ON PROJ_VERSION=${{ env.PROJ_VERSION }} - PROJ_CACHE=/host${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/ + PROJ_CACHE=/host${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj + BUILD_PREFIX=/host${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps PROJ_DIR=/project/pyproj/proj_dir CIBW_ENVIRONMENT_MACOS: PROJ_WHEEL=true PROJ_NETWORK=ON PROJ_VERSION=${{ env.PROJ_VERSION }} - PROJ_CACHE=${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/ + PROJ_CACHE=${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj + BUILD_PREFIX=${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps PROJ_DIR=${GITHUB_WORKSPACE}/pyproj/proj_dir MACOSX_DEPLOYMENT_TARGET=10.9 CMAKE_OSX_ARCHITECTURES='${{ matrix.cmake_osx_architectures }}' diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 12ab36e2b..50026005b 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -304,13 +304,14 @@ function copy_build_proj_to_cache { } +update_env_for_build_prefix + if copy_cached_proj_to_build ; then echo "Using cached PROJ build" exit 0 fi # Run installation process -update_env_for_build_prefix suppress build_zlib suppress build_sqlite suppress build_libtiff From 49600d0c3ccebd6f57db378062c5bd61905fc133 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 15:58:25 -0500 Subject: [PATCH 12/20] Debug linux repair wheel not finding libtiff --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c60a22156..425386537 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -152,6 +152,8 @@ jobs: PROJ_DIR=$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }} CIBW_BEFORE_BUILD_WINDOWS: "python -m pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" + # debug: + CIBW_REPAIR_WHEEL_COMMAND_LINUX: "bash -c \"echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel}\"" CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true" From 709cf7382ab0be1ca7735fb641ff40f7a8dc4545 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 19:36:55 -0500 Subject: [PATCH 13/20] Test if LD_LIBRARY_PATH fixes libtiff auditwheel issue --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 425386537..5922fdbfe 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -153,7 +153,7 @@ jobs: CIBW_BEFORE_BUILD_WINDOWS: "python -m pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" # debug: - CIBW_REPAIR_WHEEL_COMMAND_LINUX: "bash -c \"echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel}\"" + CIBW_REPAIR_WHEEL_COMMAND_LINUX: "bash -c \"export LD_LIBRARY_PATH=\"${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps:$LD_LIBRARY_PATH\"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel}\"" CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true" From dcba85919d10c6ab375114a4ec09618757239836 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Sat, 23 Sep 2023 14:21:53 -0500 Subject: [PATCH 14/20] Maybe fix quoting in repair wheel command --- .github/workflows/release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5922fdbfe..515ce3684 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -153,7 +153,8 @@ jobs: CIBW_BEFORE_BUILD_WINDOWS: "python -m pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" # debug: - CIBW_REPAIR_WHEEL_COMMAND_LINUX: "bash -c \"export LD_LIBRARY_PATH=\"${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps:$LD_LIBRARY_PATH\"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel}\"" + CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- + bash -c "export LD_LIBRARY_PATH=\"${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps:$LD_LIBRARY_PATH\"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel}" CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true" From d7b7b7a9add68577dabada2c2cea38ba488a776d Mon Sep 17 00:00:00 2001 From: David Hoese Date: Sat, 23 Sep 2023 14:34:41 -0500 Subject: [PATCH 15/20] Try with no bash --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 515ce3684..3d6cb8a58 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -154,7 +154,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" # debug: CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - bash -c "export LD_LIBRARY_PATH=\"${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps:$LD_LIBRARY_PATH\"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel}" + export LD_LIBRARY_PATH="${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps:$LD_LIBRARY_PATH"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel} CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true" From 462997937abd68632a252cd83da0d6622f1fecfa Mon Sep 17 00:00:00 2001 From: David Hoese Date: Sat, 23 Sep 2023 18:17:59 -0500 Subject: [PATCH 16/20] Try lib for library path --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3d6cb8a58..6f5eb41c8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -154,7 +154,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" # debug: CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - export LD_LIBRARY_PATH="${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps:$LD_LIBRARY_PATH"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel} + export LD_LIBRARY_PATH="${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps/lib:$LD_LIBRARY_PATH"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel} CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true" From b3e0a703e095c100bb12bff24d57f0cbe4e9c4d5 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Sat, 23 Sep 2023 18:40:36 -0500 Subject: [PATCH 17/20] Try lib64 for library path --- .github/workflows/release.yaml | 2 +- ci/proj-compile-wheels.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6f5eb41c8..84ed024cf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -154,7 +154,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" # debug: CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - export LD_LIBRARY_PATH="${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps/lib:$LD_LIBRARY_PATH"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel} + export LD_LIBRARY_PATH="${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps/lib64:$LD_LIBRARY_PATH"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel} CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true" diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 50026005b..0a339b584 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -300,6 +300,8 @@ function copy_cached_proj_to_build { function copy_build_proj_to_cache { mkdir -p ${PROJ_CACHE} + ls -l ${BUILD_PREFIX} + ls -l ${BUILD_PREFIX}/lib cp -Rv ${PROJ_DIR}/* ${PROJ_CACHE}/ } From 32045d2bd0e4e9b06dafdc80b693cef0ef94fcb9 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Sat, 23 Sep 2023 19:59:43 -0500 Subject: [PATCH 18/20] Add missing /host prefix --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 84ed024cf..fbfe38178 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -154,7 +154,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" # debug: CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - export LD_LIBRARY_PATH="${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps/lib64:$LD_LIBRARY_PATH"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel} + export LD_LIBRARY_PATH="/host${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps/lib:$LD_LIBRARY_PATH"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel} CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true" From 55316f9c406091c3f9a67cc273c04ab00628fa7e Mon Sep 17 00:00:00 2001 From: David Hoese Date: Mon, 25 Sep 2023 13:31:26 -0500 Subject: [PATCH 19/20] Try using LD_RUN_PATH instead of LD_LIBRARY_PATH This should mean that the built .so has a reference to the path and the user isn't required to add it --- .github/workflows/release.yaml | 3 --- ci/proj-compile-wheels.sh | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fbfe38178..c60a22156 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -152,9 +152,6 @@ jobs: PROJ_DIR=$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }} CIBW_BEFORE_BUILD_WINDOWS: "python -m pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" - # debug: - CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - export LD_LIBRARY_PATH="/host${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps/lib:$LD_LIBRARY_PATH"; echo $LD_LIBRARY_PATH; auditwheel repair -w {dest_dir} {wheel} CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true" diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index 0a339b584..e7760734e 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -36,6 +36,7 @@ function update_env_for_build_prefix { # Promote BUILD_PREFIX on search path to any newly built libs export CPPFLAGS="-I$BUILD_PREFIX/include $CPPFLAGS_BACKUP" export LIBRARY_PATH="$BUILD_PREFIX/lib:$LIBRARY_PATH_BACKUP" + export LD_RUN_PATH="${BUILD_PREFI}/lib" export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH_BACKUP" # Add binary path for configure utils etc export PATH="$BUILD_PREFIX/bin:$PATH" From a4aba7e8bc5dc36e7778ff919bb97aee788ba5bc Mon Sep 17 00:00:00 2001 From: David Hoese Date: Mon, 25 Sep 2023 14:05:27 -0500 Subject: [PATCH 20/20] Use LDFLAGS rpath in wheel build --- .github/workflows/release.yaml | 1 + ci/proj-compile-wheels.sh | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c60a22156..31ebf2381 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -135,6 +135,7 @@ jobs: PROJ_CACHE=/host${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj BUILD_PREFIX=/host${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps PROJ_DIR=/project/pyproj/proj_dir + LDFLAGS="${LDFLAGS} -Wl,-rpath,/host${{ runner.temp }}/proj-${{ env.PROJ_VERSION }}/proj-deps/lib" CIBW_ENVIRONMENT_MACOS: PROJ_WHEEL=true PROJ_NETWORK=ON diff --git a/ci/proj-compile-wheels.sh b/ci/proj-compile-wheels.sh index e7760734e..50026005b 100644 --- a/ci/proj-compile-wheels.sh +++ b/ci/proj-compile-wheels.sh @@ -36,7 +36,6 @@ function update_env_for_build_prefix { # Promote BUILD_PREFIX on search path to any newly built libs export CPPFLAGS="-I$BUILD_PREFIX/include $CPPFLAGS_BACKUP" export LIBRARY_PATH="$BUILD_PREFIX/lib:$LIBRARY_PATH_BACKUP" - export LD_RUN_PATH="${BUILD_PREFI}/lib" export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH_BACKUP" # Add binary path for configure utils etc export PATH="$BUILD_PREFIX/bin:$PATH" @@ -301,8 +300,6 @@ function copy_cached_proj_to_build { function copy_build_proj_to_cache { mkdir -p ${PROJ_CACHE} - ls -l ${BUILD_PREFIX} - ls -l ${BUILD_PREFIX}/lib cp -Rv ${PROJ_DIR}/* ${PROJ_CACHE}/ }