Skip to content

Commit

Permalink
Patch over buggy library behavior in Julia CI
Browse files Browse the repository at this point in the history
A recent fix for H5Oexists(_by_name) changes the returned value of
the API call when checking for a non-existent object with a file
ID (FAIL should be false). The Julia CI explicitly tests for the
buggy result.

We've notified the maintainers and this source patch will fix
the issue for our CI until it is fixed upstream.
  • Loading branch information
derobins committed Oct 23, 2024
1 parent ed4419c commit bd216d9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 22 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/autotools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,15 @@ jobs:
with:
build_mode: "production"

call-release-auto-cygwin:
name: "Autotools Cygwin Workflows"
uses: ./.github/workflows/cygwin-auto.yml
with:
build_mode: "production"

call-release-auto-xpr:
name: "Autotools TestExpress Workflows"
uses: ./.github/workflows/testxpr-auto.yml

# call-release-auto-julia:
# name: "Autotools Julia Workflows"
# uses: ./.github/workflows/julia-auto.yml
# with:
# build_mode: "production"
call-release-auto-julia:
name: "Autotools Julia Workflows"
uses: ./.github/workflows/julia-auto.yml
with:
build_mode: "production"

# workflow-msys2-autotools:
# name: "CMake msys2 Workflows"
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,12 @@ jobs:
with:
build_mode: "Release"

call-release-cmake-cygwin:
name: "CMake Cygwin Workflows"
uses: ./.github/workflows/cygwin-cmake.yml
with:
build_mode: "Release"

call-release-cmake-xpr:
name: "CMake TestExpress Workflows"
uses: ./.github/workflows/testxpr-cmake.yml

# call-release-cmake-julia:
# name: "CMake Julia Workflows"
# uses: ./.github/workflows/julia-cmake.yml
# with:
# build_mode: "Release"
call-release-cmake-julia:
name: "CMake Julia Workflows"
uses: ./.github/workflows/julia-cmake.yml
with:
build_mode: "Release"
3 changes: 3 additions & 0 deletions .github/workflows/julia-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ jobs:
repository: JuliaIO/HDF5.jl
path: .

- name: Patch Julia CI
run: git apply ${{ github.workspace }}/.github/workflows/julia_ci.patch -v

- name: Generate LocalPreferences
run: |
echo '[HDF5]' >> LocalPreferences.toml
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/julia-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
repository: JuliaIO/HDF5.jl
path: .

- name: Patch Julia CI
run: git apply ${{ github.workspace }}/.github/workflows/julia_ci.patch -v

- name: Generate LocalPreferences
run: |
echo '[HDF5]' >> LocalPreferences.toml
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/julia_ci.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/test/objects.jl b/test/objects.jl
index d68dd749..0541e91a 100644
--- a/test/objects.jl
+++ b/test/objects.jl
@@ -16,7 +16,13 @@ using HDF5.API
h5open(fn, "r") do h5f
@test API.h5o_exists_by_name(h5f, "data")
@test API.h5o_exists_by_name(h5f, "lore")
- @test_throws API.H5Error API.h5o_exists_by_name(h5f, "noonian")
+ @static if HDF5.API.h5_get_libversion() <= v"1.14.5"
+ # Buggy behavior in earlier versions of HDF5 returns FAIL (-1)
+ @test_throws API.H5Error API.h5o_exists_by_name(h5f, "noonian")
+ else
+ # The correct behavior is to return false (0)
+ @test API.h5o_exists_by_name(h5f, "noonian") == 0
+ end

loc_id = API.h5o_open(h5f, "data", API.H5P_DEFAULT)
try

0 comments on commit bd216d9

Please sign in to comment.