-
-
Notifications
You must be signed in to change notification settings - Fork 311
Implement fallback for systems without qsort_r #5931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mattjala
wants to merge
15
commits into
HDFGroup:develop
Choose a base branch
from
mattjala:qsort_fallback
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+260
−6
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c2775cc
Add re-entrant qsort detection
mattjala 2ef412f
Implement fallback for re-entrant qsort
mattjala 601012d
Add FreeBSD test workflow
mattjala 817dbb8
Test different FreeBSD versions
mattjala 38da26d
Add workflow for qsort_r fallback
mattjala a4ac6a5
Fix FreeBSD <14.0 rtree usage
mattjala c7ffe3a
Correct fallback test workflow
mattjala 337bdcf
Drop FreeBSD 13.5 testing
mattjala c56ca00
Add error checking to TS functions
mattjala 3895bca
Re-add FreeBSD 13.5
mattjala 6b00fcf
Return error code from HDqsort_r
mattjala 017ae72
Add NetBSD 10 workflow
mattjala 82447cf
Use OpenBSD 7.5 for qsort_r fallback verification instead
mattjala 4f6b8cb
Remove assert
mattjala b093928
Remove threadsafe qsort_r implementation
mattjala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: FreeBSD CI | ||
|
|
||
| # Triggers the workflow on push or pull request or on demand | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| pull_request: | ||
| branches: [ develop ] | ||
| paths-ignore: | ||
| - '.github/CODEOWNERS' | ||
| - '.github/FUNDING.yml' | ||
| - 'doc/**' | ||
| - 'release_docs/**' | ||
| - 'ACKNOWLEDGEMENTS' | ||
| - 'LICENSE**' | ||
| - '**.md' | ||
|
|
||
| # Using concurrency to cancel any in-progress job or run | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| freebsd-build-and-test: | ||
| runs-on: ubuntu-latest | ||
| name: FreeBSD ${{ matrix.freebsd-version }} Build and Test | ||
|
|
||
| # Don't run the action if the commit message says to skip CI | ||
| if: "!contains(github.event.head_commit.message, 'skip-ci')" | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| freebsd-version: ['13.5', '14.3', '15.0'] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Build and test on FreeBSD | ||
| uses: vmactions/freebsd-vm@v1 | ||
| with: | ||
| release: ${{ matrix.freebsd-version }} | ||
| usesh: true | ||
| prepare: | | ||
| pkg install -y cmake ninja pkgconf bash curl | ||
| run: | | ||
| set -e | ||
|
|
||
| # Configure the build | ||
| mkdir build | ||
| cd build | ||
| cmake -C ../config/cmake/cacheinit.cmake \ | ||
| -G Ninja \ | ||
| --log-level=VERBOSE \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DBUILD_SHARED_LIBS:BOOL=ON \ | ||
| -DHDF5_ENABLE_ALL_WARNINGS:BOOL=ON \ | ||
| -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ | ||
| -DHDF5_BUILD_CPP_LIB:BOOL=ON \ | ||
| -DHDF5_BUILD_FORTRAN:BOOL=OFF \ | ||
| -DHDF5_BUILD_JAVA:BOOL=OFF \ | ||
| -DHDF5_BUILD_DOC:BOOL=OFF \ | ||
| -DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON \ | ||
| -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON \ | ||
| -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF \ | ||
| -DZLIB_USE_LOCALCONTENT:BOOL=OFF \ | ||
| -DHDF5_TEST_API:BOOL=ON \ | ||
| -DHDF5_TEST_SHELL_SCRIPTS:BOOL=OFF \ | ||
| -DENABLE_EXTENDED_TESTS:BOOL=OFF \ | ||
| .. | ||
| echo "" | ||
|
|
||
| # Build | ||
| cmake --build . --parallel 3 --config Release | ||
| echo "" | ||
|
|
||
| # Run tests | ||
| ctest . --parallel 2 -C Release -V | ||
| echo "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: OpenBSD CI | ||
|
|
||
| # Triggers the workflow on push or pull request or on demand | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| pull_request: | ||
| branches: [ develop ] | ||
| paths-ignore: | ||
| - '.github/CODEOWNERS' | ||
| - '.github/FUNDING.yml' | ||
| - 'doc/**' | ||
| - 'release_docs/**' | ||
| - 'ACKNOWLEDGEMENTS' | ||
| - 'LICENSE**' | ||
| - '**.md' | ||
|
|
||
| # Using concurrency to cancel any in-progress job or run | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| openbsd-build-and-test: | ||
| runs-on: ubuntu-latest | ||
| name: OpenBSD ${{ matrix.openbsd-version }} Build and Test | ||
|
|
||
| # Don't run the action if the commit message says to skip CI | ||
| if: "!contains(github.event.head_commit.message, 'skip-ci')" | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| openbsd-version: ['7.5'] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Build and test on OpenBSD | ||
| uses: vmactions/openbsd-vm@v1 | ||
| with: | ||
| release: ${{ matrix.openbsd-version }} | ||
| usesh: true | ||
| prepare: | | ||
| echo "https://ftp.openbsd.org/pub/OpenBSD" > /etc/installurl | ||
| pkg_add cmake gmake pkgconf curl gcc-11.2.0p11 | ||
| run: | | ||
| set -e | ||
|
|
||
| # Set up library path for gcc | ||
| export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH | ||
|
|
||
| # Get number of processors (OpenBSD uses sysctl in /sbin) | ||
| NPROC=$(/sbin/sysctl -n hw.ncpu) | ||
| echo "Number of processors: $NPROC" | ||
|
|
||
| # Configure the build | ||
| mkdir build | ||
| cd build | ||
| cmake -C ../config/cmake/cacheinit.cmake \ | ||
| --log-level=VERBOSE \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_C_COMPILER=egcc \ | ||
| -DCMAKE_CXX_COMPILER=eg++ \ | ||
| -DCMAKE_MAKE_PROGRAM=gmake \ | ||
| -DBUILD_SHARED_LIBS:BOOL=ON \ | ||
| -DHDF5_ENABLE_ALL_WARNINGS:BOOL=ON \ | ||
| -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ | ||
| -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ | ||
| -DHDF5_BUILD_FORTRAN:BOOL=OFF \ | ||
| -DHDF5_BUILD_JAVA:BOOL=OFF \ | ||
| -DHDF5_BUILD_DOC:BOOL=OFF \ | ||
| -DHDF5_BUILD_HL_LIB:BOOL=OFF \ | ||
| -DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON \ | ||
| -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON \ | ||
| -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF \ | ||
| -DZLIB_USE_LOCALCONTENT:BOOL=OFF \ | ||
| -DHDF5_TEST_API:BOOL=ON \ | ||
| -DHDF5_TEST_SHELL_SCRIPTS:BOOL=OFF \ | ||
| -DENABLE_EXTENDED_TESTS:BOOL=OFF \ | ||
| .. | ||
| echo "" | ||
|
|
||
| # Build | ||
| cmake --build . --parallel $NPROC | ||
| echo "" | ||
|
|
||
| # Run tests | ||
| ctest . --parallel $NPROC | ||
| echo "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the near future we should probably move this into something we try to check at configure time. I imagine there are other platforms that use this signature and checking at configure time should get rid of platform-specific #ifdefs and also avoid needing the (probably minor) overhead of a fallback function. Maybe something like https://gitlab.gnome.org/GNOME/glib/-/blob/2.30.0/configure.ac?ref_type=tags#L589-627.