Skip to content

CI Simplify windows cibuildwheel setup - #34257

Closed
lesteve wants to merge 11 commits into
scikit-learn:mainfrom
lesteve:simplify-windows-cibuildwheel
Closed

lesteve wants to merge 11 commits into
scikit-learn:mainfrom
lesteve:simplify-windows-cibuildwheel

Conversation

@lesteve

@lesteve lesteve commented Jun 11, 2026

Copy link
Copy Markdown
Member

The Windows setup is a bit convoluted. This uses vanilla cibuildwheel and adds an additional step to make sure we correctly vendor the needed DLLs (vcomp140.dll OpenMP DLL + msvcp140.dll MSVC C++ runtime) by running sklearn.show_versions() inside minimal Docker Windows image which should fail if we don't vendor the DLLs.

@lesteve lesteve changed the title Simplify windows cibuildwheel setup CI Simplify windows cibuildwheel setup Jun 11, 2026
@ogrisel

ogrisel commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

ed4c436 does not make all the x86_64 windows test break as anticipated. For instance, I find it surprising that the following job passes:

https://github.com/scikit-learn/scikit-learn/actions/runs/27373079075/job/80890244559?pr=34257

EDIT: when running the tests, note that it does use the vendored vcomp140.dll that ends up in site-packages\sklearn\.libs\vcomp140.dll. But apparently msvcp140.dll is no longer needed for some reason.

[10](https://github.com/scikit-learn/scikit-learn/actions/runs/27373079075/job/80890244559?pr=34257#step:6:111)
threadpoolctl info:
       user_api: openmp
   internal_api: openmp
    num_threads: 4
         prefix: vcomp
       filepath: C:\venv\Lib\site-packages\sklearn\.libs\vcomp140.dll
        version: None

@ogrisel

ogrisel commented Jun 16, 2026

Copy link
Copy Markdown
Member

Also note that the other win_amd64 jobs failed for the wrong reason: some docker commands failed with:

++ docker run -it -v 'D:\a\scikit-learn\scikit-learn:C:/mnt' -d winamd64/python:3.11-windowsservercore
failed to connect to the docker API at npipe:////./pipe/docker_engine; check if the path is correct and if the daemon is running: open //./pipe/docker_engine: The system cannot find the file specified.
+ CONTAINER_ID=
Error: Process completed with exit code 1.

and similar failure for 3.14....

@ogrisel

ogrisel commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

I synced this branch with main to check that the fix in #34371 would fix (some of) the CI failures.

@lesteve

lesteve commented Jul 1, 2026 •

Copy link
Copy Markdown
Member Author

Looks like the msvcp140.dll vendoring is still needed, see #29898 (comment).

The previous approach (sklearn.show_versions()) was not able to detect a potential issue. I am double-checking whether running the common tests is enough to do it (it should).

@lesteve

lesteve commented Jul 1, 2026 •

Copy link
Copy Markdown
Member Author

As expected, running the common tests highlights the missing msvcp140.dll build log.

+ docker exec 8eb83456b7b833a62cc1d5c2ffcb995b2d383d696dadb98862b0c3437ba84bb7 powershell -Command 'C:/venv/Scripts/python -m sklearn.utils.tests.test_estimator_checks'
Traceback (most recent call last):
  File "<frozen runpy>", line 203, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\venv\Lib\site-packages\sklearn\utils\tests\test_estimator_checks.py", line 19, in <module>
    from sklearn.cluster import MiniBatchKMeans
  File "C:\venv\Lib\site-packages\sklearn\cluster\__init__.py", line 6, in <module>
    from sklearn.cluster._affinity_propagation import (
    ...<2 lines>...
    )
  File "C:\venv\Lib\site-packages\sklearn\cluster\_affinity_propagation.py", line 14, in <module>
    from sklearn.metrics import euclidean_distances, pairwise_distances_argmin
  File "C:\venv\Lib\site-packages\sklearn\metrics\__init__.py", line 6, in <module>
    from sklearn.metrics import cluster
  File "C:\venv\Lib\site-packages\sklearn\metrics\cluster\__init__.py", line 28, in <module>
    from sklearn.metrics.cluster._unsupervised import (
    ...<4 lines>...
    )
  File "C:\venv\Lib\site-packages\sklearn\metrics\cluster\_unsupervised.py", line 13, in <module>
    from sklearn.metrics.pairwise import (
    ...<3 lines>...
    )
  File "C:\venv\Lib\site-packages\sklearn\metrics\pairwise.py", line 19, in <module>
    from sklearn.metrics._pairwise_distances_reduction import ArgKmin
  File "C:\venv\Lib\site-packages\sklearn\metrics\_pairwise_distances_reduction\__init__.py", line 94, in <module>
    from sklearn.metrics._pairwise_distances_reduction._dispatcher import (
    ...<6 lines>...
    )
  File "C:\venv\Lib\site-packages\sklearn\metrics\_pairwise_distances_reduction\_dispatcher.py", line 12, in <module>
    from sklearn.metrics._pairwise_distances_reduction._argkmin import ArgKmin32, ArgKmin64
  File "sklearn/metrics/_pairwise_distances_reduction/_argkmin.pyx", line 1, in init sklearn.metrics._pairwise_distances_reduction._argkmin
ImportError: DLL load failed while importing _base: The specified module could not be found.

@lesteve

lesteve commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

The python 3.14 issues on all OSes (AttributeError: 'dict' object has no attribute '__annotate__'. Did you mean: '__getstate__'?) are not related to this PR and have already been noticed somewhere else.

I am marking this PR as ready to review.

@lesteve
lesteve marked this pull request as ready for review July 1, 2026 16:52
@lesteve

lesteve commented Jul 1, 2026 •

Copy link
Copy Markdown
Member Author

Since the approach has been validated, I could also use it in https://github.com/scikit-learn/scikit-learn-release, instead of merging this PR. Not sure what it simpler.

Longer term, I am wondering whether using delvewheel rather than our custom DLL vendoring tweak would work and potentially be simpler (it does add a dependency in our build system but it would be one less custom tweak).

@ogrisel

ogrisel commented Jul 8, 2026

Copy link
Copy Markdown
Member

Longer term, I am wondering whether using delvewheel rather than our custom DLL vendoring tweak would work and potentially be simpler (it does add a dependency in our build system but it would be one less custom tweak).

I am fine with either.

Since the approach has been validated, I could also use it in https://github.com/scikit-learn/scikit-learn-release, instead of merging this PR. Not sure what it simpler.

+1 for working on improving the new release repo.

@lesteve

lesteve commented Jul 28, 2026 •

Copy link
Copy Markdown
Member Author

I did this in scikit-learn-release and merged my own PR there, see scikit-learn/scikit-learn-release#2 for more details.

@lesteve lesteve closed this Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants