fix(test): avoid overriding the configured C++ standard - #6
Merged
zchuango merged 1 commit intoAug 14, 2026
Merged
Conversation
zchuango
merged commit Aug 14, 2026
e7c1ee3
into
LinQuickDev:fix/issue-3236-gtest-build
1 check passed
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.
What problem does this PR solve?
Issue Number:
Problem Summary:
When bRPC is configured with Protobuf 22 or newer,
config_brpc.shselects C++17 because the accompanying Abseil dependency requires it.However, after including the generated
config.mk,test/Makefileunconditionally appends-std=c++14. The resulting compiler options contain:Because the last
-stdoption takes precedence, unit tests are compiled as C++14. With Protobuf 25.1 and Abseil 20230802, this causes compilation failures in Abseil headers, including:The failure was reproduced for the following targets:
brpc_load_balancer_unittest.obrpc_builtin_service_unittest.oKeeping all other compiler options unchanged and making C++17 the effective standard allowed both targets to compile successfully.
What is changed and the side effects?
Changed:
Remove the test-specific
-std=c++14option fromtest/Makefile, allowing the test build to inherit the C++ standard selected byconfig_brpc.shthroughconfig.mk.The resulting behavior is:
This prevents
test/Makefilefrom overriding the C++ standard selected according to the dependency version.Validation environment:
Validation performed:
test/Makefile.testdirectory withmake -j2.brpc_builtin_service_unittest: 21 tests passed.brpc_load_balancer_unittest: 15 tests passed with the long-runningLoadBalancerTest.fairnessbenchmark excluded.The complete
brpc_load_balancer_unittestrun did not finish within the five-minute local timeout while running thefairnessbenchmark. No assertion failure was observed before the timeout.Side effects: