Skip to content

Commit fc7843c

Browse files
committed
Fixed the weekly CI, introduce a new build type for the ABI check job
Signed-off-by: Nick Avramoussis <[email protected]>
1 parent b77fc2b commit fc7843c

File tree

2 files changed

+40
-37
lines changed

2 files changed

+40
-37
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)

0 commit comments

Comments
 (0)