mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 14:59:27 +00:00
Bring CI back to all-working condition (#5822)
* Fix "🐍 3 • windows-latest • mingw64" job (apparently msys2/setup-msys2@v2 cannot be run twice anymore):
https://github.com/pybind/pybind11/actions/runs/17394902023/job/49417376616?pr=5796
```
Run msys2/setup-msys2@v2
with:
msystem: mingw64
install: mingw-w64-x86_64-python-numpy mingw-w64-x86_64-python-scipy mingw-w64-x86_64-eigen3
path-type: minimal
update: false
pacboy: false
release: true
location: RUNNER_TEMP
platform-check-severity: fatal
cache: true
env:
PYTHONDEVMODE: 1
PIP_BREAK_SYSTEM_PACKAGES: 1
PIP_ONLY_BINARY: numpy
FORCE_COLOR: 3
PYTEST_TIMEOUT: 300
VERBOSE: 1
CMAKE_COLOR_DIAGNOSTICS: 1
MSYSTEM: MINGW64
Error: Trying to install MSYS2 to D:\a\_temp\msys64 but that already exists, cannot continue.
```
* Add `pytest.xfail("[TEST-GIL-SCOPED] macOS free-threading...)`
* Change env.SYS_IS_GIL_ENABLED constant to env.sys_is_gil_enabled function
* Change install_mingw64_only → extra_install
* Also xfail if macOS and PY_GIL_DISABLED, show SOABI
* build-ios: brew upgrade|install cmake
* Revert "build-ios: brew upgrade|install cmake"
This reverts commit bd3900ee79.
See also:
https://github.com/pybind/pybind11/pull/5822#issuecomment-3247827317
* Disable build-ios job in tests-cibw.yml
* Remove macos_brew_install_llvm job because it started failing, to reduce our maintenance overhead:
Failures tracked here: https://github.com/pybind/pybind11/pull/5822#issuecomment-3247998220
* Fix iOS build step for cmake installation
Replaced brew upgrade with brew install for cmake.
* Update cmake installation steps in CI workflow
Uninstall cmake before installing the latest version due to GitHub's local tap changes.
* Update .github/workflows/tests-cibw.yml
---------
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3878c23f8d
commit
cd56888c89
109
.github/workflows/ci.yml
vendored
109
.github/workflows/ci.yml
vendored
@@ -1019,8 +1019,15 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- { sys: mingw64, env: x86_64 }
|
- sys: mingw32
|
||||||
- { sys: mingw32, env: i686 }
|
env: i686
|
||||||
|
extra_install: ""
|
||||||
|
- sys: mingw64
|
||||||
|
env: x86_64
|
||||||
|
extra_install: |
|
||||||
|
mingw-w64-x86_64-python-numpy
|
||||||
|
mingw-w64-x86_64-python-scipy
|
||||||
|
mingw-w64-x86_64-eigen3
|
||||||
steps:
|
steps:
|
||||||
- uses: msys2/setup-msys2@v2
|
- uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
@@ -1034,15 +1041,7 @@ jobs:
|
|||||||
mingw-w64-${{matrix.env}}-python-pytest
|
mingw-w64-${{matrix.env}}-python-pytest
|
||||||
mingw-w64-${{matrix.env}}-boost
|
mingw-w64-${{matrix.env}}-boost
|
||||||
mingw-w64-${{matrix.env}}-catch
|
mingw-w64-${{matrix.env}}-catch
|
||||||
|
${{ matrix.extra_install }}
|
||||||
- uses: msys2/setup-msys2@v2
|
|
||||||
if: matrix.sys == 'mingw64'
|
|
||||||
with:
|
|
||||||
msystem: ${{matrix.sys}}
|
|
||||||
install: >-
|
|
||||||
mingw-w64-${{matrix.env}}-python-numpy
|
|
||||||
mingw-w64-${{matrix.env}}-python-scipy
|
|
||||||
mingw-w64-${{matrix.env}}-eigen3
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -1189,91 +1188,3 @@ jobs:
|
|||||||
|
|
||||||
- name: Clean directory
|
- name: Clean directory
|
||||||
run: git clean -fdx
|
run: git clean -fdx
|
||||||
|
|
||||||
macos_brew_install_llvm:
|
|
||||||
if: github.event.pull_request.draft == false
|
|
||||||
name: "macos-13 • brew install llvm"
|
|
||||||
runs-on: macos-13
|
|
||||||
|
|
||||||
env:
|
|
||||||
# https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew
|
|
||||||
LDFLAGS: '-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Update PATH
|
|
||||||
run: echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Show env
|
|
||||||
run: env
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Show Clang++ version before brew install llvm
|
|
||||||
run: clang++ --version
|
|
||||||
|
|
||||||
- name: brew install llvm
|
|
||||||
run: brew install llvm
|
|
||||||
|
|
||||||
- name: Show Clang++ version after brew install llvm
|
|
||||||
run: clang++ --version
|
|
||||||
|
|
||||||
- name: Update CMake
|
|
||||||
uses: jwlawson/actions-setup-cmake@v2.0
|
|
||||||
|
|
||||||
- name: Run pip installs
|
|
||||||
run: |
|
|
||||||
python3 -m pip install --upgrade pip
|
|
||||||
python3 -m pip install -r tests/requirements.txt
|
|
||||||
python3 -m pip install numpy
|
|
||||||
python3 -m pip install scipy
|
|
||||||
|
|
||||||
- name: Show CMake version
|
|
||||||
run: cmake --version
|
|
||||||
|
|
||||||
- name: CMake Configure
|
|
||||||
run: >
|
|
||||||
cmake -S . -B .
|
|
||||||
-DPYBIND11_WERROR=ON
|
|
||||||
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
|
|
||||||
-DDOWNLOAD_CATCH=ON
|
|
||||||
-DDOWNLOAD_EIGEN=ON
|
|
||||||
-DCMAKE_CXX_COMPILER=clang++
|
|
||||||
-DCMAKE_CXX_STANDARD=17
|
|
||||||
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: cmake --build . -j 2
|
|
||||||
|
|
||||||
- name: Python tests
|
|
||||||
run: cmake --build . --target pytest -j 2
|
|
||||||
|
|
||||||
- name: C++ tests
|
|
||||||
run: cmake --build . --target cpptest -j 2
|
|
||||||
|
|
||||||
- name: Interface test
|
|
||||||
run: cmake --build . --target test_cmake_build -j 2
|
|
||||||
|
|
||||||
- name: Visibility test
|
|
||||||
run: cmake --build . --target test_cross_module_rtti -j 2
|
|
||||||
|
|
||||||
- name: CMake Configure - Exercise cmake -DPYBIND11_TEST_OVERRIDE
|
|
||||||
run: >
|
|
||||||
cmake -S . -B build_partial
|
|
||||||
-DPYBIND11_WERROR=ON
|
|
||||||
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
|
|
||||||
-DDOWNLOAD_CATCH=ON
|
|
||||||
-DDOWNLOAD_EIGEN=ON
|
|
||||||
-DCMAKE_CXX_COMPILER=clang++
|
|
||||||
-DCMAKE_CXX_STANDARD=17
|
|
||||||
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
|
|
||||||
"-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp"
|
|
||||||
|
|
||||||
- name: Build - Exercise cmake -DPYBIND11_TEST_OVERRIDE
|
|
||||||
run: cmake --build build_partial -j 2
|
|
||||||
|
|
||||||
- name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE
|
|
||||||
run: cmake --build build_partial --target pytest -j 2
|
|
||||||
|
|
||||||
- name: Clean directory
|
|
||||||
run: git clean -fdx
|
|
||||||
|
|||||||
3
.github/workflows/tests-cibw.yml
vendored
3
.github/workflows/tests-cibw.yml
vendored
@@ -42,7 +42,8 @@ jobs:
|
|||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- run: brew upgrade cmake
|
# We have to uninstall first because GH is now using a local tap to build cmake<4, iOS needs cmake>=4
|
||||||
|
- run: brew uninstall cmake && brew install cmake
|
||||||
|
|
||||||
- uses: pypa/cibuildwheel@v3.1
|
- uses: pypa/cibuildwheel@v3.1
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ _graalpy_version = (
|
|||||||
sys.modules["__graalpython__"].get_graalvm_version() if GRAALPY else "0.0.0"
|
sys.modules["__graalpython__"].get_graalvm_version() if GRAALPY else "0.0.0"
|
||||||
)
|
)
|
||||||
GRAALPY_VERSION = tuple(int(t) for t in _graalpy_version.split("-")[0].split(".")[:3])
|
GRAALPY_VERSION = tuple(int(t) for t in _graalpy_version.split("-")[0].split(".")[:3])
|
||||||
|
|
||||||
|
# Compile-time config (what the binary was built for)
|
||||||
PY_GIL_DISABLED = bool(sysconfig.get_config_var("Py_GIL_DISABLED"))
|
PY_GIL_DISABLED = bool(sysconfig.get_config_var("Py_GIL_DISABLED"))
|
||||||
|
# Runtime state (what's actually happening now)
|
||||||
|
sys_is_gil_enabled = getattr(sys, "_is_gil_enabled", lambda: True)
|
||||||
|
|
||||||
|
|
||||||
def deprecated_call():
|
def deprecated_call():
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from pybind11_tests import cpp_conduit as home_planet
|
|||||||
|
|
||||||
|
|
||||||
def import_warns_freethreaded(name):
|
def import_warns_freethreaded(name):
|
||||||
if name not in sys.modules and not getattr(sys, "_is_gil_enabled", lambda: True)():
|
if name not in sys.modules and not env.sys_is_gil_enabled():
|
||||||
with pytest.warns(
|
with pytest.warns(
|
||||||
RuntimeWarning, match=f"has been enabled to load module '{name}'"
|
RuntimeWarning, match=f"has been enabled to load module '{name}'"
|
||||||
):
|
):
|
||||||
|
|||||||
@@ -199,8 +199,14 @@ def _run_in_process(target, *args, **kwargs):
|
|||||||
if process.exitcode is None:
|
if process.exitcode is None:
|
||||||
assert t_delta > 0.9 * timeout
|
assert t_delta > 0.9 * timeout
|
||||||
msg = "DEADLOCK, most likely, exactly what this test is meant to detect."
|
msg = "DEADLOCK, most likely, exactly what this test is meant to detect."
|
||||||
if env.PYPY and env.WIN:
|
soabi = sysconfig.get_config_var("SOABI")
|
||||||
pytest.skip(msg)
|
if env.WIN and env.PYPY:
|
||||||
|
pytest.xfail(f"[TEST-GIL-SCOPED] {soabi} PyPy: " + msg)
|
||||||
|
if env.MACOS:
|
||||||
|
if not env.sys_is_gil_enabled():
|
||||||
|
pytest.xfail(f"[TEST-GIL-SCOPED] {soabi} with GIL disabled: " + msg)
|
||||||
|
if env.PY_GIL_DISABLED:
|
||||||
|
pytest.xfail(f"[TEST-GIL-SCOPED] {soabi}: " + msg)
|
||||||
raise RuntimeError(msg)
|
raise RuntimeError(msg)
|
||||||
return process.exitcode
|
return process.exitcode
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in New Issue
Block a user