From 6e8c7a959739332142cf6413c7d8e21695bfddb8 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:16:36 -0500 Subject: [PATCH] add analysis and coverage to CDash reports (#4938) * Add sanitzers and coverage workflows * add UndefinedBehavior sanitize --- .github/workflows/cmake-analysis.yml | 419 +++++++++++++++++++++++++++ .github/workflows/cmake-script.yml | 108 +------ .github/workflows/daily-build.yml | 20 +- .github/workflows/daily-schedule.yml | 16 + CMakeLists.txt | 2 + config/cmake/ConfigureChecks.cmake | 7 +- config/sanitizer/code-coverage.cmake | 4 + config/toolchain/intel.cmake | 6 +- src/H5VLpassthru.c | 7 - src/H5system.c | 18 +- 10 files changed, 473 insertions(+), 134 deletions(-) create mode 100644 .github/workflows/cmake-analysis.yml create mode 100644 .github/workflows/daily-schedule.yml diff --git a/.github/workflows/cmake-analysis.yml b/.github/workflows/cmake-analysis.yml new file mode 100644 index 00000000000..58eb6ce584f --- /dev/null +++ b/.github/workflows/cmake-analysis.yml @@ -0,0 +1,419 @@ +name: hdf5 dev ctest analysis runs + +# Triggers the workflow on a call from another workflow +on: + workflow_call: + inputs: + snap_name: + description: 'The name in the source tarballs' + type: string + required: false + default: hdfsrc + file_base: + description: "The common base name of the source tarballs" + required: true + type: string + use_environ: + description: 'Environment to locate files' + type: string + required: true + default: snapshots + +permissions: + contents: read + +jobs: + coverage_test_linux_GCC: + # Linux (Ubuntu) w/ gcc + coverage + # + name: "Ubuntu GCC Coverage" + runs-on: ubuntu-latest + steps: + - name: Install CMake Dependencies (Linux_coverage) + run: | + sudo apt update + sudo apt-get install ninja-build doxygen graphviz curl libncurses5 build-essential + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt-get install lcov -q -y + + - name: Set file base name (Linux_coverage) + id: set-file-base + run: | + FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") + echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'release' ]] + then + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") + else + SOURCE_NAME_BASE=$(echo "hdfsrc") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT + + # Get files created by release script + - name: Get tgz-tarball (Linux_coverage) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: tgz-tarball + path: ${{ github.workspace }} + + - name: List files for the space (Linux_coverage) + run: | + ls -l ${{ github.workspace }} + ls ${{ runner.workspace }} + + - name: Uncompress source (Linux_coverage) + run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz + + - name: Copy script files for the space (Linux_coverage) + run: | + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5 + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5 + + - name: List files for the hdf5 (Linux_coverage) + run: | + ls ${{ runner.workspace }}/hdf5 + + - name: Create options file (Linux_coverage) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}") + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (LOCAL_COVERAGE_TEST "TRUE") + set (LOCAL_USE_GCOV "TRUE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_LIBS:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_COVERAGE:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCODE_COVERAGE:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") + + - name: Run ctest (Linux_coverage) + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH_COV,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log + shell: bash + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Linux_coverage) + uses: actions/upload-artifact@v4 + with: + name: clang-coverage-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + build_and_test_linux_LeakSanitizer: + # Linux (Ubuntu) w/ clang + LeakSanitizer + # + name: "Ubuntu Clang LeakSanitizer" + runs-on: ubuntu-latest + steps: + - name: Install CMake Dependencies (Linux_Leak) + run: | + sudo apt update + sudo apt-get install ninja-build doxygen graphviz curl libncurses5 + + - name: add clang to env + uses: KyleMayes/install-llvm-action@v2.0.5 + id: setup-clang + with: + env: true + version: '18' + + - name: Set file base name (Linux_Leak) + id: set-file-base + run: | + FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") + echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'release' ]] + then + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") + else + SOURCE_NAME_BASE=$(echo "hdfsrc") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT + + # Get files created by release script + - name: Get tgz-tarball (Linux_Leak) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: tgz-tarball + path: ${{ github.workspace }} + + - name: List files for the space (Linux_Leak) + run: | + ls -l ${{ github.workspace }} + ls ${{ runner.workspace }} + + - name: Uncompress source (Linux_Leak) + run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz + + - name: Copy script files for the space (Linux_Leak) + run: | + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5 + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5 + + - name: List files for the hdf5 (Linux_Leak) + run: | + ls ${{ runner.workspace }}/hdf5 + + - name: Create options file (Linux_Leak) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}") + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (MODEL "Sanitize") + set (GROUP "Sanitize") + set (LOCAL_MEMCHECK_TEST "TRUE") + set (CTEST_MEMORYCHECK_TYPE "LeakSanitizer") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_LIBS:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SANITIZERS:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DUSE_SANITIZER:STRING=Leak") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + + - name: Run ctest (Linux_Leak) + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-LEAK,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log + shell: bash + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Linux_Leak) + uses: actions/upload-artifact@v4 + with: + name: leak-ubuntu-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + build_and_test_linux_AddressSanitizer: + # Linux (Ubuntu) w/ clang + AddressSanitizer + # + name: "Ubuntu Clang AddressSanitizer" + runs-on: ubuntu-latest + steps: + - name: Install CMake Dependencies (Linux_Address) + run: | + sudo apt update + sudo apt-get install ninja-build doxygen graphviz curl libncurses5 + + - name: add clang to env + uses: KyleMayes/install-llvm-action@v2.0.5 + id: setup-clang + with: + env: true + version: '18' + + - name: Set file base name (Linux_Address) + id: set-file-base + run: | + FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") + echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'release' ]] + then + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") + else + SOURCE_NAME_BASE=$(echo "hdfsrc") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT + + # Get files created by release script + - name: Get tgz-tarball (Linux_Address) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: tgz-tarball + path: ${{ github.workspace }} + + - name: List files for the space (Linux_Address) + run: | + ls -l ${{ github.workspace }} + ls ${{ runner.workspace }} + + - name: Uncompress source (Linux_Address) + run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz + + - name: Copy script files for the space (Linux_Address) + run: | + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5 + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5 + + - name: List files for the hdf5 (Linux_Address) + run: | + ls ${{ runner.workspace }}/hdf5 + + - name: Create options file (Linux_Address) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}") + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (MODEL "Sanitize") + set (GROUP "Sanitize") + set (LOCAL_MEMCHECK_TEST "TRUE") + set (CTEST_MEMORYCHECK_TYPE "AddressSanitizer") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_LIBS:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SANITIZERS:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DUSE_SANITIZER:STRING=Address") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + + - name: Run ctest (Linux_Address) + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-ADDR,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log + shell: bash + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Linux_Address) + uses: actions/upload-artifact@v4 + with: + name: address-ubuntu-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + build_and_test_linux_UndefinedBehaviorSanitizer: + # Linux (Ubuntu) w/ clang + UndefinedBehaviorSanitizer + # + name: "Ubuntu Clang UndefinedBehaviorSanitizer" + runs-on: ubuntu-latest + steps: + - name: Install CMake Dependencies (Linux_UndefinedBehavior) + run: | + sudo apt update + sudo apt-get install ninja-build doxygen graphviz curl libncurses5 + + - name: add clang to env + uses: KyleMayes/install-llvm-action@v2.0.5 + id: setup-clang + with: + env: true + version: '18' + + - name: Set file base name (Linux_UndefinedBehavior) + id: set-file-base + run: | + FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") + echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'release' ]] + then + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") + else + SOURCE_NAME_BASE=$(echo "hdfsrc") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT + + # Get files created by release script + - name: Get tgz-tarball (Linux_UndefinedBehavior) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: tgz-tarball + path: ${{ github.workspace }} + + - name: List files for the space (Linux_UndefinedBehavior) + run: | + ls -l ${{ github.workspace }} + ls ${{ runner.workspace }} + + - name: Uncompress source (Linux_UndefinedBehavior) + run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz + + - name: Copy script files for the space (Linux_UndefinedBehavior) + run: | + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5 + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5 + + - name: List files for the hdf5 (Linux_UndefinedBehavior) + run: | + ls ${{ runner.workspace }}/hdf5 + + - name: Create options file (Linux_UndefinedBehavior) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}") + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (MODEL "Sanitize") + set (GROUP "Sanitize") + set (LOCAL_MEMCHECK_TEST "TRUE") + set (CTEST_MEMORYCHECK_TYPE "UndefinedBehaviorSanitizer") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_LIBS:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SANITIZERS:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DUSE_SANITIZER:STRING=Undefined") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + + - name: Run ctest (Linux_UndefinedBehavior) + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-UNDEF,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Debug -VV -O hdf5.log + shell: bash + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Linux_UndefinedBehavior) + uses: actions/upload-artifact@v4 + with: + name: undefined-ubuntu-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` diff --git a/.github/workflows/cmake-script.yml b/.github/workflows/cmake-script.yml index 35541279595..f30504f10da 100644 --- a/.github/workflows/cmake-script.yml +++ b/.github/workflows/cmake-script.yml @@ -490,9 +490,7 @@ jobs: env: FC: ${{ steps.setup-fortran.outputs.fc }} CC: ${{ steps.setup-fortran.outputs.cc }} - CXX: ${{ steps.setup-fortran.outputs.cxx }} - BINSIGN: ${{ needs.check-secret.outputs.sign-state }} - SIGNTOOLDIR: ${{ github.workspace }}/Microsoft.Windows.SDK.BuildTools/bin/10.0.22621.0/x64 + CXX: ${{ steps.setup-fortran.outputs.cc }} run: | cd "${{ runner.workspace }}/hdf5" ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Intel,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log @@ -603,110 +601,6 @@ jobs: if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` ####### clang builds - build_and_test_win_clang: - # Windows w/ clang + CMake - # - name: "Windows ClangCL CTest" - runs-on: windows-latest - steps: - - name: Install Dependencies (Windows_clang) - run: choco install ninja - - - name: add clang to env - uses: KyleMayes/install-llvm-action@v2.0.5 - id: setup-clang - with: - env: true - version: '18' - - - name: Set file base name (Windows_clang) - id: set-file-base - run: | - FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") - echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - if [[ '${{ inputs.use_environ }}' == 'release' ]] - then - SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") - else - SOURCE_NAME_BASE=$(echo "hdfsrc") - fi - echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT - shell: bash - - # Get files created by release script - - name: Get zip-tarball (Windows_clang) - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - name: zip-tarball - path: ${{ github.workspace }} - - - name: using powershell - shell: pwsh - run: Get-Location - - - name: List files for the space (Windows_clang) - run: | - Get-ChildItem -Path ${{ github.workspace }} - Get-ChildItem -Path ${{ runner.workspace }} - shell: pwsh - - - name: Uncompress source (Windows_clang) - working-directory: ${{ github.workspace }} - run: 7z x ${{ steps.set-file-base.outputs.FILE_BASE }}.zip - shell: bash - - - name: Copy script files for the space (Windows_clang) - run: | - Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake -Destination ${{ runner.workspace }}/hdf5/ - Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake -Destination ${{ runner.workspace }}/hdf5/ - shell: pwsh - - - name: List files for the hdf5 (Windows_clang) - run: | - Get-ChildItem -Path ${{ runner.workspace }}/hdf5 - shell: pwsh - - - name: Create options file (Windows_clang) - uses: "DamianReeves/write-file-action@master" - with: - path: ${{ runner.workspace }}/hdf5/HDF5options.cmake - write-mode: overwrite - contents: | - set (CTEST_DROP_SITE_INIT "my.cdash.org") - # Change following line to submit to your CDash dashboard to a different CDash project - #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") - set (SITE_BUILDNAME_SUFFIX "${{ steps.set-file-base.outputs.FILE_BASE }}") - #set (CMAKE_GENERATOR_TOOLSET "ClangCL") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") - #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/clang.cmake") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=ON") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") - - - name: Run ctest (Windows_clang) with clang - env: - BINSIGN: ${{ needs.check-secret.outputs.sign-state }} - SIGNTOOLDIR: ${{ github.workspace }}/Microsoft.Windows.SDK.BuildTools/bin/10.0.22621.0/x64 - run: | - cd "${{ runner.workspace }}/hdf5" - ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Clang,LOCAL_SUBMIT=ON,NINJA=TRUE,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log - shell: pwsh - continue-on-error: true - - # Save log files created by ctest script - - name: Save log (Windows_clang) - uses: actions/upload-artifact@v4 - with: - name: clang-win-log - path: ${{ runner.workspace }}/hdf5/hdf5.log - if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - build_and_test_linux_clang: # Linux (Ubuntu) w/ clang + CMake # diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index ef98e353ab2..65150c5f3ec 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -1,6 +1,7 @@ name: hdf5 dev daily build -# Triggers the workflow on a schedule or on demand +# Triggers the workflow on demand or on a call from another workflow +# NOTE: inputs must be duplicated between triggers on: workflow_dispatch: inputs: @@ -9,8 +10,13 @@ on: type: string required: false default: check - schedule: - - cron: "6 0 * * *" + workflow_call: + inputs: + use_ignore: + description: 'Ignore has_changes check' + type: string + required: false + default: check permissions: contents: read @@ -61,6 +67,14 @@ jobs: use_environ: snapshots if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} + call-workflow-sanitizers: + needs: [get-old-names, call-workflow-tarball] + uses: ./.github/workflows/cmake-analysis.yml + with: + file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} + use_environ: snapshots + if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} + call-workflow-ctest: needs: [get-old-names, call-workflow-tarball] uses: ./.github/workflows/cmake-ctest.yml diff --git a/.github/workflows/daily-schedule.yml b/.github/workflows/daily-schedule.yml new file mode 100644 index 00000000000..83486c97696 --- /dev/null +++ b/.github/workflows/daily-schedule.yml @@ -0,0 +1,16 @@ +name: hdf5 dev daily build on schedule + +# Triggers the workflow on a schedule or on demand +on: + workflow_dispatch: + schedule: + - cron: "6 0 * * *" + +permissions: + contents: write # In order to allow tag creation and file deletion + +jobs: + daily-build: + uses: ./.github/workflows/daily-build.yml + with: + use_ignore: check diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dc3af4a8ef..5522dc35aad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -600,8 +600,10 @@ option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" O if (HDF5_ENABLE_COVERAGE) include (${HDF5_SOURCE_DIR}/config/sanitizer/code-coverage.cmake) if(CODE_COVERAGE AND CODE_COVERAGE_ADDED) + message(VERBOSE "Add instrumentation to all targets") add_code_coverage () # Adds instrumentation to all targets else () + message(VERBOSE "Use --coverage option") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage") if (CMAKE_C_COMPILER_ID STREQUAL "GNU") diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 6db82bb9229..c13334c5f8c 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -67,6 +67,8 @@ if (WIN32 AND NOT MINGW) set (${HDF_PREFIX}_HAVE_VISUAL_STUDIO 1) endif () endif () + message (TRACE "MSVC=${MSVC}") + message (TRACE "HAVE_VISUAL_STUDIO=${${HDF_PREFIX}_HAVE_VISUAL_STUDIO}") endif () if (WINDOWS) @@ -79,13 +81,12 @@ if (WINDOWS) endif () if (NOT UNIX AND NOT CYGWIN) set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1) - if (MSVC_VERSION GREATER_EQUAL 1900) - set (${HDF_PREFIX}_HAVE_TIMEZONE 1) - endif () + set (${HDF_PREFIX}_HAVE_TIMEZONE 1) set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1) set (${HDF_PREFIX}_HAVE_LIBWS2_32 1) set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1) endif () + message (TRACE "HAVE_TIMEZONE=${${HDF_PREFIX}_HAVE_TIMEZONE}") endif () # ---------------------------------------------------------------------- diff --git a/config/sanitizer/code-coverage.cmake b/config/sanitizer/code-coverage.cmake index 54a33deda3f..5249ed05af1 100644 --- a/config/sanitizer/code-coverage.cmake +++ b/config/sanitizer/code-coverage.cmake @@ -81,9 +81,13 @@ option( # Programs find_program(LLVM_COV_PATH llvm-cov) +message(VERBOSE "program llvm-cov=${LLVM_COV_PATH}") find_program(LLVM_PROFDATA_PATH llvm-profdata) +message(VERBOSE "program llvm-profdata=${LLVM_PROFDATA_PATH}") find_program(LCOV_PATH lcov) +message(VERBOSE "program lcov=${LCOV_PATH}") find_program(GENHTML_PATH genhtml) +message(VERBOSE "program genhtml=${GENHTML_PATH}") # Hide behind the 'advanced' mode flag for GUI/ccmake mark_as_advanced(FORCE LLVM_COV_PATH LLVM_PROFDATA_PATH LCOV_PATH GENHTML_PATH) diff --git a/config/toolchain/intel.cmake b/config/toolchain/intel.cmake index f8f60b28b46..f5b227ba2a0 100644 --- a/config/toolchain/intel.cmake +++ b/config/toolchain/intel.cmake @@ -4,7 +4,11 @@ set(CMAKE_COMPILER_VENDOR "intel") set(CMAKE_C_COMPILER icx) -set(CMAKE_CXX_COMPILER icpx) +if(WIN32) + set(CMAKE_CXX_COMPILER icx) +else() + set(CMAKE_CXX_COMPILER icpx) +endif() set(CMAKE_Fortran_COMPILER ifx) # the following is used if cross-compiling diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c index 8c1de0e6d96..14274ed86c9 100644 --- a/src/H5VLpassthru.c +++ b/src/H5VLpassthru.c @@ -49,13 +49,6 @@ /* (Uncomment to enable) */ /* #define ENABLE_PASSTHRU_LOGGING */ -/* Hack for missing va_copy() in old Visual Studio editions - * (from H5win2_defs.h - used on VS2012 and earlier) - */ -#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1800) -#define va_copy(D, S) ((D) = (S)) -#endif - /************/ /* Typedefs */ /************/ diff --git a/src/H5system.c b/src/H5system.c index 21135bc5da9..2da53d82e55 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -173,14 +173,10 @@ Nflock(int H5_ATTR_UNUSED fd, int H5_ATTR_UNUSED operation) time_t H5_make_time(struct tm *tm) { - time_t the_time; /* The converted time */ -#if defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) /* VS 2015 */ - /* In gcc and in Visual Studio prior to VS 2015 'timezone' is a global - * variable declared in time.h. That variable was deprecated and in - * VS 2015 is removed, with _get_timezone replacing it. - */ + time_t the_time; /* The converted time */ +#if defined(H5_HAVE_VISUAL_STUDIO) long timezone = 0; -#endif /* defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) */ +#endif time_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -203,13 +199,9 @@ H5_make_time(struct tm *tm) /* BSD-like systems */ the_time += tm->tm_gmtoff; #elif defined(H5_HAVE_TIMEZONE) -#if defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) /* VS 2015 */ - /* In gcc and in Visual Studio prior to VS 2015 'timezone' is a global - * variable declared in time.h. That variable was deprecated and in - * VS 2015 is removed, with _get_timezone replacing it. - */ +#if defined(H5_HAVE_VISUAL_STUDIO) _get_timezone(&timezone); -#endif /* defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) */ +#endif the_time -= timezone - (tm->tm_isdst ? 3600 : 0); #else