Skip to content

CXX-2812 enable abi-compatibility-check for stable ABI #1437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions .evergreen/scripts/abi-compliance-check-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ DOC
{
cat <<DOC
<skip_including>
bsoncxx/v_noabi/bsoncxx/enums/
bsoncxx/v_noabi/bsoncxx/config/
/v_noabi/bsoncxx/enums/
/v_noabi/bsoncxx/config/
/v_noabi/mongocxx/config/
/v1/detail/prelude.hpp
/v1/detail/postlude.hpp
</skip_including>

<skip_namespaces>
bsoncxx::detail
bsoncxx::v_noabi::detail
bsoncxx::v_noabi::stdx::detail
detail
</skip_namespaces>

DOC
Expand Down Expand Up @@ -117,18 +118,29 @@ fi
# Allow task to upload the HTML report despite failed status.
echo "Generating stable ABI report..."
pushd cxx-abi
if ! abi-compliance-checker -lib mongo-cxx-driver -old old.xml -new new.xml 2>&1; then
: # CXX-2812: enable code below once stable ABI symbols exist in the base commit libraries.
# declare status
# status='{"status":"failed", "type":"test", "should_continue":true, "desc":"abi-compliance-checker emitted one or more errors"}'
# curl -sS -d "${status:?}" -H "Content-Type: application/json" -X POST localhost:2285/task_status || true
declare ret
abi-compliance-checker -lib mongo-cxx-driver -old old.xml -new new.xml 2>&1 && ret="$?" || ret="$?"
if [[ "${ret:?}" -gt 0 ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swap if blocks. I expect the -gt 1 block will never be entered (since the -gt 0 will be true too).

declare status
status='{"status":"failed", "type":"test", "should_continue":true, "desc":"detected stable ABI incompatibility"}'
curl -sS -d "${status:?}" -H "Content-Type: application/json" -X POST localhost:2285/task_status || true
elif [[ "${ret:?}" -gt 1 ]]; then
declare status
status='{"status":"failed", "type":"test", "should_continue":true, "desc":"abi-compliance-checker emitted one or more errors"}'
curl -sS -d "${status:?}" -H "Content-Type: application/json" -X POST localhost:2285/task_status || true
fi
popd # cxx-abi
echo "Generating stable ABI report... done."

# Also create a report for the unstable ABI. Errors are expected and OK.
echo "Generating unstable ABI report..."
pushd cxx-noabi
abi-compliance-checker -lib mongo-cxx-driver -old old.xml -new new.xml 2>&1 || true
declare ret
abi-compliance-checker -lib mongo-cxx-driver -old old.xml -new new.xml 2>&1 && ret="$?" || ret="$?"
if [[ "${ret:?}" -gt 1 ]]; then
declare status
status='{"status":"failed", "type":"test", "should_continue":true, "desc":"abi-compliance-checker emitted one or more errors"}'
curl -sS -d "${status:?}" -H "Content-Type: application/json" -X POST localhost:2285/task_status || true
fi
popd # cxx-noabi
echo "Generating unstable ABI report... done."