Upgrade boost - #3631
Open
donghaiwang wants to merge 4 commits into
Open
Conversation
…0 upgrade (#9670) * fix(PythonAPI/examples): replace deprecated NumPy aliases for NumPy 2 compatibility Replace np.bool with np.bool_ in DVS event dtype in V2XDemo.py, manual_control_chrono.py, and manual_control_carsim.py (removed in NumPy 1.24). Replace np.matrix with np.array in client_bounding_boxes.py (deprecated in NumPy 1.x, removed in NumPy 2.x). All replacements are backward-compatible with NumPy >= 1.18.4. * fix(build): upgrade Boost to 1.89.0 for NumPy 2 ABI compatibility Drop the in-tree dtype.cpp.patch against Boost 1.84.0 and upgrade to Boost 1.89.0, which carries the upstream NumPy 2 C ABI fix from boostorg/python#432 natively. libboost_numpy now compiles against both NumPy 1.x (>=1.18.4) and NumPy 2.x headers without any vendored patches. Boost 1.84 -> 1.89 removed several deprecated Asio and Filesystem APIs; all call sites in LibCarla and the CarlaTools UE4 plugin updated: - io_context::work -> executor_work_guard (removed 1.85) - io_context::reset() -> restart() (removed 1.86) - address::from_string() -> make_address() (removed 1.85) - resolver::query/iterator -> range-based resolve() (removed 1.85) - buffer_cast<T>() -> static_cast via streambuf::data().data() (removed 1.88) - io_service typedef -> io_context (removed 1.85) - boost/filesystem/operations.hpp no longer includes directory.hpp (1.85) Windows installer (install_boost.bat) SHA256 updated to the 1.89.0 zip digest. MSVC C4459 pragma guard added around boost/asio.hpp in MapPreviewUserWidget.h to prevent warnings-as-errors failure. New regression-guard tests: test_boost_deadline_timer.cpp (3 tests), test_boost_rtree.cpp (4 tests), test_boost_version.py. * docs(CHANGELOG): note NumPy 2 compatibility * fix(build): bump Boost 1.89 -> 1.90 and migrate timers to steady_timer Boost 1.90 added [[deprecated]] annotations to boost::asio::deadline_timer. LibCarla's networking code is migrated to boost::asio::steady_timer across Primary, Secondary, Client, and ServerSession. steady_timer default-constructs with expiry() == time_point::min() (past), whereas deadline_timer defaulted to pos_infin (far future). The recursive StartTimer() guard in ServerSession::StartTimer and Primary::StartTimer checks expiry() <= now() and would fire Close() before socket setup if left at the new default, so both _deadline members are explicitly constructed with time_point::max() to preserve the old semantics. API migrations at the call sites: * expires_from_now(duration) -> expires_after(duration) * expires_at() -> expiry() * deadline_timer::traits_type::now() -> std::chrono::steady_clock::now() * boost::posix_time durations -> std::chrono durations Build scripts: * Util/BuildTools/Setup.sh: BOOST_VERSION 1.89.0 -> 1.90.0, SHA256 * Util/BuildTools/Setup.bat: version bump (Windows) * Util/BuildTools/BuildOSMRenderer.bat: install path bump (Windows) * Util/InstallersWin/install_boost.bat: source-zip SHA256 bump Tests: * test_boost_deadline_timer.cpp: test class BoostDeadlineTimer renamed to BoostAsioTimer and migrated to steady_timer; 3 new regression tests pin the contract that prevents future refactors from silently reintroducing the default-construction trap: - InitializedWithMaxIsInDistantFuture - DefaultConstructedExpiryIsInPast - CancelTriggersAbortedError * test_boost_rtree.cpp: header comment 1.89 -> 1.90 * test_boost_version.py: EXPECTED_BOOST_VERSION 1.89.0 -> 1.90.0; stale-cache check rolled 1.84.0 -> 1.89.0 * CHANGELOG.md: NumPy 2 entry references Boost 1.90.0 Verified: make LibCarla + full make check.LibCarla pass on server and client, release and debug. All 6 BoostAsioTimer.* and 4 BoostRtree.* tests pass on both suites. * fix(build): guard against all pre-1.90 Boost installs Address review on PR #9670. The previous test guarded only against the 1.89.0 intermediate install used during development, letting a direct 1.84.0 -> 1.90.0 upgrade slips past undetected. - Replace the negative-only LDD check with a positive assertion that libboost_*.so.1.90.0 is present in PythonAPI/carla/dependencies/lib/, plus an explicit guard over known stale baselines (1.84.0, 1.89.0). Boost is statically linked into libcarla.so, so ldd cannot observe it; the dependencies/lib symlinks are the authoritative record. - Update two Linux build scripts still pinned to boost-1.84.0 that were missed in the 1.84->1.89->1.90 bumps (the Windows .bat was updated): - Util/BuildTools/BuildOSMRenderer.sh - Util/BuildTools/Ad-rss.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Upgrade boost to 1.90.0
Where has this been tested?
Possible Drawbacks