google / mysql-ripple

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

CentOS 7: ERROR: missing input file '@external_libs//:mysql/byte_order_generic_x86_64.h' #13

Open centminmod opened 5 years ago

centminmod commented 5 years ago

On CentOS 7.6 64bit with MariaDB 10.3.12, resolved older git issue https://github.com/google/mysql-ripple/issues/12 only to run into another issue

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 updated from 1.8.3 via IUS Community repo https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/repoview/git2u.html

git --version
git version 2.16.5

MariaDB 10.3.12 via official mariadb.org YUM repo for CentOS 7

yum list MariaDB* -q | egrep 'MariaDB|Available|Installed'
Installed Packages
MariaDB-client.x86_64                     10.3.13-1.el7.centos    @mariadb      
MariaDB-common.x86_64                     10.3.13-1.el7.centos    @mariadb      
MariaDB-compat.x86_64                     10.3.13-1.el7.centos    @mariadb      
MariaDB-devel.x86_64                      10.3.13-1.el7.centos    @mariadb      
MariaDB-server.x86_64                     10.3.13-1.el7.centos    @mariadb      
MariaDB-shared.x86_64                     10.3.13-1.el7.centos    @mariadb      
Available Packages
MariaDB-backup.x86_64                     10.3.13-1.el7.centos    mariadb       
MariaDB-cassandra-engine.x86_64           10.3.13-1.el7.centos    mariadb       
MariaDB-connect-engine.x86_64             10.3.13-1.el7.centos    mariadb       
MariaDB-cracklib-password-check.x86_64    10.3.13-1.el7.centos    mariadb       
MariaDB-gssapi-server.x86_64              10.3.13-1.el7.centos    mariadb       
MariaDB-oqgraph-engine.x86_64             10.3.13-1.el7.centos    mariadb       
MariaDB-rocksdb-engine.x86_64             10.3.13-1.el7.centos    mariadb       
MariaDB-test.x86_64                       10.3.13-1.el7.centos    mariadb       
MariaDB-tokudb-engine.x86_64              10.3.13-1.el7.centos    mariadb 
mysqladmin ver
mysqladmin  Ver 9.1 Distrib 10.3.13-MariaDB, for Linux on x86_64
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Server version          10.3.12-MariaDB
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 25 days 15 hours 28 min 9 sec

Threads: 8  Questions: 5238456  Slow queries: 0  Opens: 35  Flush tables: 1  Open tables: 27  Queries per second avg: 2.364
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
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

location for byte_order_generic_x86_64.h

locate byte_order_generic_x86_64.h
/usr/include/mysql/server/byte_order_generic_x86_64.h
pivanof commented 5 years ago

This is interesting. I've setup external_libs.BUILD.bazel file to match what I have on a Debian machine. For me the file is in /usr/include/mysql/byte_order_generic_x86_64.h and is provided by libmariadbclient-dev package, which has version 10.1.37-1. I guess either MariaDB 10.3 has changed the packaging, or the packaging is different for CentOS.

I think the best way to fix this is actually not to depend on the files installed on the system and pull them from MariaDB/MySQL repo. I'll look into doing that. For now you can try to modify external_libs.BUILD.bazel file locally to match your file location. Sorry.

centminmod commented 5 years ago

yeah

on CentOS 7 official mariadb.org 10.0.38 it's at

locate byte_order_generic_x86_64.h
/usr/include/mysql/byte_order_generic_x86_64.h

on CentOS 7 official mariadb 10.1.37 it's at

locate byte_order_generic_x86_64.h
/usr/include/mysql/byte_order_generic_x86_64.h

on mariadb 10.3 it's at different location

rpm -ql MariaDB-devel | grep 'byte_order_generic_x86_64.h'
/usr/include/mysql/server/byte_order_generic_x86_64.h
centminmod commented 5 years ago

tried manual editing of external_libs.BUILD.bazel by finding headers from MariaDB-devel package for 10.3 and matching it against headers defined in external_libs.BUILD.bazel and sed replacing them

headers.txt

        "mysql/byte_order_generic_x86_64.h",
        "mysql/little_endian.h",
        "mysql/m_ctype.h",
        "mysql/m_string.h",
        "mysql/my_alloc.h",
        "mysql/my_attribute.h",
        "mysql/my_byteorder.h",
        "mysql/my_config.h",
        "mysql/my_compiler.h",
        "mysql/my_dbug.h",
        "mysql/my_dir.h",
        "mysql/my_global.h",
        "mysql/my_list.h",
        "mysql/my_net.h",
        "mysql/my_pthread.h",
        "mysql/my_sys.h",
        "mysql/my_valgrind.h",
        "mysql/mysql.h",
        "mysql/mysql_com.h",
        "mysql/mysql_time.h",
        "mysql/mysql_version.h",
        "mysql/mysqld_error.h",
        "mysql/private/violite.h",
        "mysql/typelib.h",

