Skip to content

Commit c7ffe3a

Browse files
committed
Correct fallback test workflow
1 parent a4ac6a5 commit c7ffe3a

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/test-qsort-fallback.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ jobs:
4040
- name: Checkout repository
4141
uses: actions/checkout@v5
4242

43+
- name: Force qsort fallback by modifying ConfigureChecks.cmake
44+
run: |
45+
sed -i.bak '/CHECK_FUNCTION_EXISTS (qsort_r _HAVE_QSORT_R_TMP)/,/^endif ()$/{
46+
/CHECK_FUNCTION_EXISTS (qsort_r _HAVE_QSORT_R_TMP)/c\
47+
# Force qsort fallback for testing\
48+
set(${HDF_PREFIX}_HAVE_QSORT_REENTRANT 0)
49+
/CHECK_FUNCTION_EXISTS (qsort_s _HAVE_QSORT_S_TMP)/d
50+
/if (_HAVE_QSORT_R_TMP OR _HAVE_QSORT_S_TMP)/d
51+
/set (${HDF_PREFIX}_HAVE_QSORT_REENTRANT 1)/d
52+
/^endif ()$/d
53+
}' config/ConfigureChecks.cmake
54+
shell: bash
55+
4356
- name: Set up build dependencies (Ubuntu)
4457
if: runner.os == 'Linux'
4558
run: |
@@ -75,11 +88,6 @@ jobs:
7588
cmake --build . --config Release --parallel 4
7689
shell: bash
7790

78-
- name: Force fallback by disabling H5_HAVE_QSORT_REENTRANT
79-
run: |
80-
sed -i.bak 's/#define H5_HAVE_QSORT_REENTRANT 1/#define H5_HAVE_QSORT_REENTRANT 0/' build/src/H5pubconf.h
81-
shell: bash
82-
8391
- name: Run tests with fallback implementation
8492
run: |
8593
cd build

config/ConfigureChecks.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,6 @@ CHECK_FUNCTION_EXISTS (vasprintf ${HDF_PREFIX}_HAVE_VASPRINTF)
444444
CHECK_FUNCTION_EXISTS (waitpid ${HDF_PREFIX}_HAVE_WAITPID)
445445

446446
# Check for reentrant qsort variants (qsort_r on Unix/BSD, qsort_s on Windows)
447-
# Note: qsort_r has different signatures on GNU/Linux vs BSD/macOS, but we just
448-
# check for existence here. Signature differences will be handled in the code.
449447
CHECK_FUNCTION_EXISTS (qsort_r _HAVE_QSORT_R_TMP)
450448
CHECK_FUNCTION_EXISTS (qsort_s _HAVE_QSORT_S_TMP)
451449
if (_HAVE_QSORT_R_TMP OR _HAVE_QSORT_S_TMP)

0 commit comments

Comments
 (0)