From 5541f9edec85dbd7e1eb0098baa3e9aaa538e9af Mon Sep 17 00:00:00 2001 From: MaticTonin Date: Wed, 10 Jun 2026 23:59:10 +0200 Subject: [PATCH 1/4] Try run on new Windows --- .github/workflows/main.workflow.yml | 15 +++++++-------- .github/workflows/python-main.yml | 14 +++++++------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.workflow.yml b/.github/workflows/main.workflow.yml index 94abd4b6b0..c58c0a456c 100644 --- a/.github/workflows/main.workflow.yml +++ b/.github/workflows/main.workflow.yml @@ -139,7 +139,7 @@ jobs: if: needs.precheck.outputs.should_run == 'true' strategy: matrix: - os: [macos-latest, windows-2022, ubuntu-latest] + os: [macos-latest, windows-2025-vs2026, ubuntu-latest] cmake: ['3.22.x', '4.0.x'] steps: @@ -164,7 +164,7 @@ jobs: sudo apt-get install libopencv-dev libudev-dev libusb-1.0-0-dev - name: Install dependencies - if: matrix.os == 'windows-2022' + if: runner.os == 'Windows' run: | choco install opencv echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append @@ -180,7 +180,7 @@ jobs: if: needs.precheck.outputs.should_run == 'true' strategy: matrix: - os: [macos-latest, windows-2022, ubuntu-latest] + os: [macos-latest, windows-2025-vs2026, ubuntu-latest] build-type: [Debug, Release] # shared: [true, false] shared: [true] @@ -212,12 +212,11 @@ jobs: sudo apt-get install libopencv-dev libudev-dev libusb-1.0-0-dev - name: Install dependencies - if: matrix.os == 'windows-2022' + if: runner.os == 'Windows' run: | choco install opencv echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "CMAKE_GENERATOR=Visual Studio 17 2022" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "CMAKE_GENERATOR_PLATFORM=${{ matrix.platform }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "CMAKE_GENERATOR=Ninja" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 @@ -228,14 +227,14 @@ jobs: run: cmake -S . -B build -D BUILD_SHARED_LIBS=${{ matrix.shared}} -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install ${{ env.CMAKE_ARGS }} - name: Set path to shared library dll (Windows) - if: matrix.os == 'windows-2022' + if: runner.os == 'Windows' run: echo "$GITHUB_WORKSPACE/depthai_install/bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Build and install run: cmake --build build --config ${{ matrix.build-type }} --target install --parallel 4 - name: Upload Win64 shared library - if: matrix.os == 'windows-2022' && matrix.shared && matrix.platform == 'x64' + if: runner.os == 'Windows' && matrix.shared && matrix.platform == 'x64' uses: actions/upload-artifact@v4 with: name: windows-prebuilt-win64-${{ matrix.build-type }} diff --git a/.github/workflows/python-main.yml b/.github/workflows/python-main.yml index e4eebb0b32..6a5e5112aa 100644 --- a/.github/workflows/python-main.yml +++ b/.github/workflows/python-main.yml @@ -24,7 +24,7 @@ on: ################################### env: - CMAKE_WINDOWS_SDK_VERSION: '10.0.18362.0' + CMAKE_WINDOWS_SDK_VERSION: '10.0.26100.0' # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -127,7 +127,7 @@ jobs: VCPKG_BINARY_SOURCES: "clear;files,/home/runner/.vcpkg,readwrite" strategy: matrix: - # os: [ubuntu-latest, windows-2022, macos-latest] + # os: [ubuntu-latest, windows-2025-vs2026, macos-latest] os: [ubuntu-latest] # TODO(Morato) - re-enable windows & macos runs-on: ${{ matrix.os }} steps: @@ -139,13 +139,13 @@ jobs: run: echo Home directory inside container $HOME - name: Cache vcpkg folder - if: matrix.os != 'windows-2022' + if: runner.os != 'Windows' uses: actions/cache@v3 with: path: /home/runner/.vcpkg/ key: vcpkg-${{ matrix.os }} - name: Cache vcpkg folder - if: matrix.os == 'windows-2022' + if: runner.os == 'Windows' uses: actions/cache@v3 with: path: C:/.vcpkg/ @@ -217,7 +217,7 @@ jobs: # This job builds wheels for Windows x86_64 arch build-windows-x86_64: needs: build-docstrings - runs-on: windows-2022 + runs-on: windows-2025-vs2026 strategy: matrix: python-version: [3.9, '3.10', '3.11', '3.12', '3.13', '3.14'] @@ -238,7 +238,7 @@ jobs: uses: actions/cache@v3 with: path: C:/.vcpkg - key: vcpkg-windows-2022 + key: vcpkg-windows-2025-vs2026 - uses: actions/checkout@v3 with: submodules: 'recursive' @@ -665,7 +665,7 @@ jobs: combine-windows-x86_64-wheels: needs: build-windows-x86_64 - runs-on: windows-2022 + runs-on: windows-2025-vs2026 steps: - uses: actions/checkout@v3 - name: Download audited wheels From de6dee13d3035f23ee523e4e5be761beb6c30463 Mon Sep 17 00:00:00 2001 From: MaticTonin Date: Thu, 11 Jun 2026 01:03:19 +0200 Subject: [PATCH 2/4] Define MSVC enviromemnt --- .github/workflows/main.workflow.yml | 19 +++++++++++++++---- .github/workflows/python-main.yml | 6 +++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.workflow.yml b/.github/workflows/main.workflow.yml index c58c0a456c..152eb2bb3f 100644 --- a/.github/workflows/main.workflow.yml +++ b/.github/workflows/main.workflow.yml @@ -169,9 +169,15 @@ jobs: choco install opencv echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Configure MSVC environment + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + - name: Build run: | - cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D DEPTHAI_BUILD_EXAMPLES=ON -D DEPTHAI_BUILD_TESTS=ON ${{ env.CMAKE_ARGS }} + cmake -S . -B build ${{ runner.os == 'Windows' && '-G Ninja' || '' }} -D CMAKE_BUILD_TYPE=Release -D DEPTHAI_BUILD_EXAMPLES=ON -D DEPTHAI_BUILD_TESTS=ON ${{ env.CMAKE_ARGS }} cmake --build build --parallel 4 --config Release integration: @@ -216,7 +222,12 @@ jobs: run: | choco install opencv echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "CMAKE_GENERATOR=Ninja" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Configure MSVC environment + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 @@ -224,7 +235,7 @@ jobs: cmake-version: '3.29.x' - name: Configure ${{ matrix.build-type }}, shared ${{ matrix.shared }}, ${{ matrix.platform }} - run: cmake -S . -B build -D BUILD_SHARED_LIBS=${{ matrix.shared}} -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install ${{ env.CMAKE_ARGS }} + run: cmake -S . -B build ${{ runner.os == 'Windows' && '-G Ninja' || '' }} -D BUILD_SHARED_LIBS=${{ matrix.shared}} -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install ${{ env.CMAKE_ARGS }} - name: Set path to shared library dll (Windows) if: runner.os == 'Windows' @@ -256,7 +267,7 @@ jobs: - name: Build and test find_package (installed) run: | - cmake -S tests/integration/ -B tests/integration/build_find_package -D TEST_FIND_PACKAGE=ON -D CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/depthai_install/ ${{ env.CMAKE_ARGS }} + cmake -S tests/integration/ -B tests/integration/build_find_package ${{ runner.os == 'Windows' && '-G Ninja' || '' }} -D TEST_FIND_PACKAGE=ON -D CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/depthai_install/ ${{ env.CMAKE_ARGS }} cmake --build tests/integration/build_find_package --config ${{ matrix.build-type }} --parallel 4 cd tests/integration/build_find_package ctest -C ${{ matrix.build-type }} --output-on-failure --no-tests=error diff --git a/.github/workflows/python-main.yml b/.github/workflows/python-main.yml index 6a5e5112aa..025d1db0df 100644 --- a/.github/workflows/python-main.yml +++ b/.github/workflows/python-main.yml @@ -239,6 +239,10 @@ jobs: with: path: C:/.vcpkg key: vcpkg-windows-2025-vs2026 + - name: Configure MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 - uses: actions/checkout@v3 with: submodules: 'recursive' @@ -257,7 +261,7 @@ jobs: run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Select Windows SDK - run: echo "CMAKE_ARGS=-DCMAKE_SYSTEM_VERSION=${{ env.CMAKE_WINDOWS_SDK_VERSION }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + run: echo "CMAKE_ARGS=-G Ninja -DCMAKE_SYSTEM_VERSION=${{ env.CMAKE_WINDOWS_SDK_VERSION }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From 13a1bab8f6eeae361c97f0294dc9991340e90aa6 Mon Sep 17 00:00:00 2001 From: MaticTonin Date: Thu, 11 Jun 2026 14:16:22 +0200 Subject: [PATCH 3/4] Fix passing of -G Ninja argument --- bindings/python/setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 3e4d526297..f44c2d0165 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -3,6 +3,7 @@ import sys import platform import subprocess +import shlex import find_version from setuptools import setup, Extension @@ -207,7 +208,7 @@ def build_extension(self, ext): # Add additional cmake build args from environment if 'CMAKE_BUILD_ARGS' in os.environ: - build_args += [os.environ['CMAKE_BUILD_ARGS']] + build_args += shlex.split(os.environ['CMAKE_BUILD_ARGS']) # Windows if platform.system() == "Windows": @@ -255,7 +256,7 @@ def build_extension(self, ext): # Add additional cmake args from environment if 'CMAKE_ARGS' in os.environ: - cmake_args += [os.environ['CMAKE_ARGS']] + cmake_args += shlex.split(os.environ['CMAKE_ARGS']) if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) From 19f33b9c10f5d4f841116e6c4da06fa466f27ab5 Mon Sep 17 00:00:00 2001 From: MaticTonin Date: Wed, 17 Jun 2026 00:03:41 +0200 Subject: [PATCH 4/4] Adress comments --- .github/workflows/main.workflow.yml | 6 +++--- .github/workflows/python-main.yml | 14 +++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.workflow.yml b/.github/workflows/main.workflow.yml index 152eb2bb3f..4e2ac21546 100644 --- a/.github/workflows/main.workflow.yml +++ b/.github/workflows/main.workflow.yml @@ -139,7 +139,7 @@ jobs: if: needs.precheck.outputs.should_run == 'true' strategy: matrix: - os: [macos-latest, windows-2025-vs2026, ubuntu-latest] + os: [macos-latest, windows-2025, ubuntu-latest] cmake: ['3.22.x', '4.0.x'] steps: @@ -186,7 +186,7 @@ jobs: if: needs.precheck.outputs.should_run == 'true' strategy: matrix: - os: [macos-latest, windows-2025-vs2026, ubuntu-latest] + os: [macos-latest, windows-2025, ubuntu-latest] build-type: [Debug, Release] # shared: [true, false] shared: [true] @@ -267,7 +267,7 @@ jobs: - name: Build and test find_package (installed) run: | - cmake -S tests/integration/ -B tests/integration/build_find_package ${{ runner.os == 'Windows' && '-G Ninja' || '' }} -D TEST_FIND_PACKAGE=ON -D CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/depthai_install/ ${{ env.CMAKE_ARGS }} + cmake -S tests/integration/ -B tests/integration/build_find_package -D TEST_FIND_PACKAGE=ON -D CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/depthai_install/ ${{ env.CMAKE_ARGS }} cmake --build tests/integration/build_find_package --config ${{ matrix.build-type }} --parallel 4 cd tests/integration/build_find_package ctest -C ${{ matrix.build-type }} --output-on-failure --no-tests=error diff --git a/.github/workflows/python-main.yml b/.github/workflows/python-main.yml index 025d1db0df..a2d4a77192 100644 --- a/.github/workflows/python-main.yml +++ b/.github/workflows/python-main.yml @@ -127,7 +127,7 @@ jobs: VCPKG_BINARY_SOURCES: "clear;files,/home/runner/.vcpkg,readwrite" strategy: matrix: - # os: [ubuntu-latest, windows-2025-vs2026, macos-latest] + # os: [ubuntu-latest, windows-2025, macos-latest] os: [ubuntu-latest] # TODO(Morato) - re-enable windows & macos runs-on: ${{ matrix.os }} steps: @@ -217,7 +217,7 @@ jobs: # This job builds wheels for Windows x86_64 arch build-windows-x86_64: needs: build-docstrings - runs-on: windows-2025-vs2026 + runs-on: windows-2025 strategy: matrix: python-version: [3.9, '3.10', '3.11', '3.12', '3.13', '3.14'] @@ -238,11 +238,7 @@ jobs: uses: actions/cache@v3 with: path: C:/.vcpkg - key: vcpkg-windows-2025-vs2026 - - name: Configure MSVC environment - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 + key: vcpkg-windows-2025 - uses: actions/checkout@v3 with: submodules: 'recursive' @@ -261,7 +257,7 @@ jobs: run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Select Windows SDK - run: echo "CMAKE_ARGS=-G Ninja -DCMAKE_SYSTEM_VERSION=${{ env.CMAKE_WINDOWS_SDK_VERSION }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + run: echo "CMAKE_ARGS=-DCMAKE_SYSTEM_VERSION=${{ env.CMAKE_WINDOWS_SDK_VERSION }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -669,7 +665,7 @@ jobs: combine-windows-x86_64-wheels: needs: build-windows-x86_64 - runs-on: windows-2025-vs2026 + runs-on: windows-2025 steps: - uses: actions/checkout@v3 - name: Download audited wheels