so will sed replace 1st column value with 2nd column value in external_libs.BUILD.bazel

cat headers.txt | sed -e 's|,||' -e 's|"||g' -e 's|mysql/||'| while read i; do name=$(basename $i); echo -n "$name " ;rpm -ql MariaDB-devel |grep '/server/'| fgrep -m1 $i ; done | sed -e 's|\/usr\/include\/mysql||'
byte_order_generic_x86_64.h /server/byte_order_generic_x86_64.h
little_endian.h /server/little_endian.h
m_ctype.h /server/m_ctype.h
m_string.h /server/m_string.h
my_alloc.h /server/my_alloc.h
my_attribute.h /server/my_attribute.h
my_byteorder.h /server/my_byteorder.h
my_config.h /server/my_config.h
my_compiler.h /server/my_compiler.h
my_dbug.h /server/my_dbug.h
my_dir.h /server/my_dir.h
my_global.h /server/my_global.h
my_list.h /server/my_list.h
my_net.h /server/my_net.h
my_pthread.h /server/my_pthread.h
my_sys.h /server/my_sys.h
my_valgrind.h /server/my_valgrind.h
mysql.h /server/mysql.h
mysql_com.h /server/mysql_com.h
mysql_time.h /server/mysql_time.h
mysql_version.h /server/mysql_version.h
mysqld_error.h /server/mysqld_error.h
violite.h /server/private/violite.h
typelib.h /server/typelib.h

so headers in external_libs.BUILD.bazel become

    hdrs = [
        "mysql/server/byte_order_generic_x86_64.h",
        "mysql/server/little_endian.h",
        "mysql/server/m_ctype.h",
        "mysql/server/m_string.h",
        "mysql/server/my_alloc.h",
        "mysql/server/my_attribute.h",
        "mysql/server/my_byteorder.h",
        "mysql/server/my_config.h",
        "mysql/server/my_compiler.h",
        "mysql/server/my_dbug.h",
        "mysql/server/my_dir.h",
        "mysql/server/my_global.h",
        "mysql/server/my_list.h",
        "mysql/server/my_net.h",
        "mysql/server/my_pthread.h",
        "mysql/server/my_sys.h",
        "mysql/server/my_valgrind.h",
        "mysql/server/mysql.h",
        "mysql/server/mysql_com.h",
        "mysql/server/mysql_time.h",
        "mysql/server/mysql_version.h",
        "mysql/server/mysqld_error.h",
        "mysql/server/private/violite.h",
        "mysql/server/typelib.h",
    ],
cd /svr-setup
git clone https://github.com/google/mysql-ripple.git
cd mysql-ripple
source /opt/rh/devtoolset-8/enable
export CC=gcc
cp -a external_libs.BUILD.bazel external_libs.BUILD.bazel.org
cat headers.txt | sed -e 's|,||' -e 's|"||g' -e 's|mysql/||'| while read i; do name=$(basename $i); echo -n "$name " ;rpm -ql MariaDB-devel |grep '/server/'| fgrep -m1 $i ; done | sed -e 's|\/usr\/include\/mysql||' | while read a b; do if [[ $a = 'violite.h' ]]; then a=private/violite.h; fi ;sed -i "s|mysql\/$a|mysql${b}|" external_libs.BUILD.bazel; done
bazel build :all
bazel test :all

but run into error

