Skip to content

Commit debb826

Browse files
authored
Update CI Ubuntu versions (#492)
* Exclude private header files from compatability report * Exclude parameter register assignment from ABI checking * Use the marketing version number in ABI compat_report
1 parent b452c0e commit debb826

File tree

10 files changed

+125029
-117777
lines changed

10 files changed

+125029
-117777
lines changed

.github/workflows/abi-compatibility.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on: [push, pull_request]
2626
jobs:
2727
job:
2828
name: abi-check
29-
runs-on: ubuntu-20.04
29+
runs-on: ubuntu-latest
3030
timeout-minutes: 38
3131
strategy:
3232
fail-fast: false
@@ -40,16 +40,14 @@ jobs:
4040
- name: 'Configure Dependencies - Ubuntu'
4141
run: |
4242
sudo apt-get update
43-
sudo apt-get install -y libapr1-dev libaprutil1-dev elfutils vtable-dumper universal-ctags
44-
# note: sqlext.h exists on github VM, purge for now as we don't link correctly...
45-
sudo apt-get purge unixodbc-dev
43+
sudo apt-get install -y g++-11 libapr1-dev libaprutil1-dev elfutils vtable-dumper universal-ctags
4644
4745
- name: 'run CMake'
4846
run: |
4947
cd main
5048
mkdir build
5149
cd build
52-
cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DLOG4CXX_ABI_CHECK=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-Og" -DBUILD_TESTING=off ..
50+
cmake -DCMAKE_CXX_COMPILER=g++-11 -DLOG4CXX_ABI_CHECK=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-g -Og -fno-eliminate-unused-debug-types" -DBUILD_TESTING=off ..
5351
cmake --build .
5452
5553
- name: 'copy compat report'

.github/workflows/log4cxx-cpp11.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on: [push, pull_request]
1919
jobs:
2020
job:
2121
name: log4cxx-cpp11
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-latest
2323
timeout-minutes: 38
2424
steps:
2525
- uses: actions/checkout@v4
@@ -30,7 +30,7 @@ jobs:
3030
- name: 'Configure Dependencies - Ubuntu'
3131
run: |
3232
sudo apt-get update
33-
sudo apt-get install -y libapr1-dev libaprutil1-dev libboost-filesystem-dev libboost-thread-dev libesmtp-dev
33+
sudo apt-get install -y libapr1-dev libaprutil1-dev libesmtp-dev
3434
3535
- name: 'run cmake - *nix'
3636
run: |

.github/workflows/log4cxx-ubuntu.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
name: [ubuntu20-gcc, ubuntu20-clang, ubuntu22-gcc, ubuntu22-clang]
27+
name: [ubuntu22-gcc, ubuntu22-clang, ubuntu24-gcc, ubuntu24-clang]
2828
include:
29-
- name: ubuntu20-gcc
30-
os: ubuntu-20.04
29+
- name: ubuntu22-gcc
30+
os: ubuntu-22.04
3131
cxx: g++
3232
fmt: OFF
3333
qt: ON
@@ -38,8 +38,8 @@ jobs:
3838
exitevents: OFF
3939
fuzzers: OFF
4040
logchar: utf-8
41-
- name: ubuntu20-clang
42-
os: ubuntu-20.04
41+
- name: ubuntu22-clang
42+
os: ubuntu-22.04
4343
cxx: clang++
4444
fmt: ON
4545
qt: OFF
@@ -50,8 +50,8 @@ jobs:
5050
exitevents: OFF
5151
fuzzers: ON
5252
logchar: utf-8
53-
- name: ubuntu22-gcc
54-
os: ubuntu-22.04
53+
- name: ubuntu24-gcc
54+
os: ubuntu-24.04
5555
cxx: g++
5656
fmt: OFF
5757
qt: ON
@@ -62,8 +62,8 @@ jobs:
6262
exitevents: ON
6363
fuzzers: OFF
6464
logchar: utf-8
65-
- name: ubuntu22-clang
66-
os: ubuntu-22.04
65+
- name: ubuntu24-clang
66+
os: ubuntu-24.04
6767
cxx: clang++
6868
fmt: ON
6969
qt: OFF

src/main/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ if(LOG4CXX_QT_SUPPORT)
3939
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
4040
)
4141
endif(LOG4CXX_QT_SUPPORT)
42+
43+
option(LOG4CXX_ABI_CHECK "Check for ABI changes" OFF)
44+
if(LOG4CXX_ABI_CHECK)
45+
if(NOT "log4cxx" STREQUAL "${LOG4CXX_NS}")
46+
message(FATAL_ERROR "ABI compatability can only be checked if LOG4CXX_NS=log4cxx, but LOG4CXX_NS=${LOG4CXX_NS}.")
47+
endif()
48+
add_subdirectory(abi-symbols)
49+
endif(LOG4CXX_ABI_CHECK)

src/main/abi-symbols/CMakeLists.txt

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
message("Getting dependencies for ABI compatability check...")
19+
# Get the latest version of abi-dumper and abi-compliance-checker
20+
include(FetchContent)
21+
FetchContent_Declare(abi-dumper
22+
GIT_REPOSITORY https://github.com/lvc/abi-dumper.git
23+
GIT_TAG 1.4
24+
)
25+
FetchContent_GetProperties(abi-dumper)
26+
if(NOT abi-dumper_POPULATED)
27+
FetchContent_Populate(abi-dumper)
28+
endif()
29+
30+
FetchContent_Declare(abi-compliance-checker
31+
GIT_REPOSITORY https://github.com/lvc/abi-compliance-checker.git
32+
GIT_TAG f60ce442c33f1d5cda1cec7cfddee24af1777572
33+
)
34+
FetchContent_GetProperties(abi-compliance-checker)
35+
if(NOT abi-compliance-checker_POPULATED)
36+
FetchContent_Populate(abi-compliance-checker)
37+
endif()
38+
39+
# The local script is patched to exclude register assignments to parameters
40+
#set(abi-dumper-script ${abi-dumper_SOURCE_DIR}/abi-dumper.pl)
41+
set(abi-dumper-script ${CMAKE_CURRENT_SOURCE_DIR}/abi-dumper.pl)
42+
set(abi-compliance-script ${abi-compliance-checker_SOURCE_DIR}/abi-compliance-checker.pl)
43+
44+
add_custom_target(dump-abi ALL
45+
COMMAND perl ${abi-dumper-script} -public-headers public_header_files.txt -o new-abi.dump -skip-cxx -vnum ${log4cxx_VER} $<TARGET_FILE:log4cxx>
46+
DEPENDS log4cxx
47+
COMMENT "Dumping ABI symbols"
48+
)
49+
50+
add_custom_target(compare-abi ALL
51+
COMMAND perl ${abi-compliance-script} -skip-internal-symbols "\\d\\(fmt\\)" -skip-internal-types "\\(fmt\\)::" -l log4cxx -old ${CMAKE_CURRENT_SOURCE_DIR}/abi.dump -new new-abi.dump
52+
DEPENDS dump-abi
53+
COMMENT "Comparing ABI symbols"
54+
)

0 commit comments

Comments
 (0)