Skip to content

THRIFT-6394: refactor(cpp): Build the C++ library without Boost - #3975

Open
slachiewicz wants to merge 2 commits into
apache:masterfrom
slachiewicz:THRIFT-6394
Open

slachiewicz wants to merge 2 commits into
apache:masterfrom
slachiewicz:THRIFT-6394

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Replaces the eight remaining Boost uses in lib/cpp/src with C++11 code (the table in the ticket lists each one) and drops REQUIRE_BOOST_HEADERS() from the CMake build of the library and the tutorials. The opt-in TUuid(const boost::uuids::uuid&) constructor stays. The unit tests now use Boost only for Boost.Test (second commit); the autotools build still needs Boost.

THeaderTransport's checked cast replaces boost::numeric_cast, which THRIFT-5660 tried in #2689 and reverted because 0UL to int32_t threw. New tests cover UUID parsing, JSON \u escapes and case-insensitive HTTP header matching; they pass against the Boost code too.

Verified: differential check of each replacement against the Boost call it replaces (all THeaderTransport conversions at their limits, exhaustive short inputs for the tokenizer and header matching, UUID string mutations, UTF-16 sequences up to 3 units) → 212,707 comparisons, 0 differences, at C++11 and C++17.
Verified: Ubuntu 24.04 arm64, GCC 13, Release → ctest 60/60 at C++11 and at C++17; with -DBUILD_TESTING=OFF in a container with no Boost installed, the library and tutorials build.

@mergeable mergeable Bot added c++ Pull requests that update C++ code build and general CI cmake, automake and build system changes labels Sep 28, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 28, 2026 12:06
@slachiewicz slachiewicz changed the title THRIFT-6394: Build the C++ library without Boost THRIFT-6394: refactor(cpp): Build the C++ library without Boost Sep 28, 2026
slachiewicz and others added 2 commits September 30, 2026 18:23
Client: cpp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tests

Client: cpp

Threads, timing, random numbers and paths now come from the C++11 standard
library, so lib/cpp/test links boost_unit_test_framework alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build and general CI cmake, automake and build system changes c++ Pull requests that update C++ code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant