oceanbase / oceanbase/oceanbase

[Bug]: failed to compile unittest on centos8

Open
#903 1 comment 0 reactions 1 assignee View on GitHub

@LINxiansheng is already working on this.

Since May 9, 2022.

module: test status: confirmed type: bug
Dominant language
C++
Stars
10.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Please check the issue list for the same bug
  • I have checked issue list and this bug is encountered for the first time.
Environment
- OB Version&commit_id or other module version&commit_id (e.g. observer V3.1.2 8b23a93):
- Hardware parameter:OS type & Compliler & CPU etc. 
- Others
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian

Linux 8d8df817a355 3.10.0-327.ali2010.alios7.x86_64
Fast Reproduce Steps(Required)
  1. create a docker file based on centos8
FROM centos:centos8

RUN sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* \
    && sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
RUN dnf install -y curl policycoreutils openssh-server perl
RUN yum -y install git wget rpm* cpio make glibc-devel glibc-headers binutils m4
RUN git clone https://github.com/oceanbase/oceanbase

CMD exec /sbin/init
  1. run the container
  2. in the container: cd oceanbase && sh build.sh debug --init && cd build_debug && make -j2 && cd unittest && make
Actual Behavior

compile failed:

[ 31%] Built target sql_ut_base
[ 31%] Building CXX object unittest/sql/optimizer/CMakeFiles/test_route_policy.dir/test_route_policy.cpp.o
[ 31%] Linking CXX executable test_route_policy
ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)
>>> referenced by gtest.h:1378 (./deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1378)
>>>               CMakeFiles/test_route_policy.dir/test_route_policy.cpp.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, int>(char const*, char const*, int const&, int const&))
>>> referenced by gtest.h:1378 (./deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1378)
>>>               CMakeFiles/test_route_policy.dir/test_route_policy.cpp.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<long, long>(char const*, char const*, long const&, long const&))
>>> referenced by gtest.h:1378 (./deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1378)
>>>               CMakeFiles/test_route_policy.dir/test_route_policy.cpp.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<bool, bool>(char const*, char const*, bool const&, bool const&))
>>> referenced 2 more times

ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)
>>> referenced by test_sql_utils.cpp:188 (./unittest/sql/test_sql_utils.cpp:188)
>>>               ../CMakeFiles/sql_ut_base.dir/test_sql_utils.cpp.o:(test::TestSqlUtils::init())
>>> referenced by test_sql_utils.cpp:194 (./unittest/sql/test_sql_utils.cpp:194)
>>>               ../CMakeFiles/sql_ut_base.dir/test_sql_utils.cpp.o:(test::TestSqlUtils::init())
>>> referenced by test_sql_utils.cpp:197 (./unittest/sql/test_sql_utils.cpp:197)
>>>               ../CMakeFiles/sql_ut_base.dir/test_sql_utils.cpp.o:(test::TestSqlUtils::init())
>>> referenced 23 more times
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [unittest/sql/optimizer/CMakeFiles/test_route_policy.dir/build.make:104: unittest/sql/optimizer/test_route_policy] Error 1
make[1]: *** [CMakeFiles/Makefile2:10959: unittest/sql/optimizer/CMakeFiles/test_route_policy.dir/all] Error 2
Expected Behavior

compile success

other information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.