From c93b95d623bf9dfeea537ed7b6a016f29420f228 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Tue, 5 Aug 2025 14:26:06 -0500 Subject: [PATCH 1/2] CXX-2812 enable abi-compatibility-check for stable ABI --- .../scripts/abi-compliance-check-test.sh | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.evergreen/scripts/abi-compliance-check-test.sh b/.evergreen/scripts/abi-compliance-check-test.sh index 064fecdc22..7a93ae4cd8 100755 --- a/.evergreen/scripts/abi-compliance-check-test.sh +++ b/.evergreen/scripts/abi-compliance-check-test.sh @@ -57,14 +57,15 @@ DOC { cat < - 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 - bsoncxx::detail - bsoncxx::v_noabi::detail - bsoncxx::v_noabi::stdx::detail + detail DOC @@ -117,11 +118,16 @@ 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 + 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." @@ -129,6 +135,12 @@ 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." From f995349fd2a3521238f0e3532db236798806d76f Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 6 Aug 2025 10:20:15 -0500 Subject: [PATCH 2/2] Fix order of exit code conditional branches --- .evergreen/scripts/abi-compliance-check-test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.evergreen/scripts/abi-compliance-check-test.sh b/.evergreen/scripts/abi-compliance-check-test.sh index 7a93ae4cd8..1f706c2fef 100755 --- a/.evergreen/scripts/abi-compliance-check-test.sh +++ b/.evergreen/scripts/abi-compliance-check-test.sh @@ -120,13 +120,13 @@ 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="$?" -if [[ "${ret:?}" -gt 0 ]]; then +if [[ "${ret:?}" -gt 1 ]]; then declare status - status='{"status":"failed", "type":"test", "should_continue":true, "desc":"detected stable ABI incompatibility"}' + 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 -elif [[ "${ret:?}" -gt 1 ]]; then +elif [[ "${ret:?}" -gt 0 ]]; then declare status - status='{"status":"failed", "type":"test", "should_continue":true, "desc":"abi-compliance-checker emitted one or more errors"}' + 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 fi popd # cxx-abi