From 3b6294d6a517e42d26aebc0f1bebb569a6443ede Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Wed, 28 Aug 2024 17:31:46 -0700 Subject: [PATCH 01/11] Add GDAL 3.9.2, libkml, and uv for virtualenv in CI --- .circleci/config.yml | 2 +- .github/workflows/docker-gdal.yml | 8 +- .github/workflows/release.yml | 90 ++++++++++++++----- CHANGES.md | 18 ++-- ....cmake => x64-linux-dynamic-release.cmake} | 0 ...ic.cmake => x64-osx-dynamic-release.cmake} | 0 ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile | 10 +-- ...nylinux_2_28_aarch64-vcpkg-gdal.Dockerfile | 2 +- ci/vcpkg.json | 12 ++- pyproject.toml | 30 ++++--- 10 files changed, 116 insertions(+), 56 deletions(-) rename ci/custom-triplets/{x64-linux-dynamic.cmake => x64-linux-dynamic-release.cmake} (100%) rename ci/custom-triplets/{x64-osx-dynamic.cmake => x64-osx-dynamic-release.cmake} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b207874..af135db3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ jobs: - run: name: Build the Linux aarch64 wheels. command: | - python3 -m pip install --user cibuildwheel==2.17.0 + python3 -m pip install --user cibuildwheel==2.20.0 python3 -m cibuildwheel --output-dir wheelhouse - run: name: Test the wheels diff --git a/.github/workflows/docker-gdal.yml b/.github/workflows/docker-gdal.yml index 601edbe4..189954a0 100644 --- a/.github/workflows/docker-gdal.yml +++ b/.github/workflows/docker-gdal.yml @@ -20,8 +20,9 @@ jobs: fail-fast: false matrix: container: - - "ghcr.io/osgeo/gdal:ubuntu-small-latest" # >= python 3.10.6 - - "ghcr.io/osgeo/gdal:ubuntu-small-3.8.3" # python 3.10.12 + - "ghcr.io/osgeo/gdal:ubuntu-small-latest" # >= python 3.12.3 + - "ghcr.io/osgeo/gdal:ubuntu-small-3.9.2" # python 3.12.3 + - "ghcr.io/osgeo/gdal:ubuntu-small-3.8.5" # python 3.10.12 - "ghcr.io/osgeo/gdal:ubuntu-small-3.7.3" # python 3.10.12 - "ghcr.io/osgeo/gdal:ubuntu-small-3.6.4" # python 3.10.6 - "osgeo/gdal:ubuntu-small-3.5.3" # python 3.8.10 @@ -38,6 +39,9 @@ jobs: - uses: actions/checkout@v4 - name: Create virtual environment + # install uv and use it to create a virtual environment, then add it to + # environment variables so that it is automatically activated and can be + # used for tests below run: | curl -LsSf https://astral.sh/uv/install.sh | sh . $HOME/.cargo/env diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 131d78e7..06c665ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,36 +54,49 @@ jobs: needs: [build-sdist] runs-on: ubuntu-latest container: - image: "ghcr.io/osgeo/gdal:ubuntu-small-3.8.5" + image: "ghcr.io/osgeo/gdal:ubuntu-small-3.9.2" steps: + - name: Install packages + run: | + apt-get update && apt-get install -y build-essential python3-dev + + - name: Create virtual environment + # install uv and use it to create a virtual environment, then add it to + # environment variables so that it is automatically activated and can be + # used for tests below + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + . $HOME/.cargo/env + uv venv .venv + echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV + echo "$PWD/.venv/bin" >> $GITHUB_PATH + - name: Download sdist from artifacts uses: actions/download-artifact@v4 with: name: pyogrio-sdist path: wheelhouse - - name: Install pip - run: | - apt-get update && apt-get install -y python3-pip - - name: Build from sdist and install test dependencies shell: bash run: | - python3 -m pip install --no-cache-dir wheelhouse/*.tar.gz - python3 -m pip install --no-cache-dir pytest pandas pyproj shapely>=2 - python3 -m pip install --no-cache-dir --no-deps geopandas - python3 -m pip list + uv pip install --no-cache wheelhouse/*.tar.gz + uv pip install --no-cache pytest pandas pyproj shapely>=2 + uv pip install --no-cache --no-deps geopandas + uv pip list - name: Run tests shell: bash + # virtual environment is automatically activated run: | cd .. - python3 -m pytest --pyargs pyogrio.tests -v + python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" + python -m pytest --pyargs pyogrio.tests -v build-wheels-linux: name: Build wheels on Linux - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-latest" steps: - name: Checkout @@ -129,7 +142,7 @@ jobs: matrix: include: - os: "macos-12" - triplet: "x64-osx-dynamic" + triplet: "x64-osx-dynamic-release" arch: x86_64 vcpkg_cache: "/Users/runner/.cache/vcpkg/archives" vcpkg_logs: "/usr/local/share/vcpkg/buildtrees/**/*.log" @@ -160,7 +173,7 @@ jobs: path: | ${{ matrix.vcpkg_cache }} # bump the last digit to avoid using previous build cache - key: ${{ matrix.os }}-${{ matrix.arch }}-vcpkg-gdal3.8.5-cache0 + key: ${{ matrix.os }}-${{ matrix.arch }}-vcpkg-gdal3.9.2-cache0 # MacOS build requires aclocal, which is part of automake, but appears # to be missing in default image @@ -176,9 +189,9 @@ jobs: cd $VCPKG_INSTALLATION_ROOT # on mac the clone is not clean, otherwise git pull fails git reset --hard - # pull latest version to ensure the required commit with GDAL 3.8 is available + # pull specific commit with desired GDAL version git pull - git checkout 4f4a1821b2e8c7a2863e4df65a4d514f84144049 + git checkout 73794ce5f63fd138fab999a22959ca7c6305d93c - name: Install GDAL env: @@ -215,17 +228,26 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-20.04", "windows-latest", "macos-12", "macos-latest"] + os: + [ + "ubuntu-latest", + "ubuntu-20.04", + "windows-latest", + "macos-12", + "macos-latest", + ] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] include: + - os: "ubuntu-latest" + artifact: pyogrio-wheel-linux - os: "ubuntu-20.04" artifact: pyogrio-wheel-linux - os: "windows-latest" artifact: pyogrio-wheel-x64-windows-dynamic-release - os: "macos-12" - artifact: pyogrio-wheel-x64-osx-dynamic + artifact: pyogrio-wheel-x64-osx-dynamic-release - os: "macos-latest" - artifact: pyogrio-wheel-x64-osx-dynamic + artifact: pyogrio-wheel-arm64-osx-dynamic-release steps: - name: Checkout @@ -236,8 +258,27 @@ jobs: with: python-version: ${{ matrix.python-version }} allow-prereleases: true - cache: "pip" - cache-dependency-path: "ci/requirements-wheel-test.txt" + + - name: Create virtual environment (Linux / MacOS) + # install uv and use it to create a virtual environment, then add it to + # environment variables so that it is automatically activated and can be + # used for tests below + if: ${{ runner.os != 'Windows' }} + shell: bash + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + . $HOME/.cargo/env + uv venv .venv + echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV + echo "$PWD/.venv/bin" >> $GITHUB_PATH + + - name: Create virtual environment (Windows) + if: ${{ runner.os == 'Windows' }} + run: | + irm https://astral.sh/uv/install.ps1 | iex + uv venv .venv + "VIRTUAL_ENV=.venv" | Out-File -FilePath $env:GITHUB_ENV -Append + "$PWD/.venv/Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append - name: Download wheels from artifacts uses: actions/download-artifact@v4 @@ -248,15 +289,16 @@ jobs: - name: Install dependencies and pyogrio wheel shell: bash run: | - python -m pip install -r ci/requirements-wheel-test.txt + uv pip install --no-cache -r ci/requirements-wheel-test.txt if [ ${{ matrix.python-version }} != "3.12" ]; then - python -m pip install --no-deps geopandas + uv pip install --no-cache --no-deps geopandas fi - python -m pip install --pre --find-links wheelhouse pyogrio - python -m pip list + uv pip install --no-cache --pre --no-index --find-links wheelhouse pyogrio + uv pip list - name: Run tests shell: bash + # virtual environment is automatically activated run: | cd .. python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" diff --git a/CHANGES.md b/CHANGES.md index 626f3eb2..e5e7ed65 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,13 @@ # CHANGELOG -## 0.9.1 (yyyy-mm-dd) +## 0.10.0 (yyyy-mm-dd) + +### Bug fixes + +- Silence warning from `write_dataframe` with `GeoSeries.notna()` (#435). +- Enable mask & bbox filter when geometry column not read (#431). +- Raise NotImplmentedError when user attempts to write to an open file handle (#442). +- Prevent seek on read from compressed inputs (#443). ### Packaging @@ -10,13 +17,8 @@ packages if needed: more info [here](https://gdal.org/download.html#conda). This also leads to `pyproj` becoming an optional dependency; you will need to install `pyproj` in order to support spatial reference systems (#452). - -### Bug fixes - -- Silence warning from `write_dataframe` with `GeoSeries.notna()` (#435). -- Enable mask & bbox filter when geometry column not read (#431). -- Raise NotImplmentedError when user attempts to write to an open file handle (#442). -- Prevent seek on read from compressed inputs (#443). +- The GDAL library included in the wheels is updated from 3.8.5 to GDAL 3.9.2 + and includes the LIBKML driver. ## 0.9.0 (2024-06-17) diff --git a/ci/custom-triplets/x64-linux-dynamic.cmake b/ci/custom-triplets/x64-linux-dynamic-release.cmake similarity index 100% rename from ci/custom-triplets/x64-linux-dynamic.cmake rename to ci/custom-triplets/x64-linux-dynamic-release.cmake diff --git a/ci/custom-triplets/x64-osx-dynamic.cmake b/ci/custom-triplets/x64-osx-dynamic-release.cmake similarity index 100% rename from ci/custom-triplets/x64-osx-dynamic.cmake rename to ci/custom-triplets/x64-osx-dynamic-release.cmake diff --git a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile index 99485463..bb1a7843 100644 --- a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile @@ -3,16 +3,16 @@ FROM quay.io/pypa/manylinux2014_x86_64:2024-08-12-7fde9b1 # building openssl needs IPC-Cmd (https://github.com/microsoft/vcpkg/issues/24988) RUN yum install -y curl unzip zip tar perl-IPC-Cmd -# require python >= 3.7 (python 3.6 is default on base image) for meson +# require python >= 3.7 (python 3.6 is default on base image) for meson RUN ln -s /opt/python/cp38-cp38/bin/python3 /usr/bin/python3 RUN git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg && \ - git -C /opt/vcpkg checkout 4f4a1821b2e8c7a2863e4df65a4d514f84144049 + git -C /opt/vcpkg checkout 73794ce5f63fd138fab999a22959ca7c6305d93c ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg" ENV PATH="${PATH}:/opt/vcpkg" -ENV VCPKG_DEFAULT_TRIPLET="x64-linux-dynamic" +ENV VCPKG_DEFAULT_TRIPLET="x64-linux-dynamic-release" # mkdir & touch -> workaround for https://github.com/microsoft/vcpkg/issues/27786 RUN bootstrap-vcpkg.sh && \ @@ -21,11 +21,11 @@ RUN bootstrap-vcpkg.sh && \ vcpkg integrate install && \ vcpkg integrate bash -COPY ci/custom-triplets/x64-linux-dynamic.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic.cmake +COPY ci/custom-triplets/x64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/ COPY ci/vcpkg.json opt/vcpkg/ -ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic/lib" +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib" RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ --overlay-ports=opt/vcpkg/custom-ports \ --feature-flags="versions,manifests" \ diff --git a/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile b/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile index 568143e4..1f2c8a92 100644 --- a/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile @@ -4,7 +4,7 @@ FROM quay.io/pypa/manylinux_2_28_aarch64:2024-08-12-7fde9b1 RUN dnf -y install curl zip unzip tar ninja-build perl-IPC-Cmd RUN git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg && \ - git -C /opt/vcpkg checkout 4f4a1821b2e8c7a2863e4df65a4d514f84144049 + git -C /opt/vcpkg checkout 73794ce5f63fd138fab999a22959ca7c6305d93c ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg" ENV PATH="${PATH}:/opt/vcpkg" diff --git a/ci/vcpkg.json b/ci/vcpkg.json index 95ef73bf..9fc30fbc 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -1,12 +1,18 @@ { "name": "pyogrio", - "version": "0.8.0", + "version": "0.10.0", "dependencies": [ { "name": "gdal", "default-features": false, - "features": ["recommended-features", "curl", "geos", "iconv"] + "features": [ + "recommended-features", + "curl", + "geos", + "iconv", + "libkml" + ] } ], - "builtin-baseline": "4f4a1821b2e8c7a2863e4df65a4d514f84144049" + "builtin-baseline": "73794ce5f63fd138fab999a22959ca7c6305d93c" } diff --git a/pyproject.toml b/pyproject.toml index 3ed6f129..53084902 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ build-verbosity = 3 VCPKG_INSTALL = "$VCPKG_INSTALLATION_ROOT/installed/$VCPKG_DEFAULT_TRIPLET" GDAL_INCLUDE_PATH = "$VCPKG_INSTALL/include" GDAL_LIBRARY_PATH = "$VCPKG_INSTALL/lib" -GDAL_VERSION = "3.8.5" +GDAL_VERSION = "3.9.2" PYOGRIO_PACKAGE_DATA = 1 GDAL_DATA = "$VCPKG_INSTALL/share/gdal" PROJ_LIB = "$VCPKG_INSTALL/share/proj" @@ -33,7 +33,7 @@ repair-wheel-command = [ VCPKG_INSTALL = "$VCPKG_INSTALLATION_ROOT/installed/$VCPKG_DEFAULT_TRIPLET" GDAL_INCLUDE_PATH = "$VCPKG_INSTALL/include" GDAL_LIBRARY_PATH = "$VCPKG_INSTALL/lib" -GDAL_VERSION = "3.8.5" +GDAL_VERSION = "3.9.2" PYOGRIO_PACKAGE_DATA = 1 GDAL_DATA = "$VCPKG_INSTALL/share/gdal" PROJ_LIB = "$VCPKG_INSTALL/share/proj" @@ -47,7 +47,7 @@ repair-wheel-command = "delvewheel repair --add-path C:/vcpkg/installed/x64-wind VCPKG_INSTALL = "$VCPKG_INSTALLATION_ROOT/installed/x64-windows-dynamic-release" GDAL_INCLUDE_PATH = "$VCPKG_INSTALL/include" GDAL_LIBRARY_PATH = "$VCPKG_INSTALL/lib" -GDAL_VERSION = "3.8.5" +GDAL_VERSION = "3.9.2" PYOGRIO_PACKAGE_DATA = 1 GDAL_DATA = "$VCPKG_INSTALL/share/gdal" PROJ_LIB = "$VCPKG_INSTALL/share/proj" @@ -144,7 +144,7 @@ ignore = [ # collection-literal-concatenation "RUF005", # Mutable class attributes should be annotated with `typing.ClassVar`, - "RUF012" + "RUF012", ] [tool.ruff.lint.per-file-ignores] @@ -156,15 +156,21 @@ combine-as-imports = true extra-standard-library = ["packaging"] section-order = [ - "future", - "standard-library", - "third-party", - "geo", - "first-party", - "local-folder", - "testing" + "future", + "standard-library", + "third-party", + "geo", + "first-party", + "local-folder", + "testing", ] [tool.ruff.lint.isort.sections] "geo" = ["shapely", "pyproj"] -"testing" = ["pytest", "pandas.testing", "numpy.testing", "geopandas.tests", "geopandas.testing"] +"testing" = [ + "pytest", + "pandas.testing", + "numpy.testing", + "geopandas.tests", + "geopandas.testing", +] From 0613f125219bff0d9d22336ead5439c590c37a5e Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Wed, 28 Aug 2024 19:58:10 -0700 Subject: [PATCH 02/11] Try custom port for minizip 1.2.5.2 to match zlib --- CHANGES.md | 2 +- .../0001-remove-ifndef-NOUNCRYPT.patch | 28 +++++++ .../0002-add-declaration-for-mkdir.patch | 28 +++++++ ci/vcpkg-custom-ports/minizip/CMakeLists.txt | 78 +++++++++++++++++++ ci/vcpkg-custom-ports/minizip/README.md | 8 ++ .../minizip/minizipConfig.cmake.in | 8 ++ ci/vcpkg-custom-ports/minizip/portfile.cmake | 33 ++++++++ ci/vcpkg-custom-ports/minizip/usage | 4 + ci/vcpkg-custom-ports/minizip/vcpkg.json | 19 +++++ 9 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 ci/vcpkg-custom-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch create mode 100644 ci/vcpkg-custom-ports/minizip/0002-add-declaration-for-mkdir.patch create mode 100644 ci/vcpkg-custom-ports/minizip/CMakeLists.txt create mode 100644 ci/vcpkg-custom-ports/minizip/README.md create mode 100644 ci/vcpkg-custom-ports/minizip/minizipConfig.cmake.in create mode 100644 ci/vcpkg-custom-ports/minizip/portfile.cmake create mode 100644 ci/vcpkg-custom-ports/minizip/usage create mode 100644 ci/vcpkg-custom-ports/minizip/vcpkg.json diff --git a/CHANGES.md b/CHANGES.md index e5e7ed65..6162a9d6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,7 +18,7 @@ This also leads to `pyproj` becoming an optional dependency; you will need to install `pyproj` in order to support spatial reference systems (#452). - The GDAL library included in the wheels is updated from 3.8.5 to GDAL 3.9.2 - and includes the LIBKML driver. + and includes the LIBKML driver (#466). ## 0.9.0 (2024-06-17) diff --git a/ci/vcpkg-custom-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch b/ci/vcpkg-custom-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch new file mode 100644 index 00000000..98b8987f --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch @@ -0,0 +1,28 @@ +From a6fd3992d44053a523a67aa16f5ae88fecfb20e1 Mon Sep 17 00:00:00 2001 +From: Nicole Mazzuca +Date: Tue, 22 Sep 2020 14:09:53 -0700 +Subject: [PATCH 1/2] remove `#ifndef NOUNCRYPT` + +enable decrypt support for password-encrypted ZIP files + +--- + contrib/minizip/unzip.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/contrib/minizip/unzip.c b/contrib/minizip/unzip.c +index bcfb941..1895a0f 100644 +--- a/contrib/minizip/unzip.c ++++ b/contrib/minizip/unzip.c +@@ -68,10 +68,6 @@ + #include + #include + +-#ifndef NOUNCRYPT +- #define NOUNCRYPT +-#endif +- + #include "zlib.h" + #include "unzip.h" + +-- +2.24.3 (Apple Git-128) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/0002-add-declaration-for-mkdir.patch b/ci/vcpkg-custom-ports/minizip/0002-add-declaration-for-mkdir.patch new file mode 100644 index 00000000..21f50c09 --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/0002-add-declaration-for-mkdir.patch @@ -0,0 +1,28 @@ +From 6c38b6f544b55f9fc554f0fe22e2cbaddfaed7f8 Mon Sep 17 00:00:00 2001 +From: Nicole Mazzuca +Date: Tue, 22 Sep 2020 14:15:04 -0700 +Subject: [PATCH 2/2] add declaration for mkdir + +It's invalid in C99 to implicitly declare mkdir + +--- + contrib/minizip/miniunz.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/contrib/minizip/miniunz.c b/contrib/minizip/miniunz.c +index 3d65401..5341af2 100644 +--- a/contrib/minizip/miniunz.c ++++ b/contrib/minizip/miniunz.c +@@ -12,6 +12,10 @@ + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + */ + ++#if !defined(_WIN32) ++#include ++#endif ++ + #if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) + #ifndef __USE_FILE_OFFSET64 + #define __USE_FILE_OFFSET64 +-- +2.24.3 (Apple Git-128) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/CMakeLists.txt b/ci/vcpkg-custom-ports/minizip/CMakeLists.txt new file mode 100644 index 00000000..c3cf41c6 --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/CMakeLists.txt @@ -0,0 +1,78 @@ +cmake_minimum_required(VERSION 3.8) +project(minizip VERSION 1.2.13 LANGUAGES C) + +find_package(ZLIB REQUIRED) +set(MIN_SRC contrib/minizip) + +include_directories(${MIN_SRC} ${ZLIB_INCLUDE_DIRS}) + +set(MINIZIP_LIBRARIES ZLIB::ZLIB) + +set(SRC + ${MIN_SRC}/ioapi.c + ${MIN_SRC}/unzip.c + ${MIN_SRC}/zip.c + ${MIN_SRC}/mztools.c +) + +set(HEADERS + ${MIN_SRC}/crypt.h + ${MIN_SRC}/ioapi.h + ${MIN_SRC}/unzip.h + ${MIN_SRC}/zip.h + ${MIN_SRC}/mztools.h +) + +add_library(minizip ${SRC}) + +target_link_libraries(minizip PRIVATE ZLIB::ZLIB) +target_compile_definitions(minizip PRIVATE -D_ZLIB_H) + +if(NOT DISABLE_INSTALL_TOOLS) + add_executable(minizip_bin ${MIN_SRC}/minizip.c) + add_executable(miniunz_bin ${MIN_SRC}/miniunz.c) + + target_link_libraries(minizip_bin minizip ${MINIZIP_LIBRARIES}) + target_link_libraries(miniunz_bin minizip ${MINIZIP_LIBRARIES}) + + set_target_properties(minizip_bin PROPERTIES OUTPUT_NAME minizip) + set_target_properties(miniunz_bin PROPERTIES OUTPUT_NAME miniunz) +endif() + +install( + TARGETS minizip + EXPORT minizipTargets + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +include(CMakePackageConfigHelpers) +write_basic_package_version_file("${PROJECT_BINARY_DIR}/minizipConfigVersion.cmake" + COMPATIBILITY SameMajorVersion) + +configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/minizipConfig.cmake.in + minizipConfig.cmake + INSTALL_DESTINATION share/minizip) + +install(FILES + "${PROJECT_BINARY_DIR}/minizipConfig.cmake" + "${PROJECT_BINARY_DIR}/minizipConfigVersion.cmake" + DESTINATION share/minizip +) + +install(EXPORT minizipTargets + NAMESPACE minizip:: + DESTINATION share/minizip +) + +if(NOT DISABLE_INSTALL_TOOLS) + install( + TARGETS minizip_bin miniunz_bin + RUNTIME DESTINATION tools/minizip + ) +endif() + +if(NOT DISABLE_INSTALL_HEADERS) + install(FILES ${HEADERS} DESTINATION include/minizip) +endif() \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/README.md b/ci/vcpkg-custom-ports/minizip/README.md new file mode 100644 index 00000000..a6bdcc44 --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/README.md @@ -0,0 +1,8 @@ +Port adapted from [minizip 1.2.13#0](https://github.com/microsoft/vcpkg/tree/e0a9559a9b24af116388eae242d675bf9fde025c/ports/minizip). + +Major edits: + +- change version to v1.2.5.2 +- stripped out feature support +- stripped out Windows support +- stripped out Android support and related patch diff --git a/ci/vcpkg-custom-ports/minizip/minizipConfig.cmake.in b/ci/vcpkg-custom-ports/minizip/minizipConfig.cmake.in new file mode 100644 index 00000000..3779d873 --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/minizipConfig.cmake.in @@ -0,0 +1,8 @@ +#@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) + +find_dependency(ZLIB) + +include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +check_required_components("@PROJECT_NAME@") \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/portfile.cmake b/ci/vcpkg-custom-ports/minizip/portfile.cmake new file mode 100644 index 00000000..2b744fa0 --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/portfile.cmake @@ -0,0 +1,33 @@ +# When this port is updated, the minizip port should be updated at the same time + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO madler/zlib + REF v1.2.5.2 + SHA512 8b9a7b27c744d9347da308257ba39eb09bfc012dccfcccc6a6b31aa810f4f88655f028b03358abd610559fbff264c3af5fbb4a079495cbec6c945bbc0c2e504a + HEAD_REF master + PATCHES + 0001-remove-ifndef-NOUNCRYPT.patch + 0002-add-declaration-for-mkdir.patch +) + +configure_file("${CMAKE_CURRENT_LIST_DIR}/minizipConfig.cmake.in" "${SOURCE_PATH}/cmake/minizipConfig.cmake.in" COPYONLY) +configure_file("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" "${SOURCE_PATH}/CMakeLists.txt" COPYONLY) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DDISABLE_INSTALL_TOOLS=${VCPKG_TARGET_IS_IOS} + OPTIONS_DEBUG + -DDISABLE_INSTALL_HEADERS=ON +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup() +vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/minizip") + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/usage b/ci/vcpkg-custom-ports/minizip/usage new file mode 100644 index 00000000..0507c0e8 --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/usage @@ -0,0 +1,4 @@ +minizip provides CMake targets : + + find_package(minizip CONFIG REQUIRED) + target_link_libraries(main PRIVATE minizip::minizip) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/vcpkg.json b/ci/vcpkg-custom-ports/minizip/vcpkg.json new file mode 100644 index 00000000..a32047ad --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "minizip", + "version": "1.2.5.2", + "description": "Zip compression library", + "homepage": "https://github.com/madler/zlib", + "license": "Zlib", + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ] +} From 27c21070a844bddbb167acaed4a98aad566a44c8 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Wed, 28 Aug 2024 20:15:33 -0700 Subject: [PATCH 03/11] Rework on top of minizip 1.3.1#1 port --- ci/vcpkg-custom-ports/minizip/CMakeLists.txt | 96 +++++++++---------- ci/vcpkg-custom-ports/minizip/README.md | 4 +- .../minizip/lib-to-def.cmake | 47 +++++++++ .../minizip/minizipConfig.cmake.in | 8 -- ci/vcpkg-custom-ports/minizip/pkgconfig.patch | 11 +++ ci/vcpkg-custom-ports/minizip/portfile.cmake | 33 +++++-- .../minizip/unofficial-minizipConfig.cmake.in | 7 ++ ci/vcpkg-custom-ports/minizip/usage | 6 +- 8 files changed, 144 insertions(+), 68 deletions(-) create mode 100644 ci/vcpkg-custom-ports/minizip/lib-to-def.cmake delete mode 100644 ci/vcpkg-custom-ports/minizip/minizipConfig.cmake.in create mode 100644 ci/vcpkg-custom-ports/minizip/pkgconfig.patch create mode 100644 ci/vcpkg-custom-ports/minizip/unofficial-minizipConfig.cmake.in diff --git a/ci/vcpkg-custom-ports/minizip/CMakeLists.txt b/ci/vcpkg-custom-ports/minizip/CMakeLists.txt index c3cf41c6..d713d76d 100644 --- a/ci/vcpkg-custom-ports/minizip/CMakeLists.txt +++ b/ci/vcpkg-custom-ports/minizip/CMakeLists.txt @@ -1,78 +1,76 @@ -cmake_minimum_required(VERSION 3.8) -project(minizip VERSION 1.2.13 LANGUAGES C) - -find_package(ZLIB REQUIRED) -set(MIN_SRC contrib/minizip) - -include_directories(${MIN_SRC} ${ZLIB_INCLUDE_DIRS}) - -set(MINIZIP_LIBRARIES ZLIB::ZLIB) +cmake_minimum_required(VERSION 3.25) +project(minizip LANGUAGES C) set(SRC - ${MIN_SRC}/ioapi.c - ${MIN_SRC}/unzip.c - ${MIN_SRC}/zip.c - ${MIN_SRC}/mztools.c + ioapi.c + unzip.c + zip.c + mztools.c ) - set(HEADERS - ${MIN_SRC}/crypt.h - ${MIN_SRC}/ioapi.h - ${MIN_SRC}/unzip.h - ${MIN_SRC}/zip.h - ${MIN_SRC}/mztools.h + crypt.h + ioapi.h + unzip.h + zip.h + mztools.h ) add_library(minizip ${SRC}) +target_include_directories(minizip PUBLIC $) -target_link_libraries(minizip PRIVATE ZLIB::ZLIB) +find_package(ZLIB REQUIRED) target_compile_definitions(minizip PRIVATE -D_ZLIB_H) +target_link_libraries(minizip PUBLIC ZLIB::ZLIB) +set(MINIZIP_REQUIRES zlib) -if(NOT DISABLE_INSTALL_TOOLS) - add_executable(minizip_bin ${MIN_SRC}/minizip.c) - add_executable(miniunz_bin ${MIN_SRC}/miniunz.c) - - target_link_libraries(minizip_bin minizip ${MINIZIP_LIBRARIES}) - target_link_libraries(miniunz_bin minizip ${MINIZIP_LIBRARIES}) - - set_target_properties(minizip_bin PROPERTIES OUTPUT_NAME minizip) - set_target_properties(miniunz_bin PROPERTIES OUTPUT_NAME miniunz) +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + target_compile_definitions(minizip PRIVATE -DIOWIN32_USING_WINRT_API) endif() install( TARGETS minizip - EXPORT minizipTargets + EXPORT unofficial-minizipTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) include(CMakePackageConfigHelpers) -write_basic_package_version_file("${PROJECT_BINARY_DIR}/minizipConfigVersion.cmake" - COMPATIBILITY SameMajorVersion) +write_basic_package_version_file("${PROJECT_BINARY_DIR}/unofficial-minizipConfigVersion.cmake" + VERSION "${PACKAGE_VERSION}" + COMPATIBILITY SameMajorVersion +) -configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/minizipConfig.cmake.in - minizipConfig.cmake - INSTALL_DESTINATION share/minizip) +configure_package_config_file(unofficial-minizipConfig.cmake.in + unofficial-minizipConfig.cmake + INSTALL_DESTINATION share/unofficial-minizip +) install(FILES - "${PROJECT_BINARY_DIR}/minizipConfig.cmake" - "${PROJECT_BINARY_DIR}/minizipConfigVersion.cmake" - DESTINATION share/minizip + "${PROJECT_BINARY_DIR}/unofficial-minizipConfig.cmake" + "${PROJECT_BINARY_DIR}/unofficial-minizipConfigVersion.cmake" + DESTINATION share/unofficial-minizip ) -install(EXPORT minizipTargets - NAMESPACE minizip:: - DESTINATION share/minizip +install(EXPORT unofficial-minizipTargets + NAMESPACE unofficial::minizip:: + DESTINATION share/unofficial-minizip ) -if(NOT DISABLE_INSTALL_TOOLS) - install( - TARGETS minizip_bin miniunz_bin - RUNTIME DESTINATION tools/minizip - ) -endif() - if(NOT DISABLE_INSTALL_HEADERS) install(FILES ${HEADERS} DESTINATION include/minizip) -endif() \ No newline at end of file +endif() + +list(JOIN MINIZIP_REQUIRES " " MINIZIP_REQUIRES) +set(exec_prefix "\${prefix}") +set(libdir "\${prefix}/lib") +set(includedir "\${prefix}/include") +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/minizip.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/minizip.pc" + @ONLY +) +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/minizip.pc" + DESTINATION lib/pkgconfig +) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/README.md b/ci/vcpkg-custom-ports/minizip/README.md index a6bdcc44..b3bab705 100644 --- a/ci/vcpkg-custom-ports/minizip/README.md +++ b/ci/vcpkg-custom-ports/minizip/README.md @@ -1,4 +1,4 @@ -Port adapted from [minizip 1.2.13#0](https://github.com/microsoft/vcpkg/tree/e0a9559a9b24af116388eae242d675bf9fde025c/ports/minizip). +Port adapted from [minizip 1.3.1#1](https://github.com/microsoft/vcpkg/tree/6db51d86a9c2796581d74c9a7eb46e52ee8cb7eb/ports/minizip). Major edits: @@ -6,3 +6,5 @@ Major edits: - stripped out feature support - stripped out Windows support - stripped out Android support and related patch +- stripped out generating symbols in cmake +- stripped out building tools diff --git a/ci/vcpkg-custom-ports/minizip/lib-to-def.cmake b/ci/vcpkg-custom-ports/minizip/lib-to-def.cmake new file mode 100644 index 00000000..6f9d1290 --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/lib-to-def.cmake @@ -0,0 +1,47 @@ +function(lib_to_def) + if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW OR NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") + return() + endif() + + cmake_parse_arguments(PARSE_ARGV 0 arg "" "BASENAME;REGEX" "") + + if(NOT arg_BASENAME) + message(FATAL_ERROR "BASENAME is a required argument.") + endif() + + if(NOT arg_REGEX) + set(arg_REGEX "[^ ]+") + endif() + + set(logfile "${CURRENT_BUILDTREES_DIR}/dumpbin-${arg_BASENAME}-${TARGET_TRIPLET}-symbols.log") + vcpkg_execute_required_process( + COMMAND dumpbin /symbols "/OUT:${logfile}" "${CURRENT_PACKAGES_DIR}/lib/${arg_BASENAME}.lib" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + LOGNAME "dumpbin-${arg_BASENAME}-${TARGET_TRIPLET}" + ) + file(STRINGS "${logfile}" symbols REGEX "^... ........ SECT.. notype .. External [|] ${arg_REGEX}") + list(TRANSFORM symbols REPLACE "^[^|]+[|] " " ") + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + string(REPLACE " _" " " symbols "${symbols}") + endif() + + list(JOIN symbols "\n" symbols) + set(symbols "EXPORTS\n${symbols}\n") + set(def_file "${CMAKE_CURRENT_LIST_DIR}/${arg_BASENAME}-${VCPKG_TARGET_ARCHITECTURE}.def") + + if(NOT EXISTS "${def_file}") + set(def_file "${CMAKE_CURRENT_LIST_DIR}/${arg_BASENAME}-win32.def") + endif() + + if(EXISTS "${def_file}") + file(READ "${def_file}" original_symbols) + else() + set(original_symbols "") + endif() + + if(NOT symbols STREQUAL original_symbols) + file(WRITE "${CURRENT_BUILDTREES_DIR}/${arg_BASENAME}-${VCPKG_TARGET_ARCHITECTURE}.def.log" "${symbols}") + message(SEND_ERROR "${arg_BASENAME}-${VCPKG_TARGET_ARCHITECTURE}.def has changed.") + endif() +endfunction() \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/minizipConfig.cmake.in b/ci/vcpkg-custom-ports/minizip/minizipConfig.cmake.in deleted file mode 100644 index 3779d873..00000000 --- a/ci/vcpkg-custom-ports/minizip/minizipConfig.cmake.in +++ /dev/null @@ -1,8 +0,0 @@ -#@PACKAGE_INIT@ - -include(CMakeFindDependencyMacro) - -find_dependency(ZLIB) - -include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") -check_required_components("@PROJECT_NAME@") \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/pkgconfig.patch b/ci/vcpkg-custom-ports/minizip/pkgconfig.patch new file mode 100644 index 00000000..d3d92559 --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/pkgconfig.patch @@ -0,0 +1,11 @@ +diff --git a/contrib/minizip/minizip.pc.in b/contrib/minizip/minizip.pc.in +index 69b5b7f..9e43084 100644 +--- a/contrib/minizip/minizip.pc.in ++++ b/contrib/minizip/minizip.pc.in +@@ -8,5 +8,5 @@ Description: Minizip zip file manipulation library + Requires: + Version: @PACKAGE_VERSION@ + Libs: -L${libdir} -lminizip +-Libs.private: -lz ++Requires.private: @MINIZIP_REQUIRES@ + Cflags: -I${includedir} \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/portfile.cmake b/ci/vcpkg-custom-ports/minizip/portfile.cmake index 2b744fa0..00bcc187 100644 --- a/ci/vcpkg-custom-ports/minizip/portfile.cmake +++ b/ci/vcpkg-custom-ports/minizip/portfile.cmake @@ -11,23 +11,42 @@ vcpkg_from_github( PATCHES 0001-remove-ifndef-NOUNCRYPT.patch 0002-add-declaration-for-mkdir.patch + pkgconfig.patch ) -configure_file("${CMAKE_CURRENT_LIST_DIR}/minizipConfig.cmake.in" "${SOURCE_PATH}/cmake/minizipConfig.cmake.in" COPYONLY) -configure_file("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" "${SOURCE_PATH}/CMakeLists.txt" COPYONLY) +# When zlib updated, the minizip port should be updated at the same time +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO madler/zlib + REF v1.2.5.2 + SHA512 8b9a7b27c744d9347da308257ba39eb09bfc012dccfcccc6a6b31aa810f4f88655f028b03358abd610559fbff264c3af5fbb4a079495cbec6c945bbc0c2e504a + HEAD_REF master + PATCHES + 0001-remove-ifndef-NOUNCRYPT.patch + 0002-add-declaration-for-mkdir.patch +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" + "${CMAKE_CURRENT_LIST_DIR}/minizip-win32.def" + "${CMAKE_CURRENT_LIST_DIR}/unofficial-minizipConfig.cmake.in" + DESTINATION "${SOURCE_PATH}/contrib/minizip" +) vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" + SOURCE_PATH "${SOURCE_PATH}/contrib/minizip" OPTIONS - -DDISABLE_INSTALL_TOOLS=${VCPKG_TARGET_IS_IOS} + ${FEATURE_OPTIONS} + -DPACKAGE_VERSION=${VERSION} OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON + -DDISABLE_INSTALL_TOOLS=ON ) vcpkg_cmake_install() vcpkg_copy_pdbs() -vcpkg_cmake_config_fixup() -vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/minizip") +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-minizip) +vcpkg_fixup_pkgconfig() +configure_file("${CMAKE_CURRENT_LIST_DIR}/minizipConfig.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/minizipConfig.cmake" @ONLY) file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -file(INSTALL "${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) \ No newline at end of file +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt") diff --git a/ci/vcpkg-custom-ports/minizip/unofficial-minizipConfig.cmake.in b/ci/vcpkg-custom-ports/minizip/unofficial-minizipConfig.cmake.in new file mode 100644 index 00000000..bd74dc7d --- /dev/null +++ b/ci/vcpkg-custom-ports/minizip/unofficial-minizipConfig.cmake.in @@ -0,0 +1,7 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +find_dependency(ZLIB) + +include("${CMAKE_CURRENT_LIST_DIR}/unofficial-minizipTargets.cmake") +check_required_components(unofficial-minizip) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/usage b/ci/vcpkg-custom-ports/minizip/usage index 0507c0e8..b2d5ef45 100644 --- a/ci/vcpkg-custom-ports/minizip/usage +++ b/ci/vcpkg-custom-ports/minizip/usage @@ -1,4 +1,4 @@ -minizip provides CMake targets : +minizip provides CMake targets: - find_package(minizip CONFIG REQUIRED) - target_link_libraries(main PRIVATE minizip::minizip) \ No newline at end of file + find_package(unofficial-minizip CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::minizip::minizip) \ No newline at end of file From d4dd204d252c3aa6c09ea90cad9c8281141997cc Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Wed, 28 Aug 2024 20:27:00 -0700 Subject: [PATCH 04/11] Strip out likely unused patch --- ci/vcpkg-custom-ports/minizip/pkgconfig.patch | 11 ----------- ci/vcpkg-custom-ports/minizip/portfile.cmake | 1 - 2 files changed, 12 deletions(-) delete mode 100644 ci/vcpkg-custom-ports/minizip/pkgconfig.patch diff --git a/ci/vcpkg-custom-ports/minizip/pkgconfig.patch b/ci/vcpkg-custom-ports/minizip/pkgconfig.patch deleted file mode 100644 index d3d92559..00000000 --- a/ci/vcpkg-custom-ports/minizip/pkgconfig.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/contrib/minizip/minizip.pc.in b/contrib/minizip/minizip.pc.in -index 69b5b7f..9e43084 100644 ---- a/contrib/minizip/minizip.pc.in -+++ b/contrib/minizip/minizip.pc.in -@@ -8,5 +8,5 @@ Description: Minizip zip file manipulation library - Requires: - Version: @PACKAGE_VERSION@ - Libs: -L${libdir} -lminizip --Libs.private: -lz -+Requires.private: @MINIZIP_REQUIRES@ - Cflags: -I${includedir} \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/portfile.cmake b/ci/vcpkg-custom-ports/minizip/portfile.cmake index 00bcc187..4278e9ce 100644 --- a/ci/vcpkg-custom-ports/minizip/portfile.cmake +++ b/ci/vcpkg-custom-ports/minizip/portfile.cmake @@ -11,7 +11,6 @@ vcpkg_from_github( PATCHES 0001-remove-ifndef-NOUNCRYPT.patch 0002-add-declaration-for-mkdir.patch - pkgconfig.patch ) # When zlib updated, the minizip port should be updated at the same time From cb007fb5a00dfa2694f08a79529dd97f227576fb Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Thu, 29 Aug 2024 11:04:05 -0700 Subject: [PATCH 05/11] Drop attempt to build libkml on manylinux2014 --- CHANGES.md | 3 +- .../0001-remove-ifndef-NOUNCRYPT.patch | 28 ------- .../0002-add-declaration-for-mkdir.patch | 28 ------- ci/vcpkg-custom-ports/minizip/CMakeLists.txt | 76 ------------------- ci/vcpkg-custom-ports/minizip/README.md | 10 --- .../minizip/lib-to-def.cmake | 47 ------------ ci/vcpkg-custom-ports/minizip/portfile.cmake | 51 ------------- .../minizip/unofficial-minizipConfig.cmake.in | 7 -- ci/vcpkg-custom-ports/minizip/usage | 4 - ci/vcpkg-custom-ports/minizip/vcpkg.json | 19 ----- ci/vcpkg.json | 8 +- 11 files changed, 2 insertions(+), 279 deletions(-) delete mode 100644 ci/vcpkg-custom-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch delete mode 100644 ci/vcpkg-custom-ports/minizip/0002-add-declaration-for-mkdir.patch delete mode 100644 ci/vcpkg-custom-ports/minizip/CMakeLists.txt delete mode 100644 ci/vcpkg-custom-ports/minizip/README.md delete mode 100644 ci/vcpkg-custom-ports/minizip/lib-to-def.cmake delete mode 100644 ci/vcpkg-custom-ports/minizip/portfile.cmake delete mode 100644 ci/vcpkg-custom-ports/minizip/unofficial-minizipConfig.cmake.in delete mode 100644 ci/vcpkg-custom-ports/minizip/usage delete mode 100644 ci/vcpkg-custom-ports/minizip/vcpkg.json diff --git a/CHANGES.md b/CHANGES.md index 6162a9d6..242cf518 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,8 +17,7 @@ packages if needed: more info [here](https://gdal.org/download.html#conda). This also leads to `pyproj` becoming an optional dependency; you will need to install `pyproj` in order to support spatial reference systems (#452). -- The GDAL library included in the wheels is updated from 3.8.5 to GDAL 3.9.2 - and includes the LIBKML driver (#466). +- The GDAL library included in the wheels is updated from 3.8.5 to GDAL 3.9.2 (#466). ## 0.9.0 (2024-06-17) diff --git a/ci/vcpkg-custom-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch b/ci/vcpkg-custom-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch deleted file mode 100644 index 98b8987f..00000000 --- a/ci/vcpkg-custom-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a6fd3992d44053a523a67aa16f5ae88fecfb20e1 Mon Sep 17 00:00:00 2001 -From: Nicole Mazzuca -Date: Tue, 22 Sep 2020 14:09:53 -0700 -Subject: [PATCH 1/2] remove `#ifndef NOUNCRYPT` - -enable decrypt support for password-encrypted ZIP files - ---- - contrib/minizip/unzip.c | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/contrib/minizip/unzip.c b/contrib/minizip/unzip.c -index bcfb941..1895a0f 100644 ---- a/contrib/minizip/unzip.c -+++ b/contrib/minizip/unzip.c -@@ -68,10 +68,6 @@ - #include - #include - --#ifndef NOUNCRYPT -- #define NOUNCRYPT --#endif -- - #include "zlib.h" - #include "unzip.h" - --- -2.24.3 (Apple Git-128) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/0002-add-declaration-for-mkdir.patch b/ci/vcpkg-custom-ports/minizip/0002-add-declaration-for-mkdir.patch deleted file mode 100644 index 21f50c09..00000000 --- a/ci/vcpkg-custom-ports/minizip/0002-add-declaration-for-mkdir.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 6c38b6f544b55f9fc554f0fe22e2cbaddfaed7f8 Mon Sep 17 00:00:00 2001 -From: Nicole Mazzuca -Date: Tue, 22 Sep 2020 14:15:04 -0700 -Subject: [PATCH 2/2] add declaration for mkdir - -It's invalid in C99 to implicitly declare mkdir - ---- - contrib/minizip/miniunz.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/contrib/minizip/miniunz.c b/contrib/minizip/miniunz.c -index 3d65401..5341af2 100644 ---- a/contrib/minizip/miniunz.c -+++ b/contrib/minizip/miniunz.c -@@ -12,6 +12,10 @@ - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - */ - -+#if !defined(_WIN32) -+#include -+#endif -+ - #if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) - #ifndef __USE_FILE_OFFSET64 - #define __USE_FILE_OFFSET64 --- -2.24.3 (Apple Git-128) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/CMakeLists.txt b/ci/vcpkg-custom-ports/minizip/CMakeLists.txt deleted file mode 100644 index d713d76d..00000000 --- a/ci/vcpkg-custom-ports/minizip/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -cmake_minimum_required(VERSION 3.25) -project(minizip LANGUAGES C) - -set(SRC - ioapi.c - unzip.c - zip.c - mztools.c -) -set(HEADERS - crypt.h - ioapi.h - unzip.h - zip.h - mztools.h -) - -add_library(minizip ${SRC}) -target_include_directories(minizip PUBLIC $) - -find_package(ZLIB REQUIRED) -target_compile_definitions(minizip PRIVATE -D_ZLIB_H) -target_link_libraries(minizip PUBLIC ZLIB::ZLIB) -set(MINIZIP_REQUIRES zlib) - -if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - target_compile_definitions(minizip PRIVATE -DIOWIN32_USING_WINRT_API) -endif() - -install( - TARGETS minizip - EXPORT unofficial-minizipTargets - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) - -include(CMakePackageConfigHelpers) -write_basic_package_version_file("${PROJECT_BINARY_DIR}/unofficial-minizipConfigVersion.cmake" - VERSION "${PACKAGE_VERSION}" - COMPATIBILITY SameMajorVersion -) - -configure_package_config_file(unofficial-minizipConfig.cmake.in - unofficial-minizipConfig.cmake - INSTALL_DESTINATION share/unofficial-minizip -) - -install(FILES - "${PROJECT_BINARY_DIR}/unofficial-minizipConfig.cmake" - "${PROJECT_BINARY_DIR}/unofficial-minizipConfigVersion.cmake" - DESTINATION share/unofficial-minizip -) - -install(EXPORT unofficial-minizipTargets - NAMESPACE unofficial::minizip:: - DESTINATION share/unofficial-minizip -) - -if(NOT DISABLE_INSTALL_HEADERS) - install(FILES ${HEADERS} DESTINATION include/minizip) -endif() - -list(JOIN MINIZIP_REQUIRES " " MINIZIP_REQUIRES) -set(exec_prefix "\${prefix}") -set(libdir "\${prefix}/lib") -set(includedir "\${prefix}/include") -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/minizip.pc.in" - "${CMAKE_CURRENT_BINARY_DIR}/minizip.pc" - @ONLY -) -install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/minizip.pc" - DESTINATION lib/pkgconfig -) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/README.md b/ci/vcpkg-custom-ports/minizip/README.md deleted file mode 100644 index b3bab705..00000000 --- a/ci/vcpkg-custom-ports/minizip/README.md +++ /dev/null @@ -1,10 +0,0 @@ -Port adapted from [minizip 1.3.1#1](https://github.com/microsoft/vcpkg/tree/6db51d86a9c2796581d74c9a7eb46e52ee8cb7eb/ports/minizip). - -Major edits: - -- change version to v1.2.5.2 -- stripped out feature support -- stripped out Windows support -- stripped out Android support and related patch -- stripped out generating symbols in cmake -- stripped out building tools diff --git a/ci/vcpkg-custom-ports/minizip/lib-to-def.cmake b/ci/vcpkg-custom-ports/minizip/lib-to-def.cmake deleted file mode 100644 index 6f9d1290..00000000 --- a/ci/vcpkg-custom-ports/minizip/lib-to-def.cmake +++ /dev/null @@ -1,47 +0,0 @@ -function(lib_to_def) - if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW OR NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") - return() - endif() - - cmake_parse_arguments(PARSE_ARGV 0 arg "" "BASENAME;REGEX" "") - - if(NOT arg_BASENAME) - message(FATAL_ERROR "BASENAME is a required argument.") - endif() - - if(NOT arg_REGEX) - set(arg_REGEX "[^ ]+") - endif() - - set(logfile "${CURRENT_BUILDTREES_DIR}/dumpbin-${arg_BASENAME}-${TARGET_TRIPLET}-symbols.log") - vcpkg_execute_required_process( - COMMAND dumpbin /symbols "/OUT:${logfile}" "${CURRENT_PACKAGES_DIR}/lib/${arg_BASENAME}.lib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" - LOGNAME "dumpbin-${arg_BASENAME}-${TARGET_TRIPLET}" - ) - file(STRINGS "${logfile}" symbols REGEX "^... ........ SECT.. notype .. External [|] ${arg_REGEX}") - list(TRANSFORM symbols REPLACE "^[^|]+[|] " " ") - - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - string(REPLACE " _" " " symbols "${symbols}") - endif() - - list(JOIN symbols "\n" symbols) - set(symbols "EXPORTS\n${symbols}\n") - set(def_file "${CMAKE_CURRENT_LIST_DIR}/${arg_BASENAME}-${VCPKG_TARGET_ARCHITECTURE}.def") - - if(NOT EXISTS "${def_file}") - set(def_file "${CMAKE_CURRENT_LIST_DIR}/${arg_BASENAME}-win32.def") - endif() - - if(EXISTS "${def_file}") - file(READ "${def_file}" original_symbols) - else() - set(original_symbols "") - endif() - - if(NOT symbols STREQUAL original_symbols) - file(WRITE "${CURRENT_BUILDTREES_DIR}/${arg_BASENAME}-${VCPKG_TARGET_ARCHITECTURE}.def.log" "${symbols}") - message(SEND_ERROR "${arg_BASENAME}-${VCPKG_TARGET_ARCHITECTURE}.def has changed.") - endif() -endfunction() \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/portfile.cmake b/ci/vcpkg-custom-ports/minizip/portfile.cmake deleted file mode 100644 index 4278e9ce..00000000 --- a/ci/vcpkg-custom-ports/minizip/portfile.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# When this port is updated, the minizip port should be updated at the same time - -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO madler/zlib - REF v1.2.5.2 - SHA512 8b9a7b27c744d9347da308257ba39eb09bfc012dccfcccc6a6b31aa810f4f88655f028b03358abd610559fbff264c3af5fbb4a079495cbec6c945bbc0c2e504a - HEAD_REF master - PATCHES - 0001-remove-ifndef-NOUNCRYPT.patch - 0002-add-declaration-for-mkdir.patch -) - -# When zlib updated, the minizip port should be updated at the same time -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO madler/zlib - REF v1.2.5.2 - SHA512 8b9a7b27c744d9347da308257ba39eb09bfc012dccfcccc6a6b31aa810f4f88655f028b03358abd610559fbff264c3af5fbb4a079495cbec6c945bbc0c2e504a - HEAD_REF master - PATCHES - 0001-remove-ifndef-NOUNCRYPT.patch - 0002-add-declaration-for-mkdir.patch -) - -file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" - "${CMAKE_CURRENT_LIST_DIR}/minizip-win32.def" - "${CMAKE_CURRENT_LIST_DIR}/unofficial-minizipConfig.cmake.in" - DESTINATION "${SOURCE_PATH}/contrib/minizip" -) - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}/contrib/minizip" - OPTIONS - ${FEATURE_OPTIONS} - -DPACKAGE_VERSION=${VERSION} - OPTIONS_DEBUG - -DDISABLE_INSTALL_HEADERS=ON - -DDISABLE_INSTALL_TOOLS=ON -) - -vcpkg_cmake_install() -vcpkg_copy_pdbs() -vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-minizip) -vcpkg_fixup_pkgconfig() - -configure_file("${CMAKE_CURRENT_LIST_DIR}/minizipConfig.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/minizipConfig.cmake" @ONLY) -file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt") diff --git a/ci/vcpkg-custom-ports/minizip/unofficial-minizipConfig.cmake.in b/ci/vcpkg-custom-ports/minizip/unofficial-minizipConfig.cmake.in deleted file mode 100644 index bd74dc7d..00000000 --- a/ci/vcpkg-custom-ports/minizip/unofficial-minizipConfig.cmake.in +++ /dev/null @@ -1,7 +0,0 @@ -@PACKAGE_INIT@ - -include(CMakeFindDependencyMacro) -find_dependency(ZLIB) - -include("${CMAKE_CURRENT_LIST_DIR}/unofficial-minizipTargets.cmake") -check_required_components(unofficial-minizip) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/usage b/ci/vcpkg-custom-ports/minizip/usage deleted file mode 100644 index b2d5ef45..00000000 --- a/ci/vcpkg-custom-ports/minizip/usage +++ /dev/null @@ -1,4 +0,0 @@ -minizip provides CMake targets: - - find_package(unofficial-minizip CONFIG REQUIRED) - target_link_libraries(main PRIVATE unofficial::minizip::minizip) \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/minizip/vcpkg.json b/ci/vcpkg-custom-ports/minizip/vcpkg.json deleted file mode 100644 index a32047ad..00000000 --- a/ci/vcpkg-custom-ports/minizip/vcpkg.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "minizip", - "version": "1.2.5.2", - "description": "Zip compression library", - "homepage": "https://github.com/madler/zlib", - "license": "Zlib", - "supports": "!uwp", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - }, - "zlib" - ] -} diff --git a/ci/vcpkg.json b/ci/vcpkg.json index 9fc30fbc..ea331f18 100644 --- a/ci/vcpkg.json +++ b/ci/vcpkg.json @@ -5,13 +5,7 @@ { "name": "gdal", "default-features": false, - "features": [ - "recommended-features", - "curl", - "geos", - "iconv", - "libkml" - ] + "features": ["recommended-features", "curl", "geos", "iconv"] } ], "builtin-baseline": "73794ce5f63fd138fab999a22959ca7c6305d93c" From 4bdc4c78d7d3fc7b0136dec33079a0326c93dbec Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Thu, 29 Aug 2024 15:23:06 -0700 Subject: [PATCH 06/11] Add build with manylinux_2_28_x86_64 and stop using port of zlib for manylinux_2_28 --- .github/workflows/release.yml | 21 +++++++++-- ...nylinux_2_28_aarch64-vcpkg-gdal.Dockerfile | 2 - ...anylinux_2_28_x86_64-vcpkg-gdal.Dockerfile | 37 +++++++++++++++++++ 3 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06c665ed..51c5a295 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -97,6 +97,17 @@ jobs: build-wheels-linux: name: Build wheels on Linux runs-on: "ubuntu-latest" + strategy: + fail-fast: false + matrix: + include: + # use manylinux2014 for older glibc platforms until discontinued + - wheel_name: "pyogrio-wheel-linux-manylinux2014_x86_64" + container: "ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile" + + # use manylinux_2_28 for any platforms with glibc>=2.28 + - wheel_name: "pyogrio-wheel-linux-manylinux_2_28_x86_64" + container: "ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile" steps: - name: Checkout @@ -116,7 +127,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile + file: ${{ matrix.container }} tags: manylinux-vcpkg-gdal:latest push: false load: true @@ -130,7 +141,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: pyogrio-wheel-linux + name: ${{ matrix.wheel_name }} path: ./wheelhouse/*.whl compression-level: 0 @@ -239,9 +250,11 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] include: - os: "ubuntu-latest" - artifact: pyogrio-wheel-linux + artifact: pyogrio-wheel-linux-manylinux2014_x86_64 + - os: "ubuntu-latest" + artifact: pyogrio-wheel-linux-manylinux_2_28_x86_64 - os: "ubuntu-20.04" - artifact: pyogrio-wheel-linux + artifact: pyogrio-wheel-linux-manylinux_2_28_x86_64 - os: "windows-latest" artifact: pyogrio-wheel-x64-windows-dynamic-release - os: "macos-12" diff --git a/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile b/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile index 1f2c8a92..174b37a1 100644 --- a/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile @@ -24,7 +24,6 @@ RUN bootstrap-vcpkg.sh && \ vcpkg integrate bash COPY ci/custom-triplets/arm64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/arm64-linux-dynamic-release.cmake -COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/ COPY ci/vcpkg.json opt/vcpkg/ # temporary workaround for https://github.com/microsoft/vcpkg/issues/36094 @@ -33,7 +32,6 @@ RUN git -C /opt/vcpkg apply vcpkg_linux_crosscompiling.patch ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/arm64-linux-dynamic-release/lib" RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ - --overlay-ports=opt/vcpkg/custom-ports \ --feature-flags="versions,manifests" \ --x-manifest-root=opt/vcpkg \ --x-install-root=opt/vcpkg/installed && \ diff --git a/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile new file mode 100644 index 00000000..c653900e --- /dev/null +++ b/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile @@ -0,0 +1,37 @@ +FROM quay.io/pypa/manylinux_2_28_x86_64:2024-08-12-7fde9b1 + +# building openssl needs IPC-Cmd (https://github.com/microsoft/vcpkg/issues/24988) +RUN dnf -y install curl zip unzip tar ninja-build perl-IPC-Cmd + +RUN git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg && \ + git -C /opt/vcpkg checkout 73794ce5f63fd138fab999a22959ca7c6305d93c + +ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg" +ENV PATH="${PATH}:/opt/vcpkg" + +ENV VCPKG_DEFAULT_TRIPLET="x64-linux-dynamic-release" + +# mkdir & touch -> workaround for https://github.com/microsoft/vcpkg/issues/27786 +RUN bootstrap-vcpkg.sh && \ + mkdir -p /root/.vcpkg/ $HOME/.vcpkg && \ + touch /root/.vcpkg/vcpkg.path.txt $HOME/.vcpkg/vcpkg.path.txt && \ + vcpkg integrate install && \ + vcpkg integrate bash + +COPY ci/custom-triplets/x64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake +COPY ci/vcpkg.json opt/vcpkg/ + +# temporary workaround for https://github.com/microsoft/vcpkg/issues/36094 +COPY ci/vcpkg_linux_crosscompiling.patch opt/vcpkg/ +RUN git -C /opt/vcpkg apply vcpkg_linux_crosscompiling.patch + +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib" +RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ + --feature-flags="versions,manifests" \ + --x-manifest-root=opt/vcpkg \ + --x-install-root=opt/vcpkg/installed && \ + vcpkg list + +# setting git safe directory is required for properly building wheels when +# git >= 2.35.3 +RUN git config --global --add safe.directory "*" From 376e8c56179d7023b3dd38dc066a119aeb88f2e4 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Thu, 29 Aug 2024 15:37:27 -0700 Subject: [PATCH 07/11] Remove unused patch --- ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile index c653900e..6a6ef05c 100644 --- a/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux_2_28_x86_64-vcpkg-gdal.Dockerfile @@ -21,10 +21,6 @@ RUN bootstrap-vcpkg.sh && \ COPY ci/custom-triplets/x64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic-release.cmake COPY ci/vcpkg.json opt/vcpkg/ -# temporary workaround for https://github.com/microsoft/vcpkg/issues/36094 -COPY ci/vcpkg_linux_crosscompiling.patch opt/vcpkg/ -RUN git -C /opt/vcpkg apply vcpkg_linux_crosscompiling.patch - ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic-release/lib" RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \ --feature-flags="versions,manifests" \ From 2b886fad0b597b2321ad83666880812840f9273e Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Mon, 2 Sep 2024 15:52:51 -0700 Subject: [PATCH 08/11] Try enabling cache of deps, uv run python --- .github/workflows/release.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51c5a295..a7960151 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,8 +82,8 @@ jobs: shell: bash run: | uv pip install --no-cache wheelhouse/*.tar.gz - uv pip install --no-cache pytest pandas pyproj shapely>=2 - uv pip install --no-cache --no-deps geopandas + uv pip install pytest pandas pyproj shapely>=2 + uv pip install --no-deps geopandas uv pip list - name: Run tests @@ -91,8 +91,10 @@ jobs: # virtual environment is automatically activated run: | cd .. - python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" - python -m pytest --pyargs pyogrio.tests -v + # python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" + # python -m pytest --pyargs pyogrio.tests -v + uv run python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" + uv run python -m pytest --pyargs pyogrio.tests -v build-wheels-linux: name: Build wheels on Linux @@ -302,9 +304,9 @@ jobs: - name: Install dependencies and pyogrio wheel shell: bash run: | - uv pip install --no-cache -r ci/requirements-wheel-test.txt + uv pip install -r ci/requirements-wheel-test.txt if [ ${{ matrix.python-version }} != "3.12" ]; then - uv pip install --no-cache --no-deps geopandas + uv pip install geopandas fi uv pip install --no-cache --pre --no-index --find-links wheelhouse pyogrio uv pip list From ad2b5b9ef12cdfe0576292fa3bacca3beed7cc5c Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Mon, 2 Sep 2024 16:37:29 -0700 Subject: [PATCH 09/11] Try without env vars --- .github/workflows/release.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7960151..b3daf830 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,15 +62,11 @@ jobs: apt-get update && apt-get install -y build-essential python3-dev - name: Create virtual environment - # install uv and use it to create a virtual environment, then add it to - # environment variables so that it is automatically activated and can be - # used for tests below + # install uv and use it to create a virtual environment run: | curl -LsSf https://astral.sh/uv/install.sh | sh . $HOME/.cargo/env uv venv .venv - echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV - echo "$PWD/.venv/bin" >> $GITHUB_PATH - name: Download sdist from artifacts uses: actions/download-artifact@v4 @@ -88,11 +84,8 @@ jobs: - name: Run tests shell: bash - # virtual environment is automatically activated run: | cd .. - # python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" - # python -m pytest --pyargs pyogrio.tests -v uv run python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" uv run python -m pytest --pyargs pyogrio.tests -v From 5922cbbe80eb99d6affde2c015e1b058da541868 Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Tue, 3 Sep 2024 10:02:06 -0700 Subject: [PATCH 10/11] Use uv run elsewhere, add back env vars --- .github/workflows/release.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3daf830..ce0ff96e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,11 +62,15 @@ jobs: apt-get update && apt-get install -y build-essential python3-dev - name: Create virtual environment - # install uv and use it to create a virtual environment + # install uv and use it to create a virtual environment, then add it to + # environment variables so that it is automatically activated and can be + # used for tests below run: | curl -LsSf https://astral.sh/uv/install.sh | sh . $HOME/.cargo/env uv venv .venv + echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV + echo "$PWD/.venv/bin" >> $GITHUB_PATH - name: Download sdist from artifacts uses: actions/download-artifact@v4 @@ -84,6 +88,7 @@ jobs: - name: Run tests shell: bash + # virtual environment is automatically activated run: | cd .. uv run python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" @@ -309,8 +314,8 @@ jobs: # virtual environment is automatically activated run: | cd .. - python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" - python -m pytest --pyargs pyogrio.tests -v + uv run python -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')" + uv run python -m pytest --pyargs pyogrio.tests -v publish: name: Publish pyogrio to GitHub / PyPI From 87b9020e62c556c587f179e43c6f01139271194c Mon Sep 17 00:00:00 2001 From: "Brendan C. Ward" Date: Wed, 4 Sep 2024 09:28:00 -0700 Subject: [PATCH 11/11] Fix install order and prevent geopandas from installing deps --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce0ff96e..56324590 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -303,10 +303,10 @@ jobs: shell: bash run: | uv pip install -r ci/requirements-wheel-test.txt + uv pip install --no-cache --pre --no-index --find-links wheelhouse pyogrio if [ ${{ matrix.python-version }} != "3.12" ]; then - uv pip install geopandas + uv pip install --no-deps geopandas fi - uv pip install --no-cache --pre --no-index --find-links wheelhouse pyogrio uv pip list - name: Run tests