Skip to content

Commit 8a62afa

Browse files
committed
BLD: Include MSVCP140 runtime statically
This should prevent conflicts with other wheels that use the runtime at a different version.
1 parent 81be26f commit 8a62afa

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/cibuildwheel.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,15 @@ jobs:
100100
CIBW_AFTER_BUILD: >-
101101
twine check {wheel} &&
102102
python {package}/ci/check_wheel_licenses.py {wheel}
103-
CIBW_CONFIG_SETTINGS: setup-args="--vsenv"
103+
# On Windows, we explicitly request MSVC compilers (as GitHub Action runners have
104+
# MinGW on PATH that would be picked otherwise), switch to a static build for
105+
# runtimes, but use dynamic linking for `VCRUNTIME140.dll`, `VCRUNTIME140_1.dll`,
106+
# and the UCRT. This avoids requiring specific versions of `MSVCP140.dll`, while
107+
# keeping shared state with the rest of the Python process/extensions.
108+
CIBW_CONFIG_SETTINGS_WINDOWS: >-
109+
setup-args="--vsenv"
110+
setup-args="-Db_vscrt=mt"
111+
setup-args="-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']"
104112
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
105113
CIBW_SKIP: "*-musllinux_aarch64"
106114
CIBW_TEST_COMMAND: >-
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Windows wheel runtime bundling made static
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
In 3.7.0, the MSVC runtime DLL was bundled in wheels to enable importing Matplotlib on
5+
systems that do not have it installed. However, this could cause inconsistencies with
6+
other wheels that did the same, and trigger random crashes depending on import order. See
7+
`this issue <https://github.com/matplotlib/matplotlib/issues/28551>`_ for further
8+
details.
9+
10+
Since 3.9.2, wheels now bundle the MSVC runtime DLL statically to avoid such issues.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy