Skip to content

Commit 2b0bfe5

Browse files
Build HDF5 from source in wheels to avoid vulnerablity
CI workflow: remove system hdf5-devel install and instead download, configure and build HDF5 2.0.0 from source (cmake configure/build/install) due to distro security/maintenance concerns
1 parent d8496b8 commit 2b0bfe5

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/github-actions.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ jobs:
168168
- name: Build wheels
169169
# Cannot use a more recent version than v2.22.0 because of fetpapi wheel which uses AVRO which cannot be built with GNU 14.
170170
uses: pypa/cibuildwheel@v2.22.0
171+
# RedHat nor Debian maintain security patches for hdf5. We consequently build the latest HDF5 version.
171172
env:
172173
CIBW_BUILD: cp38-manylinux_* cp39-manylinux_* cp310-manylinux_* cp311-manylinux_* cp312-manylinux_* cp313-manylinux_*
173174
CIBW_ARCHS: auto64
@@ -177,10 +178,20 @@ jobs:
177178
yum search epel-release &&
178179
yum info epel-release &&
179180
yum install -y epel-release &&
180-
yum --enablerepo=epel install -y minizip1.2-devel hdf5-devel cmake3 &&
181+
yum --enablerepo=epel install -y minizip1.2-devel cmake3 &&
182+
wget --no-verbose https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/hdf5-2.0.0.tar.gz &&
183+
tar -xzf hdf5-2.0.0.tar.gz &&
184+
cd hdf5-2.0.0 &&
181185
mkdir build &&
182186
cd build &&
183-
cmake3 -DCMAKE_BUILD_TYPE=Release -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX:STRING=/fesapi-install {project} &&
187+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DHDF5_ENABLE_PARALLEL:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_GENERATORS:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_UTILS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DCMAKE_INSTALL_PREFIX:STRING=${{ github.workspace }}/../hdf5-install .. &&
188+
cmake --build . --config Release &&
189+
make -j4 &&
190+
make install &&
191+
cd ../.. &&
192+
mkdir build &&
193+
cd build &&
194+
cmake3 -DCMAKE_BUILD_TYPE=Release -DHDF5_ROOT=${{ github.workspace }}/../hdf5-install -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX:STRING=/fesapi-install {project} &&
184195
cmake3 --build . -j2 --config Release &&
185196
cmake3 --install .
186197
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >

example/example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5786,7 +5786,7 @@ void appendAContinuousProp(const string& filePath)
57865786
}
57875787

57885788
// filepath is defined in a macro to better check memory leak
5789-
#define filePath u8"../../testingPackageCpp22.epc"
5789+
#define filePath u8"../../testingPackageCpp.epc"
57905790
int main()
57915791
{
57925792
try {

0 commit comments

Comments
 (0)