google / mysql-ripple

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

centos 7 fatal error: my_config_x86_64.h: No such file or directory #20

Closed yangql closed 5 years ago

yangql commented 5 years ago

uname -a

Linux qabb-qa-mysql2 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux\

os version centos 7.6

============================== when i execute bazel build :all ,I meet error logs as follows

ERROR: /root/mysql-ripple/BUILD.bazel:352:1: C++ compilation of rule '//:my_crypt' failed (Exit 1) process-wrapper failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/f386c459487244300d44883709cb4cd2/sandbox/processwrapper-sandbox/179/execroot/__main__ && \
  exec env - \
    PATH=/opt/isys/bin/db/zandb_agent/scripts:/opt/tsar/bin:/opt/python/bin:/opt/java/bin:/opt/git/bin:/opt/mydumper/bin:/opt/percona-toolkit/bin:/opt/mysql/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/isys/bin:/opt/isys/sbin:/root/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /root/.cache/bazel/_bazel_root/install/2049aedb20b27bd42311c3e0dec4b818/_embedded_binaries/process-wrapper '--timeout=0' '--kill_delay=15' /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF bazel-out/k8-fastbuild/bin/_objs/my_crypt/my_crypt_key_management.pic.d '-frandom-seed=bazel-out/k8-fastbuild/bin/_objs/my_crypt/my_crypt_key_management.pic.o' -fPIC -iquote . -iquote bazel-out/k8-fastbuild/bin -iquote external/external_libs -iquote bazel-out/k8-fastbuild/bin/external/external_libs -isystem external/external_libs/mysql -isystem bazel-out/k8-fastbuild/bin/external/external_libs/mysql -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c my_crypt_key_management.cc -o bazel-out/k8-fastbuild/bin/_objs/my_crypt/my_crypt_key_management.pic.o)
In file included from external/external_libs/mysql/my_global.h:80:0,
                 from my_crypt_key_management.h:21,
                 from my_crypt_key_management.cc:16:
external/external_libs/mysql/my_config.h:14:30: fatal error: my_config_x86_64.h: No such file or directory
 #include "my_config_x86_64.h"
                              ^
compilation terminated.
INFO: Elapsed time: 1.495s, Critical Path: 1.39s
INFO: 3 processes: 3 processwrapper-sandbox.
FAILED: Build did NOT complete successfully

but the file my_config_x86_64.h exists in /usr/include/mysql/

ls /usr/include/mysql/my_config* /usr/include/mysql/my_config.h /usr/include/mysql/my_config_x86_64.h

how can i solve the problem ?

pivanof commented 5 years ago

Bazel doesn't pick up include files unless they are mentioned in BUILD file. Unfortunately this error means that your MySQL installation is different from default installation on Debian, thus you need to adjust BUILD file to make Ripple code compile. I believe all you need to do is to add "mysql/my_config_x86_64.h" here: https://github.com/google/mysql-ripple/blob/master/external_libs.BUILD.bazel#L29.

I'm very sorry for the inconvenience. I plan to change Ripple's BUILD file to pick up MySQL client directly from github instead of relying on the client installed on the system, but I didn't get to that yet.

yangql commented 5 years ago

thanks a lot ^_^ I have solved this problem by adding "mysql/my_config_x86_64.h" to the file external_libs.BUILD.bazel