Skip to content

Commit f931626

Browse files
authored
Merge pull request #1749 from Idclip/weekly_ci
Fixed the weekly CI, introduce a new build type for the ABI check job
2 parents eaaa68f + 0df00c8 commit f931626

File tree

5 files changed

+69
-48
lines changed

5 files changed

+69
-48
lines changed

.github/workflows/weekly.yml

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ jobs:
162162
matrix:
163163
config:
164164
- { runson: ubuntu-latest, cxx: g++, cmake: '' }
165-
- { runson: ubuntu-latest, cxx: clang++, cmake: '' }
165+
# Disable the clang job for now. See https://github.com/actions/runner-images/issues/8659
166+
# - { runson: ubuntu-latest, cxx: clang++, cmake: '' }
166167
# @todo gcc on macos
167168
- { runson: macos-latest, cxx: '', cmake: '-D CMAKE_CXX_COMPILER=/usr/local/opt/llvm@15/bin/clang++' }
168169
fail-fast: false
@@ -379,74 +380,69 @@ jobs:
379380
#############################################################################
380381

381382
linux-abi-checker:
382-
# v10.0.0 doesn't exist yet, so can't run this automatically.
383383
if: |
384384
github.event_name == 'workflow_dispatch' &&
385385
(github.event.inputs.type == 'all' ||
386386
github.event.inputs.type == 'abi')
387-
# abi-dumper version verified to work with 20.04/GCC9
388-
runs-on: ubuntu-20.04
387+
runs-on: ubuntu-22.04
389388
env:
390-
VDB_MAJOR_VERSION: 10
389+
# The 'abicheck' build type sets these, but older versions of the library
390+
# may not have this build type. See OpenVDBCXX.cmake
391+
CXXFLAGS: "-gdwarf-4 -g3 -ggdb -Og"
391392
steps:
392393
- uses: actions/checkout@v3
393394
with:
394395
fetch-depth: 0
396+
fetch-tags: true
397+
# Compute the latest major version - that is used as our baseline
398+
# note: For CI forks, make sure you have your tags synced
399+
- name: get_major_version
400+
run: |
401+
LATEST_VERSION_TAG=$(git tag --merged | sort --version-sort | tail -n1)
402+
echo "Computed latest VDB tag: ${LATEST_VERSION_TAG}"
403+
VDB_MAJOR_VERSION=$(echo ${LATEST_VERSION_TAG} | cut -f1 -d '.' | tr -d -c 0-9)
404+
echo "Using major version: ${VDB_MAJOR_VERSION}"
405+
echo "VDB_MAJOR_VERSION=${VDB_MAJOR_VERSION}" >> "$GITHUB_ENV"
395406
- name: install_deps
396-
run: sudo apt-get -q install -y libboost-dev libboost-iostreams-dev libtbb-dev libblosc-dev elfutils
397-
# abi-compliance-checker and abi-dumper
398-
#
399-
# @note that abi-dumper is available through apt but at the time of writing this
400-
# the version there (1.1) doesn't work correctly and maniftest by creating an
401-
# invalid ABI report with missing headers. This then always reports 100% success
402-
# rate when used with abi-compliance-checker.
403-
# To fix, install both from source and checkout specific commits for both
404-
# which have been verified to work on ubuntu 20.04.
405-
#
406-
# @warning If you update these, test that they fail when expected!
407-
#
408-
# Also note that these are far superior to abigail/abidiff tools from redhat
407+
run: sudo apt-get -q install -y libboost-iostreams-dev libtbb-dev libblosc-dev elfutils
409408
- name: install_abi_checker
410-
run: |
411-
git clone https://github.com/lvc/abi-dumper.git abi-dumper
412-
cd abi-dumper && git checkout 16bb467cd7d343dd3a16782b151b56cf15509594 && cd -
413-
git clone https://github.com/lvc/abi-compliance-checker abi-compliance-checker
414-
cd abi-compliance-checker && git checkout 7c175c45a8ba9ac41b8e47d8ebbab557b623b18e && cd -
415-
- name: build_latest
409+
run: sudo apt-get -q install -y abi-dumper abi-compliance-checker
410+
- name: build_new
416411
run: >
417-
sudo ./ci/build.sh -v
418-
--build-dir=build_latest
419-
--build-type=Debug
412+
./ci/build.sh -v
413+
--build-dir=build_new
414+
--build-type=abicheck
420415
--target=openvdb_shared
421416
--components=\"core\"
422417
--cargs=\'-DUSE_EXPLICIT_INSTANTIATION=OFF -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON\'
423418
- name: checkout_baseline
424419
run: git checkout v${VDB_MAJOR_VERSION}.0.0
425-
- name: build_baseline
420+
- name: build_old
426421
run: >
427-
sudo ./ci/build.sh -v
428-
--build-type=Debug
422+
./ci/build.sh -v
423+
--build-dir=build_old
424+
--build-type=abicheck
429425
--target=openvdb_shared
430426
--components=\"core\"
431427
--cargs=\'-DUSE_EXPLICIT_INSTANTIATION=OFF -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON\'
432428
- name: abi_dump
433429
run: |
434-
abi-dumper/abi-dumper.pl build_latest/openvdb/openvdb/libopenvdb.so -o ABI-1.dump -lver 1
435-
abi-dumper/abi-dumper.pl build/openvdb/openvdb/libopenvdb.so -o ABI-2.dump -lver 2
430+
abi-dumper build_new/openvdb/openvdb/libopenvdb.so -o ABI-NEW.dump -lver 1
431+
abi-dumper build_old/openvdb/openvdb/libopenvdb.so -o ABI-OLD.dump -lver 2
436432
# Replace the version namespace in the latest ABI dump with the baseline
437433
# version we're comparing against. We should probably instead build the
438434
# latest with the baseline version number but no CMake/defines allow us to
439435
# do this.
440436
- name: replace_symbols
441-
run: sed -i -E 's/openvdb([^v]*)v'${VDB_MAJOR_VERSION}'_[0-9]/openvdb\1v'${VDB_MAJOR_VERSION}'_0/g' ABI-1.dump
437+
run: sed -i -E 's/openvdb([^v]*)v[0-9]*_[0-9]/openvdb\1v'${VDB_MAJOR_VERSION}'_0/g' ABI-NEW.dump
442438
- name: abi_check
443439
# -strict treats warnings as errors
444440
# -extended checks all member data
445441
# we check everything _not_ in openvdb::**::internal namespace
446442
run: >
447-
abi-compliance-checker/abi-compliance-checker.pl -l OPENVDB
448-
-old ABI-2.dump
449-
-new ABI-1.dump
443+
abi-compliance-checker -l OPENVDB
444+
-old ABI-OLD.dump
445+
-new ABI-NEW.dump
450446
-skip-internal-symbols "\d(openvdb.*internal)"
451447
-skip-internal-types "(openvdb.*internal)::"
452448
-strict

