Repository navigation
Conversation
Since 31d6b5c ("process_handle.async_wait accepts ref to exit_code"), basic_process_handle_signal::async_wait() initializes async_wait_op_ with {signal_set_, pid_, exit_code}, and the operation completes through operator()(Self&&, error_code). The #else branch for BOOST_PROCESS_V2_DISABLE_SIGNALSET was not adapted: it still has two members and dispatches the old (exit_code, ec) completion. Because the initializer appears in the trailing return type of async_wait(), every use of basic_process with the signal handle fails to compile, e.g. error: too many initializers for '...::async_wait_op_' This affects macOS, the BSDs without pdfork, and Linux with BOOST_PROCESS_V2_DISABLE_PIDFD_OPEN, in every release that has the option (1.89 to 1.92). The branch now has the same members as the signal set branch and completes with operation_not_supported, as intended when the option was added and as basic_process_handle_fd_or_signal does. The new test disable_signalset builds with the option. On Linux it also runs with BOOST_PROCESS_V2_DISABLE_PIDFD_OPEN, which selects the signal handle, so CI covers it. Closes boostorg#568.
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.
Fixes #568.
With
BOOST_PROCESS_V2_DISABLE_SIGNALSET, the#elsebranch ofasync_wait_op_in process_handle_signal.hpp now has the same members as the signal set branch and completes throughoperator()(Self&&, error_code)withoperation_not_supported, as process_handle_fd_or_signal.hpp does.wait(),running()andterminate()keep working throughwaitpid.New test test/v2/disable_signalset.cpp:
wait()returns the exit code, andasync_wait()completes withoperation_not_supportedon the signal handle and normally on all other handles. On Linux it also runs withBOOST_PROCESS_V2_DISABLE_PIDFD_OPEN, which selects the signal handle, so Linux CI covers it.Tested with b2 in a Boost 1.92.0 tree with this branch as libs/process:
disable_signalset,disable_signalset_no_pidfdand process pass. Without the fix,disable_signalset_no_pidfdfails to compile.disable_signalsetand process pass.The CMake registration follows
boost_process_v2_test_with_target, which linksboost_process_v2_test_impl, a target removed in 01c9a5b. So on develop the CMake test build fails for every test with a target, this one included. That is not addressed here.