@@ -188,6 +188,9 @@ jobs:
188188 cd .. && \
189189 rm -rf libffi-3.4.6
190190 CIBW_ENVIRONMENT_PASS_LINUX : CFLAGS # ensure that the build container can see our overridden build config
191+ CIBW_ENVIRONMENT : >-
192+ CPPFLAGS="$CPPFLAGS ${{ env.skip_artifact_upload == 'true' && '-UNDEBUG' || '-DNDEBUG' }}"
193+ CFFI_TEST_ASSERTIONS=${{ env.skip_artifact_upload == 'true' && '1' || '0' }}
191194 CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.manylinux_img || 'manylinux2014' }}
192195 CIBW_MANYLINUX_I686_IMAGE : ${{ matrix.manylinux_img || 'manylinux2014' }}
193196 CIBW_MANYLINUX_AARCH64_IMAGE : ${{ matrix.manylinux_img || 'manylinux2014' }}
@@ -287,6 +290,9 @@ jobs:
287290 CIBW_ENABLE : cpython-prerelease
288291 CIBW_TEST_REQUIRES : pytest setuptools meson-python ninja
289292 CIBW_TEST_COMMAND : pip install pip --upgrade; cd {project}; PYTHONUNBUFFERED=1 pytest
293+ CIBW_ENVIRONMENT : >-
294+ CPPFLAGS="$CPPFLAGS ${{ env.skip_artifact_upload == 'true' && '-UNDEBUG' || '-DNDEBUG' }}"
295+ CFFI_TEST_ASSERTIONS=${{ env.skip_artifact_upload == 'true' && '1' || '0' }}
290296 MACOSX_DEPLOYMENT_TARGET : ${{ matrix.deployment_target || '11.0' }}
291297 SDKROOT : ${{ matrix.sdkroot || 'macosx' }}
292298 run : |
@@ -375,6 +381,9 @@ jobs:
375381 CIBW_ENABLE : cpython-prerelease
376382 CIBW_TEST_REQUIRES : pytest setuptools meson-python ninja
377383 CIBW_TEST_COMMAND : ${{ matrix.test_cmd || 'python -m pytest {package}/src/c' }}
384+ CIBW_ENVIRONMENT : >-
385+ _CL_="$_CL_ ${{ env.skip_artifact_upload == 'true' && '/UNDEBUG' || '/DNDEBUG' }}"
386+ CFFI_TEST_ASSERTIONS=${{ env.skip_artifact_upload == 'true' && '1' || '0' }}
378387 # FIXME: /testing takes ~45min on Windows and has some failures...
379388 # CIBW_TEST_COMMAND='python -m pytest {package}/src/c {package}/testing'
380389 run : |
@@ -479,9 +488,12 @@ jobs:
479488 CIBW_TEST_SOURCES : cffi
480489 # Running tests from `testing/` will not work since they try to compile C code on device
481490 CIBW_TEST_COMMAND : python -m pytest -sv cffi/src/c/
491+ # Xcode forwards TEST_RUNNER_ variables into the simulator test process.
492+ CIBW_TEST_ENVIRONMENT : TEST_RUNNER_CFFI_TEST_ASSERTIONS=${{ env.skip_artifact_upload == 'true' && '1' || '0' }}
482493 # Environment variables for the build
483494 CIBW_ENVIRONMENT : >
484495 CFLAGS="-I${LIBFFI_IOS_DIR}/include"
496+ CPPFLAGS="$CPPFLAGS ${{ env.skip_artifact_upload == 'true' && '-UNDEBUG' || '-DNDEBUG' }}"
485497 LDFLAGS="-L${LIBFFI_IOS_DIR}/lib"
486498 PYTHONUNBUFFERED=1
487499 # Pass through our custom env vars
@@ -535,6 +547,10 @@ jobs:
535547
536548 pytest-run-parallel :
537549 needs : make_run_parallel_matrix
550+ env :
551+ CPPFLAGS : -UNDEBUG
552+ _CL_ : /UNDEBUG
553+ CFFI_TEST_ASSERTIONS : ' 1'
538554 strategy :
539555 fail-fast : false
540556 matrix : ${{ fromJSON(needs.make_run_parallel_matrix.outputs.matrix_json) }}
@@ -562,13 +578,17 @@ jobs:
562578 clang_TSAN :
563579 runs-on : ubuntu-24.04
564580 container : ghcr.io/nascheme/numpy-tsan:3.15t-dev
581+ env :
582+ CFLAGS : -g -O0 -fsanitize=thread
583+ CPPFLAGS : -UNDEBUG
584+ CFFI_TEST_ASSERTIONS : ' 1'
565585 steps :
566586 - uses : actions/checkout@v7
567587
568588 - name : build and install
569589 run : |
570590 python -m pip install setuptools meson-python ninja pytest pytest-run-parallel
571- CFLAGS="-g -O3 -fsanitize=thread" python -m pip install -v .
591+ python -m pip install -v .
572592
573593 - name : run tests under pytest-run-parallel
574594 run : |
0 commit comments