Skip to content

Conversation

@dennisklein
Copy link
Member

Boost 1.88 replaced Boost.Process with v2, breaking the v1 API. Boost 1.89 restores v1 compatibility via <boost/process/v1.hpp>.

  • Fail configuration if Boost 1.88 is detected
  • Define FAIRMQ_BOOST_PROCESS_V1_HEADER for Boost >= 1.89
  • Use conditional includes to select v1.hpp or process.hpp
  • Add namespace aliases (bp, bp_this) for portable API access

Related to #531

@coderabbitai
Copy link

coderabbitai bot commented Jan 5, 2026

📝 Walkthrough

Walkthrough

The PR introduces Boost version compatibility handling: it errors out for Boost 1.88, and sets a CMake flag FAIRMQ_BOOST_PROCESS_V1_HEADER for Boost 1.89+ to enable conditional inclusion of boost/process/v1.hpp and corresponding namespace aliasing across the codebase; Manager.cxx also adds an early return when an external executable is not found.

Changes

Cohort / File(s) Summary
CMake Configuration
cmake/FairMQDependencies.cmake, fairmq/CMakeLists.txt
Adds fatal error for Boost 1.88. Introduces FAIRMQ_BOOST_PROCESS_V1_HEADER (set ON for Boost ≥1.89) and conditionally applies a private compile definition to the FairMQ build target when the flag is enabled.
Source Code Compatibility
fairmq/shmem/Manager.cxx, fairmq/tools/Process.cxx
Conditional include of boost/process/v1.hpp vs boost/process.hpp based on FAIRMQ_BOOST_PROCESS_V1_HEADER; introduces bp namespace aliasing. Manager.cxx adds an early warning and returns false if the invoked executable is not found.
Test Configuration
test/CMakeLists.txt
Propagates FAIRMQ_BOOST_PROCESS_V1_HEADER into test compile definitions and appends it to test invocation definitions (runTestDevice, Device suite).
Test Source Files
test/device/_error_state.cxx, test/device/_exceptions.cxx, test/device/_signals.cxx
Conditional inclusion of Boost.Process v1 header when FAIRMQ_BOOST_PROCESS_V1_HEADER is defined; no other functional changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • rbx

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding Boost.Process v1 API compatibility for Boost 1.89+, which is the core purpose of the PR.
Description check ✅ Passed The description is directly related to the changeset, explaining the Boost version compatibility issue and detailing the key changes made (Boost 1.88 rejection, v1 header conditional includes, namespace aliases).
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 276691f and ab0336e.

📒 Files selected for processing (8)
  • cmake/FairMQDependencies.cmake
  • fairmq/CMakeLists.txt
  • fairmq/shmem/Manager.cxx
  • fairmq/tools/Process.cxx
  • test/CMakeLists.txt
  • test/device/_error_state.cxx
  • test/device/_exceptions.cxx
  • test/device/_signals.cxx
🚧 Files skipped from review as they are similar to previous changes (5)
  • test/CMakeLists.txt
  • test/device/_exceptions.cxx
  • fairmq/tools/Process.cxx
  • fairmq/shmem/Manager.cxx
  • cmake/FairMQDependencies.cmake
🔇 Additional comments (3)
test/device/_error_state.cxx (1)

12-16: LGTM! Conditional header inclusion implemented correctly.

The preprocessor conditional correctly selects between Boost.Process v1 and legacy headers based on the FAIRMQ_BOOST_PROCESS_V1_HEADER macro, ensuring compatibility across Boost versions.

test/device/_signals.cxx (1)

12-16: LGTM! Consistent with the compatibility pattern.

The conditional compilation matches the pattern used across test files, correctly handling Boost.Process version differences.

fairmq/CMakeLists.txt (1)

179-181: LGTM! Private definition correctly configured.

The conditional definition is properly scoped as PRIVATE, ensuring that the Boost.Process header selection is handled internally within the FairMQ target without affecting consumers.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Fix all issues with AI Agents 🤖
In @cmake/FairMQDependencies.cmake:
- Around line 26-39: Replace the redundant multi-form Boost checks with
simplified string-version comparisons: remove usages of Boost_VERSION_MAJOR and
Boost_VERSION_MINOR and the duplicate VERSION_EQUAL "1.88" check, and only check
if Boost_VERSION VERSION_EQUAL "1.88.0" to trigger the FATAL_ERROR and if
Boost_VERSION VERSION_GREATER_EQUAL "1.89" to set
FAIRMQ_BOOST_PROCESS_V1_HEADER; if you must support older CMake behavior, add a
short comment noting that component-based checks would be required for older
CMake and keep that documented separately.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25abd60 and 276691f.

📒 Files selected for processing (8)
  • cmake/FairMQDependencies.cmake
  • fairmq/CMakeLists.txt
  • fairmq/shmem/Manager.cxx
  • fairmq/tools/Process.cxx
  • test/CMakeLists.txt
  • test/device/_error_state.cxx
  • test/device/_exceptions.cxx
  • test/device/_signals.cxx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: latest-gcc-15
  • GitHub Check: latest-gcc-13
  • GitHub Check: tsan
  • GitHub Check: boost187-gcc-15
  • GitHub Check: latest-gcc-14
  • GitHub Check: latest-gcc-12
  • GitHub Check: asan+lsan+ubsan
  • GitHub Check: static-analysis
🔇 Additional comments (8)
test/device/_error_state.cxx (1)

12-16: LGTM!

The conditional include pattern correctly selects the appropriate Boost.Process header based on the FAIRMQ_BOOST_PROCESS_V1_HEADER macro. This aligns with the project-wide compatibility strategy for Boost 1.89+.

test/device/_signals.cxx (1)

12-16: LGTM!

Consistent conditional include pattern for Boost.Process header compatibility.

fairmq/tools/Process.cxx (1)

13-17: LGTM!

The conditional header inclusion and namespace aliasing provide a clean abstraction layer. The bp alias is consistently used for all Boost.Process operations (async_pipe, child, std_out, std_err, std_in), ensuring portable API access across Boost versions.

Also applies to: 27-31

test/device/_exceptions.cxx (1)

12-16: LGTM!

Consistent conditional include pattern for Boost.Process header compatibility.

fairmq/CMakeLists.txt (1)

179-181: LGTM!

Correctly uses PRIVATE visibility for the compile definition since Boost.Process usage is an internal implementation detail of the library. The test build configuration handles propagation separately.

fairmq/shmem/Manager.cxx (1)

14-20: The code at lines 27 and 31 is correct as written. boost::this_process::environment() and boost::this_process::path() are part of the top-level boost::this_process namespace, not nested within boost::process::v1. When <boost/process/v1.hpp> is included, these top-level functions remain accessible without modification. The bp namespace alias is only needed for boost::process symbols that moved to boost::process::v1, not for this_process. No code changes are needed.

test/CMakeLists.txt (2)

19-21: LGTM! Correctly propagates the Boost.Process v1 flag to test builds.

The conditional logic follows the established pattern and will ensure that test code receives the FAIRMQ_BOOST_PROCESS_V1_HEADER preprocessor definition when needed.


141-141: Correctly adds definitions to Device test suite.

The Device tests use Boost.Process headers in _error_state.cxx, _exceptions.cxx, and _signals.cxx, making the ${definitions} flag necessary. Verification confirms no other test directories use Boost.Process, so no additional test suites require this flag.

Boost 1.88 replaced Boost.Process with v2, breaking the v1 API.
Boost 1.89 restores v1 compatibility via <boost/process/v1.hpp>.

- Fail configuration if Boost 1.88 is detected
- Define FAIRMQ_BOOST_PROCESS_V1_HEADER for Boost >= 1.89
- Use conditional includes to select v1.hpp or process.hpp
- Add namespace aliases (bp, bp_this) for portable API access
@dennisklein dennisklein merged commit fa64faf into FairRootGroup:dev Jan 5, 2026
1 of 9 checks passed
@dennisklein dennisklein deleted the fix_boost_compat branch January 5, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant