Skip to content

Fixed ld error and override warning when compiling xbcloud-t. (when using the -DWITH_UNIT_TESTS:BOOL=TRUE cmake flag) #1676

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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

ZetaMap
Copy link

@ZetaMap ZetaMap commented May 23, 2025

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)

cmake --install build

Results

The warning appears at 26% of the compilation:
image

And the error at 27% of the compilation:
image

Notes

  • The issues are in the trunk, 8.4 and 8.0 branches, so they need to be fixed on those three branches.
  • I tested on a clean machine (not graphical) with just the requested dependencies, as specified in the tutorial.

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

ZetaMap added 2 commits May 23, 2025 16:36
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 &));
      |     
```
@it-percona-cla
Copy link

it-percona-cla commented May 23, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants