File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,12 @@ jobs:
113113 # TODO: figure out whether we need/want to use other compilers too
114114 compiler : " gcc"
115115 version : " 13"
116+ - name : Set DLL directory environment variable
117+ # Used when running the tests, see `tests/conftest.py` for details
118+ if : ${{ startsWith(matrix.os, 'windows') }}
119+ run : |
120+ echo "PYTHON_ADD_DLL_DIRECTORY=C:\\mingw64\\bin" >> $GITHUB_ENV
121+
116122 - uses : ./.github/actions/setup
117123 with :
118124 python-version : ${{ matrix.python-version }}
Original file line number Diff line number Diff line change 55"""
66
77import os
8- import sys
98
10- if os .environ .get ("CI" , "false" ) == "true" and sys .platform == "win32" :
11- os .add_dll_directory ("C:\\ mingw64\\ bin" )
9+ if dll_directory_to_add := os .environ .get ("PYTHON_ADD_DLL_DIRECTORY" , None ):
10+ # Add the directory which has the libgfortran.dll file.
11+ #
12+ # A super deep dive into this is here:
13+ # https://stackoverflow.com/a/78276248
14+ # The tl;dr is - mingw64's linker can be tricked by windows craziness
15+ # into linking a dynamic library even when we wanted only static links,
16+ # so if you want to avoid this, link with something else (e.g. the MS linker).
17+ # (From what I know, this isn't an issue for the built wheels
18+ # thanks to the cleverness of delvewheel)
19+ os .add_dll_directory (dll_directory_to_add )
20+ # os.add_dll_directory("C:\\mingw64\\bin")
You can’t perform that action at this time.
0 commit comments