cmake/config/OpenVDBCXX.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ if(CMAKE_BUILD_TYPE EQUAL coverage)
245245
endif()
246246

247247
# Note that the thread, address and memory sanitizers are incompatible with each other
248-
set(EXTRA_BUILD_TYPES coverage tsan asan lsan msan ubsan)
248+
set(EXTRA_BUILD_TYPES coverage tsan asan lsan msan ubsan abicheck)
249249

250250
# Set all build flags to empty (unless they have been provided)
251251

@@ -304,6 +304,13 @@ add_link_options("$<$<AND:$<CONFIG:MSAN>,$<COMPILE_LANG_AND_ID:CXX,Clang,AppleCl
304304
add_compile_options("$<$<AND:$<CONFIG:UBSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=undefined>")
305305
add_link_options("$<$<AND:$<CONFIG:UBSAN>,$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,AppleClang>>:-fsanitize=undefined>")
306306

307+
# ABI Check. This build type is expected to work with the abi-dumper/abi-compliance-checker
308+
# binaries which expect specific debug information. In particular, for GCC versions >= 11
309+
# we have to explicitly select dwarf versions < 5 as the abi-dumper doesn't support dwarf5
310+
# and will always incorrectly report successful ABI checks
311+
# https://github.com/lvc/abi-dumper/issues/33
312+
add_compile_options("$<$<CONFIG:ABICHECK>:-gdwarf-4;-g3;-ggdb;-Og>")
313+
307314
# CMAKE_BUILD_TYPE is ignored for multi config generators i.e. MSVS
308315

309316
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)

cmake/scripts/lsan.supp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#################################################################################
2+
## This file is loaded by the Leak/Address Sanitizer build for the unit tests. ##
3+
## It can be used to ignore various errors reported by the sanitizer. This is ##
4+
## especially useful with upstream issues (e.g. boost/tbb). For help defining ##
5+
## suppression rules, see: ##
6+
## https://clang.llvm.org/docs/AddressSanitizer.html ##
7+
## The build is configured with CMAKE_BUILD_TYPE=asan or lsan ##
8+
#################################################################################
9+
10+
##### Upstream #####
11+
12+
# Leaks from TBB init which occur due to tbb teardown issues
13+
# https://github.com/oneapi-src/oneTBB/issues/206
14+
# Should be fixed in oneTBB. Ignore them for now
15+
leak:tbb::internal::task_stream<3>::initialize*

