Fixed ld error and override warning when compiling xbcloud-t. (when using the -DWITH_UNIT_TESTS:BOOL=TRUE cmake flag)#1676
Open
ZetaMap wants to merge 2 commits into
Open
Fixed ld error and override warning when compiling xbcloud-t. (when using the -DWITH_UNIT_TESTS:BOOL=TRUE cmake flag)#1676ZetaMap wants to merge 2 commits into
-DWITH_UNIT_TESTS:BOOL=TRUE cmake flag)#1676ZetaMap wants to merge 2 commits into
Conversation
Fix: ``` /usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: CMakeFiles/xbcloud-t.dir/s3.cc.o: in function `xbcloud::S3_client::retry_error(xbcloud::Http_response*, bool*)': ./percona-xtrabackup/storage/innobase/xtrabackup/src/xbcloud/s3.cc:750:(.text._ZN7xbcloud9S3_client11retry_errorEPNS_13Http_responseEPb+0x1dd): undefined reference to `xbcloud::S3_ec2_instance::fetch_metadata()' collect2: error: ld returned 1 exit status make[2]: *** [storage/innobase/xtrabackup/src/xbcloud/CMakeFiles/xbcloud-t.dir/build.make:180: storage/innobase/xtrabackup/src/xbcloud/xbcloud-t] Error 1 make[1]: *** [CMakeFiles/Makefile2:13540: storage/innobase/xtrabackup/src/xbcloud/CMakeFiles/xbcloud-t.dir/all] Error 2 ```
Fix:
```
In file included from /usr/x86_64-pc-linux-gnu/include/gmock/gmock.h:58,
from ./percona-xtrabackup/storage/innobase/xtrabackup/src/xbcloud/xbcloud-t.cc:1:
./percona-xtrabackup/storage/innobase/xtrabackup/src/xbcloud/xbcloud-t.cc:14:22: warning: 'virtual testing::internal::Function<bool(const xbcloud::Http_request&, xbcloud::Http_response&)>::Result Mock_http_client::make_request(testing::internal::ElemFromList<0, const xbcloud::Http_request&, xbcloud::Http_response&>::type, testing::internal::ElemFromList<1, const xbcloud::Http_request&, xbcloud::Http_response&>::type) const' can be marked override [-Wsuggest-override]
14 | MOCK_CONST_METHOD2(make_request, bool(const Http_request &, Http_response &));
|
```
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.
How to reproduce
Used CMake flags
CMAKE_SRC_CONFIGURE_PARAMS=( -DBUILD_CONFIG:STRING=xtrabackup_release -DINSTALL_LAYOUT:STRING="RPM" -DENABLED_PROFILING:BOOL=TRUE -DENABLE_GCOV:BOOL=FALSE -DENABLE_GPROF:BOOL=FALSE -DENABLED_LOCAL_INFILE:BOOL=TRUE -DWITH_ASAN:BOOL=FALSE -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_EDITLINE:STRING=system -DWITH_UNIT_TESTS:BOOL=TRUE -DWITH_VALGRIND:BOOL=FALSE -DWITH_ZLIB:STRING=system -DWITH_SSL:STRING=system -DWITH_CLIENT_PROTOCOL_TRACING:BOOL=FALSE -DWITH_LZ4:STRING=system -DWITH_MSAN:BOOL=FALSE -DWITH_PROTOBUF:STRING=bundled -DWITH_TEST_TRACE_PLUGIN:BOOL=FALSE -DWITH_UBSAN:BOOL=FALSE -DWITH_XTRABACKUP:BOOL=TRUE -DWITH_FIDO=system -DWITH_ICU=system -DWITH_RAPIDJSON:STRING=bundled -DWITH_MAN_PAGES=OFF )Configure
cmake -B build ${CMAKE_SRC_CONFIGURE_PARAMS[@]}Compile
cmake --build build -j$(nproc)Install (optional)
Results
The warning appears at 26% of the compilation:

And the error at 27% of the compilation:

Notes
Also... I'm wondering, how I can run the unit tests after compilation?