Skip to content

Commit

Permalink
ci: sync upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoklee committed Aug 27, 2024
2 parents fb14699 + 04bf2df commit 52be16b
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 28 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/autotools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ jobs:
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"

# workflow-msys2-autotools:
# name: "CMake msys2 Workflows"
# uses: ./.github/workflows/msys2-auto.yml
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,9 @@ jobs:
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"

3 changes: 2 additions & 1 deletion .github/workflows/intel-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
$GITHUB_WORKSPACE/configure \
--enable-build-mode=${{ inputs.build_mode }} \
--enable-shared \
--disable-fortran
--enable-cxx \
--enable-fortran
- name: Autotools Build
shell: bash
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/intel-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
run: |
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \
-G Ninja \
--log-level=VERBOSE \
cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake -G Ninja --log-level=VERBOSE \
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DHDF5_BUILD_FORTRAN:BOOL=ON \
-DHDF5_BUILD_CPP_LIB:BOOL=ON \
-DLIBAEC_USE_LOCALCONTENT=OFF \
-DZLIB_USE_LOCALCONTENT=OFF \
$GITHUB_WORKSPACE
${{ github.workspace }}
- name: CMake Build (Linux)
shell: bash
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
run: |
mkdir "${{ runner.workspace }}/build"
Set-Location -Path "${{ runner.workspace }}\\build"
cmake -C ${{ github.workspace }}/config/cmake/cacheinit.cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} -DHDF5_BUILD_FORTRAN=ON -DLIBAEC_USE_LOCALCONTENT=OFF -DZLIB_USE_LOCALCONTENT=OFF ${{ github.workspace }}
cmake -C ${{ github.workspace }}/config/cmake/cacheinit.cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} -DHDF5_BUILD_FORTRAN=ON -DHDF5_BUILD_CPP_LIB=ON -DLIBAEC_USE_LOCALCONTENT=OFF -DZLIB_USE_LOCALCONTENT=OFF ${{ github.workspace }}
- name: CMake Build (Windows)
shell: pwsh
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/julia-auto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: hdf5 dev autotools julia

on:
workflow_call:
inputs:
build_mode:
description: "release vs. debug build"
required: true
type: string

permissions:
contents: read

jobs:
julia_build_and_test:
name: "julia ${{ inputs.build_mode }}"
runs-on: ubuntu-latest
steps:
- name: Get Sources
uses: actions/checkout@v4.1.1

- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install autoconf automake libtool libtool-bin libaec-dev
sudo apt-get install doxygen graphviz
sudo apt install -y zlib1g-dev libcurl4-openssl-dev libjpeg-dev wget curl bzip2
sudo apt install -y m4 flex bison cmake libzip-dev openssl build-essential
- name: Autotools Configure
shell: bash
run: |
sh ./autogen.sh
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
$GITHUB_WORKSPACE/configure \
--enable-build-mode=${{ inputs.build_mode }} \
--disable-fortran \
--enable-shared \
--disable-parallel \
--prefix=/tmp
- name: Autotools Build
shell: bash
run: |
make -j3
working-directory: ${{ runner.workspace }}/build

- name: Install HDF5
shell: bash
run: |
make install
working-directory: ${{ runner.workspace }}/build

- name: Install julia
uses: julia-actions/setup-julia@latest
with:
version: '1.6'
arch: 'x64'

- name: Get julia hdf5 source
uses: actions/checkout@v4.1.1
with:
repository: JuliaIO/HDF5.jl
path: .

- name: Generate LocalPreferences
run: |
echo '[HDF5]' >> LocalPreferences.toml
echo 'libhdf5 = "/tmp/lib/libhdf5.so"' >> LocalPreferences.toml
echo 'libhdf5_hl = "/tmp/lib/libhdf5_hl.so"' >> LocalPreferences.toml
- uses: julia-actions/julia-buildpkg@latest

- name: Julia Run Tests
uses: julia-actions/julia-runtest@latest
env:
JULIA_DEBUG: Main
82 changes: 82 additions & 0 deletions .github/workflows/julia-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: hdf5 dev CMake julia

on:
workflow_call:
inputs:
build_mode:
description: "release vs. debug build"
required: true
type: string

permissions:
contents: read

jobs:
julia_build_and_test:
name: "julia ${{ inputs.build_mode }}"
runs-on: ubuntu-latest
steps:
- name: Get Sources
uses: actions/checkout@v4.1.1

- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install ninja-build doxygen graphviz
sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev
sudo apt install -y libaec-dev zlib1g-dev wget curl bzip2 flex bison cmake libzip-dev openssl build-essential
- name: CMake Configure
shell: bash
run: |
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake -G Ninja \
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \
-DHDF5_ENABLE_PARALLEL:BOOL=OFF \
-DHDF5_BUILD_CPP_LIB:BOOL=OFF \
-DLIBAEC_USE_LOCALCONTENT=OFF \
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_BUILD_FORTRAN:BOOL=OFF \
-DHDF5_BUILD_JAVA:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=/tmp \
$GITHUB_WORKSPACE
- name: CMake Build
shell: bash
run: |
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
working-directory: ${{ runner.workspace }}/build

- name: Install HDF5
shell: bash
run: |
cmake --install .
working-directory: ${{ runner.workspace }}/build

- name: Install julia
uses: julia-actions/setup-julia@latest
with:
version: '1.6'
arch: 'x64'

- name: Get julia hdf5 source
uses: actions/checkout@v4.1.1
with:
repository: JuliaIO/HDF5.jl
path: .

- name: Generate LocalPreferences
run: |
echo '[HDF5]' >> LocalPreferences.toml
echo 'libhdf5 = "/tmp/lib/libhdf5.so"' >> LocalPreferences.toml
echo 'libhdf5_hl = "/tmp/lib/libhdf5_hl.so"' >> LocalPreferences.toml
- uses: julia-actions/julia-buildpkg@latest

- name: Julia Run Tests
uses: julia-actions/julia-runtest@latest
env:
JULIA_DEBUG: Main
12 changes: 11 additions & 1 deletion src/H5VLcallback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,18 +1744,28 @@ H5VL__attr_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req)
herr_t
H5VL_attr_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
bool vol_wrapper_set = false; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */

FUNC_ENTER_NOAPI(FAIL)

/* Sanity check */
assert(vol_obj);

/* Set wrapper info in API context */
if (H5VL_set_vol_wrapper(vol_obj) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info");
vol_wrapper_set = true;

/* Call the corresponding internal VOL routine */
if (H5VL__attr_close(vol_obj->data, vol_obj->connector->cls, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "attribute close failed");

done:
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info");

FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_attr_close() */

Expand Down
35 changes: 14 additions & 21 deletions test/tfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8104,45 +8104,38 @@ test_min_dset_ohdr(void)
/****************************************************************
**
** test_unseekable_file():
** Test that attempting to open an unseekable file fails gracefully
** Test that attempting to create/open an unseekable file fails gracefully
** without a segfault (see hdf5#1498)
****************************************************************/
static void
test_unseekable_file(void)
{
hid_t file_id = H5I_INVALID_HID; /* File ID */

/* Output message about test being performed */
MESSAGE(5, ("Testing creating/opening an unseekable file\n"));

/* Creation */
#ifdef H5_HAVE_WIN32_API
file_id = H5Fcreate("NUL", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
#else
file_id = H5Fcreate("/dev/null", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
#endif

H5Fclose(file_id);
/* Flush message in case this test segfaults */
fflush(stdout);

/* Open, truncate */
/* Creation */
#ifdef H5_HAVE_WIN32_API
file_id = H5Fopen("NUL", H5F_ACC_TRUNC, H5P_DEFAULT);
H5Fcreate("NUL", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
#else
file_id = H5Fopen("/dev/null", H5F_ACC_TRUNC, H5P_DEFAULT);
H5Fcreate("/dev/null", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
#endif

H5Fclose(file_id);
/* Should fail without segfault */
/* TODO - Does not properly fail on all systems */
/* VERIFY(file_id, H5I_INVALID_HID, "H5Fcreate"); */

/* Open, RDWR */
/* Opening */
#ifdef H5_HAVE_WIN32_API
file_id = H5Fopen("NUL", H5F_ACC_RDWR, H5P_DEFAULT);
H5Fopen("NUL", H5F_ACC_RDWR, H5P_DEFAULT);
#else
file_id = H5Fopen("/dev/null", H5F_ACC_RDWR, H5P_DEFAULT);
H5Fopen("/dev/null", H5F_ACC_RDWR, H5P_DEFAULT);
#endif

H5Fclose(file_id);

exit(EXIT_SUCCESS);
/* TODO - Does not properly fail on all systems */
/* VERIFY(file_id, H5I_INVALID_HID, "H5Fopen"); */
}
/****************************************************************
**
Expand Down

0 comments on commit 52be16b

Please sign in to comment.