bazel build :all            
INFO: Analysed 50 targets (1 packages loaded, 56 targets configured).
INFO: Found 50 targets...
ERROR: /svr-setup/mysql-ripple/BUILD.bazel:368:1: C++ compilation of rule '//:encryption' failed (Exit 1) gcc failed: error executing command /opt/rh/devtoolset-8/root/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 ... (remaining 51 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from my_crypt.h:25,
                 from encryption.cc:23:
external/external_libs/mysql/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
 #warning This file should not be included by clients, include only <mysql.h>
  ^~~~~~~
In file included from my_crypt.h:26,
                 from encryption.cc:23:
external/external_libs/mysql/mysql.h:59:10: fatal error: mariadb_com.h: No such file or directory
 #include "mariadb_com.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
INFO: Elapsed time: 1.316s, Critical Path: 0.34s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

from BUILD.bazel

cat -n BUILD.bazel

  368  cc_library(
   369      name = "encryption",
   370      srcs = [
   371          "encryption.cc",
   372      ],
   373      hdrs = [
   374          "encryption.h",
   375      ],
   376      # Reuse encryption support added to mariadb
   377      deps = [
   378          ":base",
   379          ":buffer",
   380          ":byte_order",
   381          ":file",
   382          ":file_util",
   383          ":log_event",
   384          ":monitoring",
   385          ":my_crypt",
   386          ":mysql_constants",
   387          "@com_google_absl//absl/strings",
   388          "@external_libs//:mysqlclient",
   389      ],
   390  )
pivanof commented 5 years ago

This sounds like MariaDB 10.3 has a "mariadb_com.h" header along with "mysql_com.h". So you'll need to add "mysql/server/mariadb_com.h" into hdrs of "mysqlclient" library in external_libs.BUILD.bazel.

centminmod commented 5 years ago

yeah looks like that one is located in a different location LOL

locate mariadb_com.h
/usr/include/mysql/mariadb_com.h
rpm -ql MariaDB-devel | grep mariadb_com
/usr/include/mysql/mariadb_com.h
mariadb_config
Copyright 2011-2015 MariaDB Corporation AB
Get compiler flags for using the MariaDB Connector/C.
Usage: mariadb_config [OPTIONS]
  --cflags        [-I/usr/include/mysql -I/usr/include/mysql/mysql]
  --include       [-I/usr/include/mysql -I/usr/include/mysql/mysql]
  --libs          [-L/usr/lib64/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
  --libs_r        [-L/usr/lib64/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
  --libs_sys      [-lz -ldl -lm -lpthread -lssl -lcrypto]
  --version       [10.3.13]
  --cc_version    [3.0.9]
  --socket        [/var/lib/mysql/mysql.sock]
  --port          [3306]
  --plugindir     [/usr/lib64/mysql/plugin]
  --tlsinfo       [OpenSSL 1.0.1e]

same with my_global.h it seems

bazel build :all
Starting local Bazel server and connecting to it...
INFO: Analysed 50 targets (39 packages loaded, 1395 targets configured).
INFO: Found 50 targets...
ERROR: /svr-setup/mysql-ripple/BUILD.bazel:352:1: C++ compilation of rule '//:my_crypt' failed (Exit 1) gcc failed: error executing command /opt/rh/devtoolset-8/root/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 ... (remaining 30 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from my_crypt.cc:15:
my_crypt.h:25:10: fatal error: my_global.h: No such file or directory
 #include "my_global.h"
          ^~~~~~~~~~~~~
compilation terminated.
INFO: Elapsed time: 11.414s, Critical Path: 0.22s
INFO: 1 process: 1 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
rpm -ql MariaDB-devel | grep my_global.h
/usr/include/mysql/my_global.h
/usr/include/mysql/server/my_global.h
centminmod commented 5 years ago

seems headers are in multiple locations in MariaDB-devel package !

rpm -ql MariaDB-devel | grep include
/usr/include/mysql
/usr/include/mysql/errmsg.h
/usr/include/mysql/ma_list.h
/usr/include/mysql/ma_pvio.h
/usr/include/mysql/ma_tls.h
/usr/include/mysql/mariadb
/usr/include/mysql/mariadb/ma_io.h
/usr/include/mysql/mariadb_com.h
/usr/include/mysql/mariadb_ctype.h
/usr/include/mysql/mariadb_dyncol.h
/usr/include/mysql/mariadb_stmt.h
/usr/include/mysql/mariadb_version.h
/usr/include/mysql/my_config.h
/usr/include/mysql/my_global.h
/usr/include/mysql/my_sys.h
/usr/include/mysql/mysql
/usr/include/mysql/mysql.h
/usr/include/mysql/mysql/client_plugin.h
/usr/include/mysql/mysql/plugin_auth.h
/usr/include/mysql/mysql/plugin_auth_common.h
/usr/include/mysql/mysql_com.h
/usr/include/mysql/mysql_version.h
/usr/include/mysql/mysqld_error.h
/usr/include/mysql/server
/usr/include/mysql/server/big_endian.h
/usr/include/mysql/server/byte_order_generic.h
/usr/include/mysql/server/byte_order_generic_x86.h
/usr/include/mysql/server/byte_order_generic_x86_64.h
/usr/include/mysql/server/decimal.h
/usr/include/mysql/server/errmsg.h
/usr/include/mysql/server/handler_ername.h
/usr/include/mysql/server/handler_state.h
/usr/include/mysql/server/json_lib.h
/usr/include/mysql/server/keycache.h
/usr/include/mysql/server/little_endian.h
/usr/include/mysql/server/m_ctype.h
/usr/include/mysql/server/m_string.h
/usr/include/mysql/server/ma_dyncol.h
/usr/include/mysql/server/my_alloc.h
/usr/include/mysql/server/my_attribute.h
/usr/include/mysql/server/my_byteorder.h
/usr/include/mysql/server/my_compiler.h
/usr/include/mysql/server/my_config.h
/usr/include/mysql/server/my_dbug.h
/usr/include/mysql/server/my_decimal_limits.h
/usr/include/mysql/server/my_dir.h
/usr/include/mysql/server/my_getopt.h
/usr/include/mysql/server/my_global.h
/usr/include/mysql/server/my_list.h
/usr/include/mysql/server/my_net.h
/usr/include/mysql/server/my_pthread.h
/usr/include/mysql/server/my_sys.h
/usr/include/mysql/server/my_valgrind.h
/usr/include/mysql/server/my_xml.h
/usr/include/mysql/server/mysql
/usr/include/mysql/server/mysql.h
/usr/include/mysql/server/mysql/auth_dialog_client.h
/usr/include/mysql/server/mysql/client_plugin.h
/usr/include/mysql/server/mysql/plugin.h
/usr/include/mysql/server/mysql/plugin_audit.h
/usr/include/mysql/server/mysql/plugin_auth.h
/usr/include/mysql/server/mysql/plugin_auth_common.h
/usr/include/mysql/server/mysql/plugin_encryption.h
/usr/include/mysql/server/mysql/plugin_ftparser.h
/usr/include/mysql/server/mysql/plugin_password_validation.h
/usr/include/mysql/server/mysql/psi
/usr/include/mysql/server/mysql/psi/mysql_file.h
/usr/include/mysql/server/mysql/psi/mysql_idle.h
/usr/include/mysql/server/mysql/psi/mysql_socket.h
/usr/include/mysql/server/mysql/psi/mysql_stage.h
/usr/include/mysql/server/mysql/psi/mysql_statement.h
/usr/include/mysql/server/mysql/psi/mysql_table.h
/usr/include/mysql/server/mysql/psi/mysql_thread.h
/usr/include/mysql/server/mysql/psi/psi.h
/usr/include/mysql/server/mysql/psi/psi_abi_v0.h
/usr/include/mysql/server/mysql/psi/psi_abi_v1.h
/usr/include/mysql/server/mysql/psi/psi_abi_v2.h
/usr/include/mysql/server/mysql/psi/psi_base.h
/usr/include/mysql/server/mysql/psi/psi_memory.h
/usr/include/mysql/server/mysql/service_base64.h
/usr/include/mysql/server/mysql/service_debug_sync.h
/usr/include/mysql/server/mysql/service_encryption.h
/usr/include/mysql/server/mysql/service_encryption_scheme.h
/usr/include/mysql/server/mysql/service_kill_statement.h
/usr/include/mysql/server/mysql/service_logger.h
/usr/include/mysql/server/mysql/service_md5.h
/usr/include/mysql/server/mysql/service_my_crypt.h
/usr/include/mysql/server/mysql/service_my_print_error.h
/usr/include/mysql/server/mysql/service_my_snprintf.h
/usr/include/mysql/server/mysql/service_progress_report.h
/usr/include/mysql/server/mysql/service_sha1.h
/usr/include/mysql/server/mysql/service_sha2.h
/usr/include/mysql/server/mysql/service_thd_alloc.h
/usr/include/mysql/server/mysql/service_thd_autoinc.h
/usr/include/mysql/server/mysql/service_thd_error_context.h
/usr/include/mysql/server/mysql/service_thd_rnd.h
/usr/include/mysql/server/mysql/service_thd_specifics.h
/usr/include/mysql/server/mysql/service_thd_timezone.h
/usr/include/mysql/server/mysql/service_thd_wait.h
/usr/include/mysql/server/mysql/service_wsrep.h
/usr/include/mysql/server/mysql/services.h
/usr/include/mysql/server/mysql_com.h
/usr/include/mysql/server/mysql_com_server.h
/usr/include/mysql/server/mysql_embed.h
/usr/include/mysql/server/mysql_time.h
/usr/include/mysql/server/mysql_version.h
/usr/include/mysql/server/mysqld_ername.h
/usr/include/mysql/server/mysqld_error.h
/usr/include/mysql/server/pack.h
/usr/include/mysql/server/private
/usr/include/mysql/server/private/atomic
/usr/include/mysql/server/private/atomic/gcc_builtins.h
/usr/include/mysql/server/private/atomic/gcc_sync.h
/usr/include/mysql/server/private/atomic/generic-msvc.h
/usr/include/mysql/server/private/atomic/solaris.h
/usr/include/mysql/server/private/authors.h
/usr/include/mysql/server/private/bounded_queue.h
/usr/include/mysql/server/private/client_settings.h
/usr/include/mysql/server/private/compat56.h
/usr/include/mysql/server/private/config.h
/usr/include/mysql/server/private/contributors.h
/usr/include/mysql/server/private/create_options.h
/usr/include/mysql/server/private/custom_conf.h
/usr/include/mysql/server/private/datadict.h
/usr/include/mysql/server/private/debug_sync.h
/usr/include/mysql/server/private/derror.h
/usr/include/mysql/server/private/des_key_file.h
/usr/include/mysql/server/private/discover.h
/usr/include/mysql/server/private/dur_prop.h
/usr/include/mysql/server/private/embedded_priv.h
/usr/include/mysql/server/private/event_data_objects.h
/usr/include/mysql/server/private/event_db_repository.h
/usr/include/mysql/server/private/event_parse_data.h
/usr/include/mysql/server/private/event_queue.h
/usr/include/mysql/server/private/event_scheduler.h
/usr/include/mysql/server/private/events.h
/usr/include/mysql/server/private/field.h
/usr/include/mysql/server/private/field_comp.h
/usr/include/mysql/server/private/filesort.h
/usr/include/mysql/server/private/filesort_utils.h
/usr/include/mysql/server/private/ft_global.h
/usr/include/mysql/server/private/gcalc_slicescan.h
/usr/include/mysql/server/private/gcalc_tools.h
/usr/include/mysql/server/private/group_by_handler.h
/usr/include/mysql/server/private/gstream.h
/usr/include/mysql/server/private/ha_partition.h
/usr/include/mysql/server/private/ha_sequence.h
/usr/include/mysql/server/private/handler.h
/usr/include/mysql/server/private/hash.h
/usr/include/mysql/server/private/hash_filo.h
/usr/include/mysql/server/private/heap.h
/usr/include/mysql/server/private/hostname.h
/usr/include/mysql/server/private/init.h
/usr/include/mysql/server/private/innodb_priv.h
/usr/include/mysql/server/private/item.h
/usr/include/mysql/server/private/item_cmpfunc.h
/usr/include/mysql/server/private/item_create.h
/usr/include/mysql/server/private/item_func.h
/usr/include/mysql/server/private/item_geofunc.h
/usr/include/mysql/server/private/item_inetfunc.h
/usr/include/mysql/server/private/item_jsonfunc.h
/usr/include/mysql/server/private/item_row.h
/usr/include/mysql/server/private/item_strfunc.h
/usr/include/mysql/server/private/item_subselect.h
/usr/include/mysql/server/private/item_sum.h
/usr/include/mysql/server/private/item_timefunc.h
/usr/include/mysql/server/private/item_vers.h
/usr/include/mysql/server/private/item_windowfunc.h
/usr/include/mysql/server/private/item_xmlfunc.h
/usr/include/mysql/server/private/key.h
/usr/include/mysql/server/private/keycaches.h
/usr/include/mysql/server/private/lex.h
/usr/include/mysql/server/private/lex_hash.h
/usr/include/mysql/server/private/lex_string.h
/usr/include/mysql/server/private/lex_symbol.h
/usr/include/mysql/server/private/lex_token.h
/usr/include/mysql/server/private/lf.h
/usr/include/mysql/server/private/lock.h
/usr/include/mysql/server/private/log.h
/usr/include/mysql/server/private/log_event.h
/usr/include/mysql/server/private/log_event_old.h
/usr/include/mysql/server/private/log_slow.h
/usr/include/mysql/server/private/maria.h
/usr/include/mysql/server/private/mariadb.h
/usr/include/mysql/server/private/mdl.h
/usr/include/mysql/server/private/mem_root_array.h
/usr/include/mysql/server/private/message.h
/usr/include/mysql/server/private/multi_range_read.h
/usr/include/mysql/server/private/my_alarm.h
/usr/include/mysql/server/private/my_apc.h
/usr/include/mysql/server/private/my_atomic.h
/usr/include/mysql/server/private/my_base.h
/usr/include/mysql/server/private/my_bit.h
/usr/include/mysql/server/private/my_bitmap.h
/usr/include/mysql/server/private/my_check_opt.h
/usr/include/mysql/server/private/my_compare.h
/usr/include/mysql/server/private/my_context.h
/usr/include/mysql/server/private/my_cpu.h
/usr/include/mysql/server/private/my_crypt.h
/usr/include/mysql/server/private/my_decimal.h
/usr/include/mysql/server/private/my_default.h
/usr/include/mysql/server/private/my_handler_errors.h
/usr/include/mysql/server/private/my_json_writer.h
/usr/include/mysql/server/private/my_libwrap.h
/usr/include/mysql/server/private/my_md5.h
/usr/include/mysql/server/private/my_nosys.h
/usr/include/mysql/server/private/my_rdtsc.h
/usr/include/mysql/server/private/my_rnd.h
/usr/include/mysql/server/private/my_service_manager.h
/usr/include/mysql/server/private/my_stacktrace.h
/usr/include/mysql/server/private/my_time.h
/usr/include/mysql/server/private/my_tree.h
/usr/include/mysql/server/private/my_uctype.h
/usr/include/mysql/server/private/my_user.h
/usr/include/mysql/server/private/myisam.h
/usr/include/mysql/server/private/myisamchk.h
/usr/include/mysql/server/private/myisammrg.h
/usr/include/mysql/server/private/myisampack.h
/usr/include/mysql/server/private/mysql_async.h
/usr/include/mysql/server/private/mysqld.h
/usr/include/mysql/server/private/mysqld_default_groups.h
/usr/include/mysql/server/private/mysqld_suffix.h
/usr/include/mysql/server/private/mysys_err.h
/usr/include/mysql/server/private/nt_servc.h
/usr/include/mysql/server/private/opt_range.h
/usr/include/mysql/server/private/opt_subselect.h
/usr/include/mysql/server/private/parse_file.h
/usr/include/mysql/server/private/partition_element.h
/usr/include/mysql/server/private/partition_info.h
/usr/include/mysql/server/private/password.h
/usr/include/mysql/server/private/pcre.h
/usr/include/mysql/server/private/probes_mysql.h
/usr/include/mysql/server/private/probes_mysql_dtrace.h
/usr/include/mysql/server/private/probes_mysql_nodtrace.h
/usr/include/mysql/server/private/procedure.h
/usr/include/mysql/server/private/protocol.h
/usr/include/mysql/server/private/proxy_protocol.h
/usr/include/mysql/server/private/queues.h
/usr/include/mysql/server/private/records.h
/usr/include/mysql/server/private/repl_failsafe.h
/usr/include/mysql/server/private/replication.h
/usr/include/mysql/server/private/rijndael.h
/usr/include/mysql/server/private/rpl_constants.h
/usr/include/mysql/server/private/rpl_filter.h
/usr/include/mysql/server/private/rpl_gtid.h
/usr/include/mysql/server/private/rpl_injector.h
/usr/include/mysql/server/private/rpl_mi.h
/usr/include/mysql/server/private/rpl_parallel.h
/usr/include/mysql/server/private/rpl_record.h
/usr/include/mysql/server/private/rpl_record_old.h
/usr/include/mysql/server/private/rpl_reporting.h
/usr/include/mysql/server/private/rpl_rli.h
/usr/include/mysql/server/private/rpl_tblmap.h
/usr/include/mysql/server/private/rpl_utility.h
/usr/include/mysql/server/private/scheduler.h
/usr/include/mysql/server/private/semisync.h
/usr/include/mysql/server/private/semisync_master.h
/usr/include/mysql/server/private/semisync_master_ack_receiver.h
/usr/include/mysql/server/private/semisync_slave.h
/usr/include/mysql/server/private/service_versions.h
/usr/include/mysql/server/private/session_tracker.h
/usr/include/mysql/server/private/set_var.h
/usr/include/mysql/server/private/slave.h
/usr/include/mysql/server/private/source_revision.h
/usr/include/mysql/server/private/sp.h
/usr/include/mysql/server/private/sp_cache.h
/usr/include/mysql/server/private/sp_head.h
/usr/include/mysql/server/private/sp_pcontext.h
/usr/include/mysql/server/private/sp_rcontext.h
/usr/include/mysql/server/private/spatial.h
/usr/include/mysql/server/private/sql_acl.h
/usr/include/mysql/server/private/sql_admin.h
/usr/include/mysql/server/private/sql_alloc.h
/usr/include/mysql/server/private/sql_alter.h
/usr/include/mysql/server/private/sql_analyse.h
/usr/include/mysql/server/private/sql_analyze_stmt.h
/usr/include/mysql/server/private/sql_array.h
/usr/include/mysql/server/private/sql_audit.h
/usr/include/mysql/server/private/sql_base.h
/usr/include/mysql/server/private/sql_basic_types.h
/usr/include/mysql/server/private/sql_binlog.h
/usr/include/mysql/server/private/sql_bitmap.h
/usr/include/mysql/server/private/sql_bootstrap.h
/usr/include/mysql/server/private/sql_cache.h
/usr/include/mysql/server/private/sql_callback.h
/usr/include/mysql/server/private/sql_class.h
/usr/include/mysql/server/private/sql_cmd.h
/usr/include/mysql/server/private/sql_connect.h
/usr/include/mysql/server/private/sql_const.h
/usr/include/mysql/server/private/sql_crypt.h
/usr/include/mysql/server/private/sql_cte.h
/usr/include/mysql/server/private/sql_cursor.h
/usr/include/mysql/server/private/sql_db.h
/usr/include/mysql/server/private/sql_delete.h
/usr/include/mysql/server/private/sql_derived.h
/usr/include/mysql/server/private/sql_digest.h
/usr/include/mysql/server/private/sql_digest_stream.h
/usr/include/mysql/server/private/sql_do.h
/usr/include/mysql/server/private/sql_error.h
/usr/include/mysql/server/private/sql_explain.h
/usr/include/mysql/server/private/sql_expression_cache.h
/usr/include/mysql/server/private/sql_get_diagnostics.h
/usr/include/mysql/server/private/sql_handler.h
/usr/include/mysql/server/private/sql_help.h
/usr/include/mysql/server/private/sql_hset.h
/usr/include/mysql/server/private/sql_insert.h
/usr/include/mysql/server/private/sql_join_cache.h
/usr/include/mysql/server/private/sql_lex.h
/usr/include/mysql/server/private/sql_lifo_buffer.h
/usr/include/mysql/server/private/sql_list.h
/usr/include/mysql/server/private/sql_load.h
/usr/include/mysql/server/private/sql_locale.h
/usr/include/mysql/server/private/sql_manager.h
/usr/include/mysql/server/private/sql_parse.h
/usr/include/mysql/server/private/sql_partition.h
/usr/include/mysql/server/private/sql_partition_admin.h
/usr/include/mysql/server/private/sql_plist.h
/usr/include/mysql/server/private/sql_plugin.h
/usr/include/mysql/server/private/sql_plugin_compat.h
/usr/include/mysql/server/private/sql_prepare.h
/usr/include/mysql/server/private/sql_priv.h
/usr/include/mysql/server/private/sql_profile.h
/usr/include/mysql/server/private/sql_reload.h
/usr/include/mysql/server/private/sql_rename.h
/usr/include/mysql/server/private/sql_repl.h
/usr/include/mysql/server/private/sql_select.h
/usr/include/mysql/server/private/sql_sequence.h
/usr/include/mysql/server/private/sql_servers.h
/usr/include/mysql/server/private/sql_show.h
/usr/include/mysql/server/private/sql_signal.h
/usr/include/mysql/server/private/sql_sort.h
/usr/include/mysql/server/private/sql_statistics.h
/usr/include/mysql/server/private/sql_string.h
/usr/include/mysql/server/private/sql_table.h
/usr/include/mysql/server/private/sql_tablespace.h
/usr/include/mysql/server/private/sql_test.h
/usr/include/mysql/server/private/sql_time.h
/usr/include/mysql/server/private/sql_trigger.h
/usr/include/mysql/server/private/sql_truncate.h
/usr/include/mysql/server/private/sql_tvc.h
/usr/include/mysql/server/private/sql_type.h
/usr/include/mysql/server/private/sql_type_int.h
/usr/include/mysql/server/private/sql_udf.h
/usr/include/mysql/server/private/sql_union.h
/usr/include/mysql/server/private/sql_update.h
/usr/include/mysql/server/private/sql_view.h
/usr/include/mysql/server/private/sql_window.h
/usr/include/mysql/server/private/ssl_compat.h
/usr/include/mysql/server/private/strfunc.h
/usr/include/mysql/server/private/structs.h
/usr/include/mysql/server/private/sys_vars_shared.h
/usr/include/mysql/server/private/t_ctype.h
/usr/include/mysql/server/private/table.h
/usr/include/mysql/server/private/table_cache.h
/usr/include/mysql/server/private/thr_alarm.h
/usr/include/mysql/server/private/thr_lock.h
/usr/include/mysql/server/private/thr_malloc.h
/usr/include/mysql/server/private/thr_timer.h
/usr/include/mysql/server/private/thread_pool_priv.h
/usr/include/mysql/server/private/threadpool.h
/usr/include/mysql/server/private/transaction.h
/usr/include/mysql/server/private/tzfile.h
/usr/include/mysql/server/private/tztime.h
/usr/include/mysql/server/private/uniques.h
/usr/include/mysql/server/private/unireg.h
/usr/include/mysql/server/private/vers_string.h
/usr/include/mysql/server/private/vers_utils.h
/usr/include/mysql/server/private/violite.h
/usr/include/mysql/server/private/waiting_threads.h
/usr/include/mysql/server/private/welcome_copyright_notice.h
/usr/include/mysql/server/private/winservice.h
/usr/include/mysql/server/private/wqueue.h
/usr/include/mysql/server/private/wsrep.h
/usr/include/mysql/server/private/wsrep_applier.h
/usr/include/mysql/server/private/wsrep_binlog.h
/usr/include/mysql/server/private/wsrep_mysqld.h
/usr/include/mysql/server/private/wsrep_mysqld_c.h
/usr/include/mysql/server/private/wsrep_priv.h
/usr/include/mysql/server/private/wsrep_sst.h
/usr/include/mysql/server/private/wsrep_thd.h
/usr/include/mysql/server/private/wsrep_utils.h
/usr/include/mysql/server/private/wsrep_var.h
/usr/include/mysql/server/private/wsrep_xid.h
/usr/include/mysql/server/sql_common.h
/usr/include/mysql/server/sql_state.h
/usr/include/mysql/server/sslopt-case.h
/usr/include/mysql/server/sslopt-longopts.h
/usr/include/mysql/server/sslopt-vars.h
/usr/include/mysql/server/typelib.h
pivanof commented 5 years ago

That's a little odd. Maybe you should change external_libs.BUILD.bazel to look like this:

cc_library(
    name = "mysqlclient",
    includes = [
        "mysql",
        "mysql/server",
    ],
    hdrs = [
...
    ],
    linkopts = [
        "-l:libmariadbclient.a",
        "-ldl",
        "-lpthread",
        "-lz",
    ],
    visibility = ["//visibility:public"],
)
centminmod commented 4 years ago

revisiting this sorry for late reply changing external_libs.BUILD.bazel to add to includes array "mysql/server",

gives this error

bazel build :all
Starting local Bazel server and connecting to it...
INFO: Analyzed 50 targets (43 packages loaded, 1266 targets configured).
INFO: Found 50 targets...
INFO: Deleting stale sandbox base /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/sandbox
ERROR: missing input file '@external_libs//:mysql/byte_order_generic_x86_64.h'
ERROR: missing input file '@external_libs//:mysql/little_endian.h'
ERROR: missing input file '@external_libs//:mysql/m_ctype.h'
ERROR: missing input file '@external_libs//:mysql/m_string.h'
ERROR: missing input file '@external_libs//:mysql/my_alloc.h'
ERROR: missing input file '@external_libs//:mysql/my_attribute.h'
ERROR: missing input file '@external_libs//:mysql/my_byteorder.h'
ERROR: missing input file '@external_libs//:mysql/my_compiler.h'
ERROR: missing input file '@external_libs//:mysql/my_dbug.h'
ERROR: missing input file '@external_libs//:mysql/my_dir.h'
ERROR: missing input file '@external_libs//:mysql/my_list.h'
ERROR: missing input file '@external_libs//:mysql/my_net.h'
ERROR: missing input file '@external_libs//:mysql/my_pthread.h'
ERROR: missing input file '@external_libs//:mysql/my_valgrind.h'
ERROR: missing input file '@external_libs//:mysql/mysql_time.h'
ERROR: missing input file '@external_libs//:mysql/private/violite.h'
ERROR: missing input file '@external_libs//:mysql/typelib.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17: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:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/little_endian.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/m_ctype.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/m_string.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_alloc.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_attribute.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_byteorder.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_compiler.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_dbug.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_dir.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_list.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_net.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_pthread.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/my_valgrind.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/mysql_time.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/private/violite.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1: @external_libs//:mysqlclient: missing input file '@external_libs//:mysql/typelib.h'
ERROR: /root/.cache/bazel/_bazel_root/09eccf19d891989ba4aefba106852854/external/external_libs/BUILD.bazel:17:1 17 input file(s) do not exist
INFO: Elapsed time: 10.547s, Critical Path: 0.08s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
pivanof commented 4 years ago

Does this error happen when you have changes you've described earlier (https://github.com/google/mysql-ripple/issues/13#issuecomment-474619591)? Specifically I'm asking about changes to hdrs in external_libs.BUILD.bazel file?

centminmod commented 4 years ago

yes above errors are with your changes which as I understand it is changing the file from

    includes = [
        "mysql",
    ],

to

    includes = [
        "mysql",
        "mysql/server",
    ],

right ?

pivanof commented 4 years ago

In the earlier comment (https://github.com/google/mysql-ripple/issues/13#issuecomment-474619591) you've also said that you've changed all hdrs to point to files under "mysql/server/" rather than "mysql/". It looks like that change is also necessary.