openvdb/openvdb/unittest/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,16 @@ endif()
221221
target_link_libraries(vdb_test ${OPENVDB_TEST_DEPENDENT_LIBS})
222222
add_test(NAME vdb_unit_test COMMAND $<TARGET_FILE:vdb_test> -v)
223223

224-
# For the undefined behaviour sanitizer, add the suppression file and
225-
# additional options
226-
224+
# For the sanitizers, add the suppression files and additional options
227225
get_filename_component(PATH_TO_PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
228226
get_filename_component(PATH_TO_PROJECT_ROOT ${PATH_TO_PROJECT_ROOT} DIRECTORY)
229227
get_filename_component(PATH_TO_PROJECT_ROOT ${PATH_TO_PROJECT_ROOT} DIRECTORY)
228+
set(LSAN_SUPRESSION_FILE ${PATH_TO_PROJECT_ROOT}/cmake/scripts/lsan.supp)
230229
set(UBSAN_SUPRESSION_FILE ${PATH_TO_PROJECT_ROOT}/cmake/scripts/ubsan.supp)
231230

232-
set_tests_properties(vdb_unit_test PROPERTIES
233-
ENVIRONMENT
234-
"$<$<CONFIG:UBSAN>:UBSAN_OPTIONS=halt_on_error=1 report_error_type=1 suppressions=${UBSAN_SUPRESSION_FILE}>")
231+
set(UBSAN_OPTS "$<$<CONFIG:UBSAN>:UBSAN_OPTIONS=halt_on_error=1 report_error_type=1 suppressions=${UBSAN_SUPRESSION_FILE}>")
232+
set(LSAN_OPTS "$<$<CONFIG:LSAN>:LSAN_OPTIONS=suppressions=${LSAN_SUPRESSION_FILE}>")
233+
set(ASAN_OPTS "$<$<CONFIG:ASAN>:LSAN_OPTIONS=suppressions=${LSAN_SUPRESSION_FILE}>")
235234

235+
set_tests_properties(vdb_unit_test PROPERTIES
236+
ENVIRONMENT "$<JOIN:${UBSAN_OPTS};${LSAN_OPTS};${ASAN_OPTS}, >")

openvdb_ax/openvdb_ax/test/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,16 @@ endif()
133133

134134
add_test(NAME vdb_ax_unit_test COMMAND vdb_ax_test -v WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../)
135135

136-
# For the undefined behaviour sanitizer, add the suppression file and
137-
# additional options
138-
136+
# For the sanitizers, add the suppression files and additional options
139137
get_filename_component(PATH_TO_PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
140138
get_filename_component(PATH_TO_PROJECT_ROOT ${PATH_TO_PROJECT_ROOT} DIRECTORY)
141139
get_filename_component(PATH_TO_PROJECT_ROOT ${PATH_TO_PROJECT_ROOT} DIRECTORY)
140+
set(LSAN_SUPRESSION_FILE ${PATH_TO_PROJECT_ROOT}/cmake/scripts/lsan.supp)
142141
set(UBSAN_SUPRESSION_FILE ${PATH_TO_PROJECT_ROOT}/cmake/scripts/ubsan.supp)
143142

143+
set(UBSAN_OPTS "$<$<CONFIG:UBSAN>:UBSAN_OPTIONS=halt_on_error=1 report_error_type=1 suppressions=${UBSAN_SUPRESSION_FILE}>")
144+
set(LSAN_OPTS "$<$<CONFIG:LSAN>:LSAN_OPTIONS=suppressions=${LSAN_SUPRESSION_FILE}>")
145+
set(ASAN_OPTS "$<$<CONFIG:ASAN>:LSAN_OPTIONS=suppressions=${LSAN_SUPRESSION_FILE}>")
146+
144147
set_tests_properties(vdb_ax_unit_test PROPERTIES
145-
ENVIRONMENT
146-
"$<$<CONFIG:UBSAN>:UBSAN_OPTIONS=halt_on_error=1 report_error_type=1 suppressions=${UBSAN_SUPRESSION_FILE}>")
148+
ENVIRONMENT "$<JOIN:${UBSAN_OPTS};${LSAN_OPTS};${ASAN_OPTS}, >")

0 commit comments

Comments
 (0)