-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] upgrade to GoogleTest v1.14.0 (fixes #5976) #5981
Merged
Merged
Conversation
This file contains 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
Ok good! Just updating the version without changing the C++ standard, I see exactly the same errors in CI as reported in #5976.
|
jameslamb
changed the title
WIP: [ci] upgrade to GoogleTest v1.13.0
WIP: [ci] upgrade to GoogleTest v1.13.0 (fixes #5976)
Jul 15, 2023
jameslamb
changed the title
WIP: [ci] upgrade to GoogleTest v1.13.0 (fixes #5976)
WIP: [ci] upgrade to GoogleTest v1.14.0 (fixes #5976)
Nov 15, 2023
jameslamb
changed the title
WIP: [ci] upgrade to GoogleTest v1.14.0 (fixes #5976)
[ci] upgrade to GoogleTest v1.14.0 (fixes #5976)
Nov 15, 2023
@guolinke @shiyu1994 could I please get a review on this one? |
guolinke
approved these changes
Dec 28, 2023
thank you! |
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 #5976
Updates to the latest version of GoogleTest,
v1.14.0
(https://github.com/google/googletest/releases), to get recent miscellaneous bugfixes and improvements and to keep up with versions that LightGBM contributors and uses are more likely to have.Other changes:
CMakeLists.txt
, in favor of setting CMake variableCMAKE_CXX_STANDARD
CMAKE_CXX_STANDARD_REQUIRED
toON
, to ensure a loud error is raised if using a compiler that doesn't support the requested standard (instead of silently falling back to an earlier version, which could lead to cryptic errors or undefined behavior)GoogleTest
Why only go to C++14?
C++14 is the minimum version supported by newer versions of GoogleTest.
I tried to go all the way to C++20 in this PR, but encountered some compilation errors like the following:
Which might be related to fmtlib/fmt#2775 or fmtlib/fmt#2898.
I'm proposing separating the work of adding C++20 out to #6033.
Adding C++14 specifically also improves the project's CI coverage of C++ standards:
C++11
= most tests (Python-package, CMake-based R-package, SWIG, CUDA): C++11C++14
= the cpp testsC++17
= CRAN-style R-package testsReferences
The changes in
CMakeLists.txt
are supported by the following:How I tested this
git clean -d -f -X rm -rf ./build mkdir build cd ./build cmake -DBUILD_CPP_TEST=ON -DUSE_OPENMP=OFF .. VERBOSE=1 \ make -j2 testlightgbm ../testlightgbm
Observed that the expected
--std
flags were passed to the compiler (e.g.