From 215c0ea64e8bb82ddffb5522256dfc945506ce36 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 18 Jun 2026 22:51:31 +0300 Subject: [PATCH 1/5] Fix Windows builds for 5.x branch. --- .github/workflows/build_wheels_windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 3899aa46b..df50680a7 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -17,7 +17,7 @@ on: jobs: Build: - runs-on: windows-2025 + runs-on: windows-2022 strategy: fail-fast: false matrix: @@ -65,7 +65,7 @@ jobs: python --version python -m pip install --upgrade pip python -m pip install --upgrade setuptools - python -m pip install cmake==3.24.2 + python -m pip install cmake==4.3.2 python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd @@ -77,14 +77,14 @@ jobs: Test: needs: [Build] - runs-on: windows-2025 + runs-on: windows-2022 defaults: run: shell: cmd strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] From d4df7f6daf319128de308428aaf1b8eaba127d27 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 19 Jun 2026 00:09:06 +0300 Subject: [PATCH 2/5] Disable NASM for experiment. --- .github/workflows/build_wheels_windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index df50680a7..bf5d88240 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -57,8 +57,8 @@ jobs: architecture: ${{ matrix.platform }} - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v1.1 - - name: Setup NASM - uses: ilammy/setup-nasm@v1 + # - name: Setup NASM + # uses: ilammy/setup-nasm@v1 - name: Build a package # CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version run: | From 06719d47e6229854ad3e6329aa52f103e587d782 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 19 Jun 2026 00:18:56 +0300 Subject: [PATCH 3/5] Break mingw cc.exe to exclude it from assember search. --- .github/workflows/build_wheels_windows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index bf5d88240..dd407e97e 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -57,8 +57,8 @@ jobs: architecture: ${{ matrix.platform }} - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v1.1 - # - name: Setup NASM - # uses: ilammy/setup-nasm@v1 + - name: Setup NASM + uses: ilammy/setup-nasm@v1 - name: Build a package # CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version run: | @@ -100,6 +100,7 @@ jobs: run: | rm -rf ./* || true rm -rf ./.??* || true + mv C:/mingw64/bin/cc.exe C:/mingw64/bin/cc.exe.qqq working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v4 From 807f11fd7ed8bc0e76febf531f1cc6a4175d31cb Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 19 Jun 2026 00:25:40 +0300 Subject: [PATCH 4/5] Hardcode NASM assember first in PATH --- .github/workflows/build_wheels_windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index dd407e97e..ff7d99343 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -62,6 +62,7 @@ jobs: - name: Build a package # CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version run: | + set PATH=C:\Users\runneradmin\nasm\;%PATH% python --version python -m pip install --upgrade pip python -m pip install --upgrade setuptools @@ -100,7 +101,6 @@ jobs: run: | rm -rf ./* || true rm -rf ./.??* || true - mv C:/mingw64/bin/cc.exe C:/mingw64/bin/cc.exe.qqq working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v4 From 5592c0e8c5f6b215ee04982f5126887a9d54f9eb Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 19 Jun 2026 00:39:27 +0300 Subject: [PATCH 5/5] Hardcode NASM path as ASM compiler for experiment. --- .github/workflows/build_wheels_windows.yml | 1 - setup.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index ff7d99343..df50680a7 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -62,7 +62,6 @@ jobs: - name: Build a package # CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version run: | - set PATH=C:\Users\runneradmin\nasm\;%PATH% python --version python -m pip install --upgrade pip python -m pip install --upgrade setuptools diff --git a/setup.py b/setup.py index 025e1b1fc..1b403760d 100755 --- a/setup.py +++ b/setup.py @@ -147,8 +147,11 @@ def main(): # Raw paths relative to sourcetree root. files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]} + # HACK: Disabled generic assembler for now. + # Windows 2025 CI environment does not provide suitable assembler or build is broken in OpenCV MLAS. ci_cmake_generator = ( - ["-G", "Visual Studio 17 2022"] + ["-G", "Visual Studio 17 2022", + "-DCMAKE_ASM_COMPILER="] if os.name == "nt" else ["-G", "Unix Makefiles"] )