Skip to content

Commit

Permalink
Add to CI per-commit checking of ABI stability using abi-dumper and l…
Browse files Browse the repository at this point in the history
…ibabigail

for GCCs 7 and 9 in C++ 14 and C++ 17 respectively.
  • Loading branch information
ned14 committed Dec 12, 2021
1 parent dc14345 commit 3ab5818
Show file tree
Hide file tree
Showing 15 changed files with 21,936 additions and 1,823 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/abi_stability.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: ABIStability

on:
push:
branches:
- develop
- master
pull_request:
schedule:
- cron: '0 0 1 * *'

jobs:
abi_stability:
name: "ABI stability"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Install abi-compliance-checker and abigail tools
shell: bash
run: |
sudo apt-get -y install abi-dumper abi-compliance-checker abigail-tools g++-7 g++-9
- name: Validate ABI compatibility (abi-dumper)
if: success() || failure()
shell: bash
run: |
cd abi-compliance
./check-abi.sh 2.2
- name: Validate ABI compatibility (abigail)
if: success() || failure()
shell: bash
run: |
cd abi-compliance
./check-abigail.sh 2.2
# - name: Validate API + ABI compatibility (abi-compliance-checker)
# if: success() || failure()
# shell: bash
# run: |
# cd abi-compliance
# ./check-api-abi.sh 2.2

- name: Upload ABI stability reports
if: success() || failure()
uses: actions/upload-artifact@v2
with:
name: ABI stability report (GCC 7 with C++ 14)
path: abi-compliance/compat-reports/Outcome/2.2-gcc7-cxx14_to_test-gcc7-cxx14/compat_report.html
with:
name: ABI stability report (GCC 9 with C++ 17)
path: abi-compliance/compat-reports/Outcome/2.2-gcc9-cxx17_to_test-gcc9-cxx17/compat_report.html
# with:
# name: API + ABI stability report (GCC 9 with C++ 17)
# path: abi-compliance/compat-reports/Outcome/2.2-gcc7-cxx14_to_X/compat_report.html
4 changes: 4 additions & 0 deletions abi-compliance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ add_subdirectory(.. outcome EXCLUDE_FROM_ALL)
add_library(outcome-abi-lib-${LABEL} SHARED "src/main.cpp")
target_link_libraries(outcome-abi-lib-${LABEL} PUBLIC outcome::hl)
add_dependencies(outcome-abi-lib-${LABEL} outcome_hl-pp-abi)
target_compile_definitions(outcome-abi-lib-${LABEL} PUBLIC OUTCOME_DISABLE_ABI_PERMUTATION=1)
if(NOT MSVC)
target_compile_options(outcome-abi-lib-${LABEL} PUBLIC -Og)
endif()
43 changes: 25 additions & 18 deletions abi-compliance/Readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Notes on the API and ABI stability checking

Outcome is a header only library with a very simple Application Binary
Interface (ABI). Therefore, your shared library with functions which consume
Outcome is a header only library with a very simple data type layout designed
for strong ABI. Therefore, your shared library with functions which consume
and return Outcomes ought to be perfectly binary stable in the pure sense of
that Outcome's core `result<T, E>` and `outcome<T, E, P>` object layout will
not change, no matter what changes occur in Outcome in the future.
Expand All @@ -20,29 +20,43 @@ stability. These are what are checked per CI commit:
<dl>
<dt>2.2-gcc7-cxx14</dt>
<dd>This is when compiled under the C++ 14 standard by GCC 7.5.</dd>
<dt>2.2-gcc9-cxx17</dt>
<dd>This is when compiled under the C++ 17 standard by GCC 9.3.</dd>
</dl>

## Prerequisites for using this directory:

1. GCC 7.5 with libstdc++.
2. A recent Linux.
2. GCC 9.3 with libstdc++.
3. Ubuntu 20.04 LTS.

### Prerequisites if you want to check only ABI:
### Prerequisites if you want to check only ABI (abi-dumper):

1. Some edition of `abi-dumper` (one usually comes in your Linux
package repos).
2. Some edition of `abi-compliance-checker` (one usually comes in your Linux
package repos).
1. `abi-dumper`
2. `abi-compliance-checker`

Run `./check-abi.sh abi_dumps/Outcome/<ABIVER>/binary_only.dump` to check that
Run `./check-abi.sh 2.2` to check that
the current Outcome's ABI is compatible with the stored ABI. A HTML report
will be generated by the `abi-compliance-checker` tool useful for displaying
in CI servers and/or emailing to team members.

If you see breakage in this tool, please do report such ABI breakages
to https://github.com/ned14/outcome/issues.

### Prerequisites if you want to check only ABI (libabigail):

1. `abigail-tools`

Run `./check-abigail.sh 2.2` to check that
the current Outcome's ABI is compatible with the stored ABI.

If you see breakage in this tool, please do report such ABI breakages
to https://github.com/ned14/outcome/issues.

### Prerequisites if you want to check ABI and API:

1. A new enough ABI compliance checker to work with GCC 7 (https://github.com/lvc/abi-compliance-checker)
and all its prerequisites.
1. `abi-dumper`
2. `abi-compliance-checker`

Run `./check-api-abi.sh 2.2` to check that the current Outcome's ABI and API
is compatible with the stored ABI. A HTML report
Expand All @@ -53,10 +67,3 @@ As users familiar with this tool will know, this form of the tool is
somewhat prone to false positives. Every failure needs to be carefully
studied to determine if it is actually a problem or not.

Alternatively run `./check-abi.sh 2.2` to check that the current Outcome's ABI
is compatible with the stored ABI. A HTML report
will be generated by the `abi-compliance-checker` tool useful for displaying
in CI servers and/or emailing to team members.

If you see breakage in this latter tool, please do report such ABI breakages
to https://github.com/ned14/outcome/issues.
Loading

0 comments on commit 3ab5818

Please sign in to comment.