google / mysql-ripple

Ripple, a server that can serve as a middleman in MySQL replication
Apache License 2.0
370 stars 47 forks source link

Build failure - git version required for CentOS 7 ? #12

Closed centminmod closed 5 years ago

centminmod commented 5 years ago

I am trying to install on CentOS 7.6 64bit and installed bazel via https://docs.bazel.build/versions/master/install-redhat.html

bazel version  
Build label: 0.23.1- (@non-git)
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Mar 4 13:43:11 2019 (1551706991)
Build timestamp: 1551706991
Build timestamp as int: 1551706991

Using GCC 8.2.1

gcc --version 
gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Git

git --version
git version 1.8.3.1
yum -y install bazel
cd /svr-setup
git clone https://github.com/google/mysql-ripple.git
cd mysql-ripple
source /opt/rh/devtoolset-8/enable
export CC=gcc
bazel build :all
bazel test :all

errors complaining of git Unknown option: -C

bazel build :all             
ERROR: /svr-setup/mysql-ripple/BUILD.bazel:492:1: no such package '@com_google_googletest//': Traceback (most recent call last):
        File "/root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/bazel_tools/tools/build_defs/repo/git.bzl", line 164
                _clone_or_update(ctx)
        File "/root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/bazel_tools/tools/build_defs/repo/git.bzl", line 74, in _clone_or_update
                fail(("error cloning %s:\n%s" % (ctx....)))
error cloning com_google_googletest:
+ cd /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external
+ rm -rf /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest
+ git clone https://github.com/google/googletest.git /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest
+ git -C /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest reset --hard 9ea01728503a445179353113d2854492f41bee84
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
+ git -C /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest fetch origin 9ea01728503a445179353113d2854492f41bee84:9ea01728503a445179353113d2854492f41bee84
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
+ git -C /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest fetch origin 9ea01728503a445179353113d2854492f41bee84:9ea01728503a445179353113d2854492f41bee84
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
 and referenced by '//:log_event_unittest'
ERROR: Analysis of target '//:log_event_unittest' failed; build aborted: no such package '@com_google_googletest//': Traceback (most recent call last):
        File "/root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/bazel_tools/tools/build_defs/repo/git.bzl", line 164
                _clone_or_update(ctx)
        File "/root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/bazel_tools/tools/build_defs/repo/git.bzl", line 74, in _clone_or_update
                fail(("error cloning %s:\n%s" % (ctx....)))
error cloning com_google_googletest:
+ cd /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external
+ rm -rf /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest
+ git clone https://github.com/google/googletest.git /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest
+ git -C /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest reset --hard 9ea01728503a445179353113d2854492f41bee84
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
+ git -C /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest fetch origin 9ea01728503a445179353113d2854492f41bee84:9ea01728503a445179353113d2854492f41bee84
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
+ git -C /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/com_google_googletest fetch origin 9ea01728503a445179353113d2854492f41bee84:9ea01728503a445179353113d2854492f41bee84
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
INFO: Elapsed time: 5.563s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (8 packages loaded, 10 targets configured)
    Fetching @com_google_protobuf; Cloning a6e1cc7e328c45a0cb9856c530c8f6cd23314163 of https://github.com/protocolbuffers/protobuf.git 5s
    Fetching @com_google_googletest; Cloning 9ea01728503a445179353113d2854492f41bee84 of https://github.com/google/googletest.git
pivanof commented 5 years ago

The problem here is that the latest bazel version requires the version of git that is newer than the one installed on CentOS 7. I found a good advice on how to fix this (how to install the newer version of git) here: https://github.com/tensorflow/tensorflow/issues/25747#issuecomment-467843749.

centminmod commented 5 years ago

Cheers thanks for the confirmation. That shouldn't be a problem I can update to git 2.16 provided by IUS Community yum repo https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/repoview/git2u.html

git --version
git version 2.16.5

though run into 2nd errors submitted that issue at https://github.com/google/mysql-ripple/issues/13

bazel build :all
Starting local Bazel server and connecting to it...
DEBUG: Rule 'com_google_googletest' modified arguments {"shallow_since": "1537409963 -0400"}
DEBUG: Rule 'com_google_protobuf' modified arguments {"shallow_since": "1537216885 -0700"}
DEBUG: Rule 'bazel_skylib' modified arguments {"shallow_since": "1535465090 -0400"}
DEBUG: Rule 'com_google_absl' modified arguments {"shallow_since": "1538751188 -0400"}
DEBUG: Rule 'com_google_glog' modified arguments {"shallow_since": "1531725486 +0200"}
DEBUG: Rule 'com_github_gflags_gflags' modified arguments {"shallow_since": "1530829475 +0100"}
INFO: Analysed 50 targets (39 packages loaded, 1394 targets configured).
INFO: Found 50 targets...
INFO: From Compiling log_event.cc:
log_event.cc: In member function 'bool mysql_ripple::RawLogEventData::ParseFromBuffer(const uint8_t*, int)':
log_event.cc:62:30: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
   return header.event_length <= buffer_length;
          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
log_event.cc: In member function 'virtual bool mysql_ripple::FormatDescriptorEvent::ParseFromBuffer(const uint8_t*, int)':
log_event.cc:206:66: warning: comparison of integer expressions of different signedness: 'uint' {aka 'unsigned int'} and 'int' [-Wsign-compare]
   for (uint offset = kServerVersionStringLen + 2 + 4 + 1; offset < len - 1;
                                                           ~~~~~~~^~~~~~~~~
log_event.cc: In member function 'virtual bool mysql_ripple::QueryEvent::SerializeToBuffer(uint8_t*, int) const':
log_event.cc:426:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   if (remain < query.size()) {
       ~~~~~~~^~~~~~~~~~~~~~
INFO: From Compiling gtid.cc:
gtid.cc: In member function 'void mysql_ripple::GTIDList::CheckMerge(mysql_ripple::GTIDList::GTIDStream*, int)':
gtid.cc:635:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<mysql_ripple::GTIDSet::Interval>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   if (i + 1 >= stream->intervals.size())
       ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
gtid.cc: In member function 'bool mysql_ripple::GTIDList::ValidSuccessor(const mysql_ripple::GTID&) const':
gtid.cc:490:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
ERROR: missing input file '@external_libs//:mysql/byte_order_generic_x86_64.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:15:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/byte_order_generic_x86_64.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:15:1 1 input file(s) do not exist
INFO: Elapsed time: 49.073s, Critical Path: 4.61s
INFO: 64 processes: 64 processwrapper-sandbox.
FAILED: Build did NOT complete successfully