Upgrade build to C++20, C17, and Boost 1.91#8870
Draft
zwass wants to merge 75 commits into
Draft
Conversation
Comment on lines
+193
to
+213
| @@ -188,11 +199,21 @@ class ProcessOpenPipesTest : public testing::Test { | |||
|
|
|||
| int reader_pid = create_child("reader"); | |||
| if (reader_pid <= 0) { | |||
| LOG(ERROR) << "Error creating writer child"; | |||
| LOG(ERROR) << "Error creating reader child"; | |||
| kill_children(writer_pid, reader_pid); | |||
| return; | |||
| } | |||
|
|
|||
| const bool writer_ready = wait_child_signal(); | |||
| const bool reader_ready = wait_child_signal(); | |||
|
|
|||
| if (!writer_ready || !reader_ready) { | |||
| kill_children(writer_pid, reader_pid); | |||
| FAIL() | |||
| << "One or more child processes failed to initialize the test pipe"; | |||
Comment on lines
+12
to
+17
| execute_process( | ||
| COMMAND git submodule update --init -- libs/static_string | ||
| WORKING_DIRECTORY "${BOOST_ROOT}" | ||
| OUTPUT_QUIET | ||
| ERROR_QUIET | ||
| ) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 55 out of 57 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
osquery/utils/pidfile/tests/pidfile.cpp:52
- The new move constructor/assignment leaves the moved-from object with an empty
path, but the destructor unconditionally callsboost::filesystem::remove(path). If a moved-fromUniquePathis destroyed, this may attempt to remove an empty path and can throw from a destructor (potentially terminating the test process). Consider clearing/invalidatingother.pathexplicitly in the move operations and guarding in the destructor (e.g., only remove when!path.empty()and/or use theremoveoverload that takes an error_code).
Comment on lines
+12
to
+17
| execute_process( | ||
| COMMAND git submodule update --init -- libs/static_string | ||
| WORKING_DIRECTORY "${BOOST_ROOT}" | ||
| OUTPUT_QUIET | ||
| ERROR_QUIET | ||
| ) |
Comment on lines
+207
to
+209
| // Parent only reads, close the write end. | ||
| close(fd_signal_[1]); | ||
|
|
Comment on lines
+4
to
+5
| set(CMAKE_C_STANDARD 17) | ||
| set(CMAKE_C_STANDARD_REQUIRED ON) |
Comment on lines
+56
to
+57
| # Set the minimum macOS deployment target to 13.3 | ||
| set(CMAKE_OSX_DEPLOYMENT_TARGET "13.3" CACHE STRING "Minimum macOS deployment version") |
Comment on lines
71
to
77
| if (test_type_ == "named_pipe") { | ||
| int fd = open(pipe_path_.c_str(), O_WRONLY); | ||
| if (fd == -1) { | ||
| LOG(ERROR) << "Error in opening named pipe"; | ||
| LOG(ERROR) << "Writer: Error opening named pipe"; | ||
| signal_parent(false); | ||
| return; | ||
| } |
Comment on lines
87
to
96
| if (test_type_ == "named_pipe") { | ||
| int fd = open(pipe_path_.c_str(), O_RDONLY); | ||
| if (fd == -1) { | ||
| LOG(ERROR) << "Error in opening named pipe"; | ||
| LOG(ERROR) << "Reader: Error opening named pipe"; | ||
| signal_parent(false); | ||
| return; | ||
| } | ||
| return fd; | ||
| } else { // unnamed_pipe | ||
| } else { // unnamed_pipe, close write end | ||
| close(fd_[1]); | ||
| return fd_[0]; | ||
| } | ||
| } | ||
|
|
||
| void do_writer() { | ||
| std::string buf = "test"; | ||
|
|
||
| int fd = setup_writer(); | ||
| if (fd == -1) { | ||
| signal_parent(); | ||
| return; | ||
| } | ||
|
|
||
| if (write(fd, buf.c_str(), buf.length()) == -1) { | ||
| signal_parent(); | ||
| return; | ||
| } | ||
|
|
||
| runForever(); | ||
| } | ||
|
|
||
| void do_reader() { | ||
| std::array<char, 10> buf; | ||
|
|
||
| int fd = setup_reader(); | ||
| if (fd == -1) { | ||
| signal_parent(); | ||
| return; | ||
| } | ||
|
|
||
| if (read(fd, buf.data(), 10) == -1) { | ||
| signal_parent(); | ||
| return; | ||
| } |
Comment on lines
+218
to
226
| TEST_F(ProcessOpenPipesTest, test_named_pipe) { | ||
| test_named_pipe(); | ||
| ASSERT_GT(test_result_, 0); | ||
| } | ||
|
|
||
| TEST_F(ProcessOpenPipesTest, test_unnamed_pipe) { | ||
| test_unnamed_pipe(); | ||
| ASSERT_GT(test_result_, 0); | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.