Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand Down Expand Up @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions ports/py-cython/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions ports/py-cython/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions ports/py-numpy/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
1 change: 1 addition & 0 deletions ports/py-numpy/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 5 additions & 0 deletions ports/py-scikit-build/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"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": [
{
"name": "py-hatch-fancy-pypi-readme",
"host": true
},
{
"name": "py-hatch-vcs",
"host": true
},
{
"name": "py-setuptools",
"host": true
Expand Down
16 changes: 16 additions & 0 deletions ports/pybind11/android.diff
Original file line number Diff line number Diff line change
@@ -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(
4 changes: 2 additions & 2 deletions ports/pybind11/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
35 changes: 12 additions & 23 deletions ports/pybind11/usage
Original file line number Diff line number Diff line change
@@ -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
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)
12 changes: 10 additions & 2 deletions ports/pybind11/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
},
"py-cython": {
"baseline": "3.2.4",
"port-version": 0
"port-version": 1
},
"py-dateutil": {
"baseline": "2.9.0",
Expand Down Expand Up @@ -230,7 +230,7 @@
},
"py-numpy": {
"baseline": "2.4.4",
"port-version": 0
"port-version": 1
},
"py-owslib": {
"baseline": "0.35.0",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -473,7 +473,7 @@
"port-version": 0
},
"pybind11": {
"baseline": "2.13.6",
"baseline": "3.0.1",
"port-version": 0
},
"python3": {
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/py-cython.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c6a191acf040760c520157c6767ca9dc27d01479",
"version": "3.2.4",
"port-version": 1
},
{
"git-tree": "64b13a6b82fd4dbc32ab37abe42b43d32579f9af",
"version": "3.2.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/py-numpy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6e97d2ea2236b4214e61a7126a0cf3e150f82b86",
"version": "2.4.4",
"port-version": 1
},
{
"git-tree": "67ba1ea3fc06fa258e49035cd6f96b1b2cd7cd28",
"version": "2.4.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/py-scikit-build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f5749672ad70d2a0dea4ad475dde13cbcdee8720",
"version": "0.19.0",
"port-version": 1
},
{
"git-tree": "b5d49a288ced3eb6eee8c30bd0ff78a876e7f0ea",
"version": "0.19.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/pybind11.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5c10617610b49fe60527e7747f0bbab7b584836a",
"version": "3.0.1",
"port-version": 0
},
{
"git-tree": "8463c362dc76ea57c68350f3e5bc8c540aa6e770",
"version": "2.13.6",
Expand Down
Loading