Skip to content
Merged
Changes from all commits
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
63 changes: 46 additions & 17 deletions .evergreen/scripts/abi-compliance-check-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ if true; then
../install/old/include/
</add_include_paths>

<skip_including>
/v_noabi/bsoncxx/enums/
/v_noabi/bsoncxx/config/
/v_noabi/mongocxx/config/
/v1/detail/prelude.hpp
/v1/detail/postlude.hpp
</skip_including>

DOC

cat >new.xml <<DOC
Expand All @@ -52,10 +60,6 @@ DOC
../install/new/include/
</add_include_paths>

DOC

{
cat <<DOC
<skip_including>
/v_noabi/bsoncxx/enums/
/v_noabi/bsoncxx/config/
Expand All @@ -64,12 +68,7 @@ DOC
/v1/detail/postlude.hpp
</skip_including>

<skip_namespaces>
detail
</skip_namespaces>

DOC
} | tee -a old.xml new.xml >/dev/null

tee cxx-abi/old.xml cxx-noabi/old.xml <old.xml >/dev/null
tee cxx-abi/new.xml cxx-noabi/new.xml <new.xml >/dev/null
Expand All @@ -87,13 +86,11 @@ if true; then
<skip_headers>
/v_noabi/
</skip_headers>
DOC

cat >>cxx-noabi/old.xml <<DOC
<headers>
../install/old/include/bsoncxx/v_noabi
../install/old/include/mongocxx/v_noabi
</headers>
<skip_namespaces>
bsoncxx::detail
mongocxx::detail
</skip_namespaces>
DOC

cat >>cxx-abi/new.xml <<DOC
Expand All @@ -105,21 +102,53 @@ DOC
<skip_headers>
/v_noabi/
</skip_headers>

<skip_namespaces>
bsoncxx::detail
mongocxx::detail
Copy link
Collaborator

@kevinAlbs kevinAlbs Sep 10, 2025

Choose a reason for hiding this comment

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

To confirm: is skipping bsoncxx::v_noabi unnecessary? I expect "yes" since v1 headers will not include v_noabi headers and /v_noabi/ is already included in skip_headers.

Copy link
Contributor Author

@eramongodb eramongodb Sep 10, 2025

Choose a reason for hiding this comment

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

Correct: unlike v_noabi headers which include v1 headers, v1 headers do not include v_noabi headers; the bsoncxx::v_noabi namespace is completely absent when only v1 headers are included.

</skip_headers>
DOC

cat >>cxx-noabi/old.xml <<DOC
<headers>
../install/old/include/bsoncxx/v_noabi
../install/old/include/mongocxx/v_noabi
</headers>

<skip_namespaces>
bsoncxx::detail
mongocxx::detail
bsoncxx::v1
mongocxx::v1
</skip_namespaces>
DOC

cat >>cxx-noabi/new.xml <<DOC
<headers>
../install/new/include/bsoncxx/v_noabi
../install/new/include/mongocxx/v_noabi
</headers>

<skip_namespaces>
bsoncxx::detail
mongocxx::detail
bsoncxx::v1
mongocxx::v1
</skip_namespaces>
DOC
fi

args=(
-lib mongo-cxx-driver
-old old.xml
-new new.xml
)

# Allow task to upload the HTML report despite failed status.
echo "Generating stable ABI report..."
pushd cxx-abi
declare ret
abi-compliance-checker -lib mongo-cxx-driver -old old.xml -new new.xml 2>&1 && ret="$?" || ret="$?"
abi-compliance-checker "${args[@]}" 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"}'
Expand All @@ -136,7 +165,7 @@ echo "Generating stable ABI report... done."
echo "Generating unstable ABI report..."
pushd cxx-noabi
declare ret
abi-compliance-checker -lib mongo-cxx-driver -old old.xml -new new.xml 2>&1 && ret="$?" || ret="$?"
abi-compliance-checker "${args[@]}" 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"}'
Expand Down