diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f6314db3..c6c9095b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,15 +13,20 @@ concurrency: jobs: build: - name: build (windows) - runs-on: windows-2022 permissions: contents: read packages: write strategy: matrix: include: - - triplet: 'x64-windows' + - os: windows-2022 + triplet: x64-windows + arch: amd64 + - os: windows-11-arm + triplet: arm64-windows + arch: arm64 + name: build (${{ matrix.os }}) + runs-on: ${{ matrix.os }} steps: - name: 🐣 Checkout @@ -32,6 +37,8 @@ jobs: - name: 🧽 Developer Command Prompt for Microsoft Visual C++ uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} - name: 🐕 Checkout vcpkg uses: actions/checkout@v6 @@ -46,16 +53,15 @@ jobs: run: | PKG_SOURCE_USER=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 1) ./vcpkg/bootstrap-vcpkg.sh - NUGET_EXE=$(./vcpkg/vcpkg fetch nuget) + NUGET_EXE=$(./vcpkg/vcpkg fetch nuget | tail -1) echo "Downloaded $NUGET_EXE" $NUGET_EXE sources add -Name ghpkg -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json" -UserName "$PKG_SOURCE_USER" -Password "${{ secrets.GITHUB_TOKEN }}" -StorePasswordInClearText $NUGET_EXE setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json" - echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json,readwrite" >> $GITHUB_ENV + echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/$PKG_SOURCE_USER/index.json,readwrite;nugettimeout,3600" >> $GITHUB_ENV VCPKG_ROOT=$(cygpath -w $(pwd)/vcpkg) echo "$VCPKG_ROOT" >> $GITHUB_PATH echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV - - name: 🌋 Build shell: bash run: | @@ -92,12 +98,22 @@ jobs: # ./vcpkg/vcpkg.exe install $VCPKG_OPTIONS py-jsonschema ./vcpkg/vcpkg.exe install $VCPKG_OPTIONS py-networkx ./vcpkg/vcpkg.exe install $VCPKG_OPTIONS py-pyproj - ./vcpkg/vcpkg.exe install $VCPKG_OPTIONS py-scipy ./vcpkg/vcpkg.exe install $VCPKG_OPTIONS py-matplotlib - ./vcpkg/vcpkg.exe install $VCPKG_OPTIONS 'arrow[acero,compute,core,csv,dataset,example,filesystem,flight,flightsql,gcs,json,mimalloc,orc,parquet,s3,python]' # py-pydantic fails with ERROR: truststore not available + - name: 🌋 Build + shell: bash + if: matrix.triplet == 'x64-windows' + run: | + VCPKG_OPTIONS="--overlay-ports=${{ github.workspace }}/ports --triplet=${{ matrix.triplet }} --x-buildtrees-root=C:/vcpkg-build" + + # lapack problems on arm64 + ./vcpkg/vcpkg.exe install $VCPKG_OPTIONS py-scipy + + # python executable is not properly propagated into the build system + ./vcpkg/vcpkg.exe install $VCPKG_OPTIONS 'arrow[acero,compute,core,csv,dataset,example,filesystem,flight,flightsql,gcs,json,mimalloc,orc,parquet,s3,python]' + - name: 📑 Upload logs uses: actions/upload-artifact@v7 if: failure() diff --git a/ports/py-cython/portfile.cmake b/ports/py-cython/portfile.cmake index 36d21a59..6722995e 100644 --- a/ports/py-cython/portfile.cmake +++ b/ports/py-cython/portfile.cmake @@ -6,6 +6,11 @@ vcpkg_from_github( HEAD_REF main ) +# Disable optimizations to fix ARM64 build +if(MSVC) + set(ENV{_LINK_} "/LTCG:OFF") +endif() + vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}") vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/ports/py-cython/vcpkg.json b/ports/py-cython/vcpkg.json index a1aabec3..4d97be48 100644 --- a/ports/py-cython/vcpkg.json +++ b/ports/py-cython/vcpkg.json @@ -1,6 +1,7 @@ { "name": "py-cython", "version": "3.2.4", + "port-version": 1, "description": "Cython is a Python compiler that makes writing C extensions for Python as easy as Python itself. Cython is based on Pyrex, but supports more cutting edge functionality and optimizations.", "homepage": "https://cython.org/", "license": "Apache-2.0", diff --git a/ports/py-numpy/portfile.cmake b/ports/py-numpy/portfile.cmake index 6abf3329..4367e775 100644 --- a/ports/py-numpy/portfile.cmake +++ b/ports/py-numpy/portfile.cmake @@ -103,6 +103,13 @@ vcpkg_mesonpy_prepare_build_options( z_vcpkg_setup_pkgconfig_path(CONFIG "RELEASE") +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm") + # On windows-arm64, import tests fail. numpy.random.mtrand.__all__ has a + # ' + 1) instead' entry. The bug does not reproduce at /O1 or + # higher. + set(ENV{CL} "/O2 $ENV{CL}") +endif() + list(APPEND meson_opts "--python.platlibdir" "${CURRENT_INSTALLED_DIR}/${PYTHON3_SITE}" diff --git a/ports/py-numpy/vcpkg.json b/ports/py-numpy/vcpkg.json index 5f7a7416..6349ed8f 100644 --- a/ports/py-numpy/vcpkg.json +++ b/ports/py-numpy/vcpkg.json @@ -1,6 +1,7 @@ { "name": "py-numpy", "version": "2.4.4", + "port-version": 1, "description": "The fundamental package for scientific computing with Python.", "homepage": "https://www.numpy.org/", "license": "BSD-3-Clause", diff --git a/ports/py-scikit-build/vcpkg.json b/ports/py-scikit-build/vcpkg.json index 41eb8f2e..c87bfe5a 100644 --- a/ports/py-scikit-build/vcpkg.json +++ b/ports/py-scikit-build/vcpkg.json @@ -1,6 +1,7 @@ { "name": "py-scikit-build", "version": "0.19.0", + "port-version": 1, "description": "Improved build system generator for Python C/C++/Fortran/Cython extensions", "homepage": "https://github.com/scikit-build/scikit-build", "dependencies": [ @@ -8,6 +9,10 @@ "name": "py-hatch-fancy-pypi-readme", "host": true }, + { + "name": "py-hatch-vcs", + "host": true + }, { "name": "py-setuptools", "host": true diff --git a/ports/pybind11/android.diff b/ports/pybind11/android.diff new file mode 100644 index 00000000..1067ff4f --- /dev/null +++ b/ports/pybind11/android.diff @@ -0,0 +1,16 @@ +diff --git a/tools/pybind11NewTools.cmake b/tools/pybind11NewTools.cmake +index e881ca7..c012e2d 100644 +--- a/tools/pybind11NewTools.cmake ++++ b/tools/pybind11NewTools.cmake +@@ -248,10 +248,7 @@ if(TARGET ${_Python}::Module) + # files. + get_target_property(module_target_type ${_Python}::Module TYPE) + if(ANDROID AND module_target_type STREQUAL INTERFACE_LIBRARY) +- set_property( +- TARGET ${_Python}::Module +- APPEND +- PROPERTY INTERFACE_LINK_LIBRARIES "${${_Python}_LIBRARIES}") ++ target_link_libraries(${_Python}::Module INTERFACE ${${_Python}_LIBRARIES}) + endif() + + set_property( diff --git a/ports/pybind11/portfile.cmake b/ports/pybind11/portfile.cmake index c1f3cf8c..dfd314bd 100644 --- a/ports/pybind11/portfile.cmake +++ b/ports/pybind11/portfile.cmake @@ -2,10 +2,10 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO pybind/pybind11 REF "v${VERSION}" - SHA512 497c25b33b09a9c42f67131ab82e35d689e8ce089dd7639be997305ff9a6d502447b79c824508c455d559e61f0186335b54dd2771d903a7c1621833930622d1a + SHA512 c17e6d6a78c38e760864b390ac2aa7df6a94ca53acb2e8be71f0d63d611b738fa20a16946c98a93fbfcad56cb0346ebf247bbe41c6f5171c6ce68397b1e5c4db HEAD_REF master PATCHES - fix-debug-link.patch + android.diff ) vcpkg_cmake_configure( diff --git a/ports/pybind11/usage b/ports/pybind11/usage index 83162ad9..54cf3e6e 100644 --- a/ports/pybind11/usage +++ b/ports/pybind11/usage @@ -1,23 +1,12 @@ -pybind11 provides CMake targets. There are two modes provided; classic, which is built on the old Python -discovery packages in CMake, or the new FindPython mode, which uses FindPython -from 3.12+ forward (3.15+ _highly_ recommended). - -New FindPython mode: - - find_package(Python COMPONENTS Interpreter Development) - find_package(pybind11 CONFIG) - - # pybind11 method: - pybind11_add_module(MyModule1 src1.cpp) - - # Python method: - Python_add_library(MyModule2 src2.cpp) - target_link_libraries(MyModule2 pybind11::headers) - set_target_properties(MyModule2 PROPERTIES - INTERPROCEDURAL_OPTIMIZATION ON - CXX_VISIBILITY_PRESET ON - VISIBILITY_INLINES_HIDDEN ON - ) - -For more information see here: - https://pybind11.readthedocs.io/en/latest/compiling.html#building-with-cmake \ No newline at end of file +pybind11 provides CMake integration: + + # Easy + set(PYBIND11_FINDPYTHON ON) + find_package(pybind11 CONFIG REQUIRED) + pybind11_add_module(MyModule1 src1.cpp) + + # Advanced + find_package(Python COMPONENTS Interpreter Development) + find_package(pybind11 CONFIG REQUIRED) + Python_add_library(MyModule2 src2.cpp) + target_link_libraries(MyModule2 PRIVATE pybind11::headers) diff --git a/ports/pybind11/vcpkg.json b/ports/pybind11/vcpkg.json index 083dd788..ca637bb6 100644 --- a/ports/pybind11/vcpkg.json +++ b/ports/pybind11/vcpkg.json @@ -1,11 +1,19 @@ { "name": "pybind11", - "version": "2.13.6", + "version": "3.0.1", "description": "pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code", "homepage": "https://github.com/pybind/pybind11", + "documentation": "https://pybind11.readthedocs.io/", "license": "BSD-3-Clause", - "supports": "!(arm & windows)", "dependencies": [ + { + "name": "py-scikit-build-core", + "host": true + }, + { + "name": "python3", + "default-features": false + }, { "name": "vcpkg-cmake", "host": true diff --git a/versions/baseline.json b/versions/baseline.json index 83d1b62f..1209680d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -94,7 +94,7 @@ }, "py-cython": { "baseline": "3.2.4", - "port-version": 0 + "port-version": 1 }, "py-dateutil": { "baseline": "2.9.0", @@ -230,7 +230,7 @@ }, "py-numpy": { "baseline": "2.4.4", - "port-version": 0 + "port-version": 1 }, "py-owslib": { "baseline": "0.35.0", @@ -382,7 +382,7 @@ }, "py-scikit-build": { "baseline": "0.19.0", - "port-version": 0 + "port-version": 1 }, "py-scikit-build-core": { "baseline": "0.12.2", @@ -473,7 +473,7 @@ "port-version": 0 }, "pybind11": { - "baseline": "2.13.6", + "baseline": "3.0.1", "port-version": 0 }, "python3": { diff --git a/versions/p-/py-cython.json b/versions/p-/py-cython.json index cddf149d..fe482dae 100644 --- a/versions/p-/py-cython.json +++ b/versions/p-/py-cython.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c6a191acf040760c520157c6767ca9dc27d01479", + "version": "3.2.4", + "port-version": 1 + }, { "git-tree": "64b13a6b82fd4dbc32ab37abe42b43d32579f9af", "version": "3.2.4", diff --git a/versions/p-/py-numpy.json b/versions/p-/py-numpy.json index 345d3a52..4a51e100 100644 --- a/versions/p-/py-numpy.json +++ b/versions/p-/py-numpy.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6e97d2ea2236b4214e61a7126a0cf3e150f82b86", + "version": "2.4.4", + "port-version": 1 + }, { "git-tree": "67ba1ea3fc06fa258e49035cd6f96b1b2cd7cd28", "version": "2.4.4", diff --git a/versions/p-/py-scikit-build.json b/versions/p-/py-scikit-build.json index a23465ae..144f6de2 100644 --- a/versions/p-/py-scikit-build.json +++ b/versions/p-/py-scikit-build.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f5749672ad70d2a0dea4ad475dde13cbcdee8720", + "version": "0.19.0", + "port-version": 1 + }, { "git-tree": "b5d49a288ced3eb6eee8c30bd0ff78a876e7f0ea", "version": "0.19.0", diff --git a/versions/p-/pybind11.json b/versions/p-/pybind11.json index adfcb05c..e90e9a41 100644 --- a/versions/p-/pybind11.json +++ b/versions/p-/pybind11.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5c10617610b49fe60527e7747f0bbab7b584836a", + "version": "3.0.1", + "port-version": 0 + }, { "git-tree": "8463c362dc76ea57c68350f3e5bc8c540aa6e770", "version": "2.13.6",