HBASE-15401 Add Zookeeper to third party
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/60d259a6 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/60d259a6 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/60d259a6 Branch: refs/heads/HBASE-14850 Commit: 60d259a6347d2262b6dd20741c2f8a5680b3c9f7 Parents: 30919b3 Author: Elliott Clark <ecl...@apache.org> Authored: Mon Mar 7 14:58:21 2016 -0800 Committer: Elliott Clark <ecl...@apache.org> Committed: Fri May 13 14:36:28 2016 -0700 ---------------------------------------------------------------------- hbase-native-client/Dockerfile | 26 ++++++++- hbase-native-client/third-party/BUCK | 96 ++++++++++++++----------------- 2 files changed, 68 insertions(+), 54 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/60d259a6/hbase-native-client/Dockerfile ---------------------------------------------------------------------- diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile index 5f17f04..1364d22 100644 --- a/hbase-native-client/Dockerfile +++ b/hbase-native-client/Dockerfile @@ -15,8 +15,30 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM pjameson/buck-folly-watchman +FROM cpp_update -RUN apt-get install -y libprotobuf-dev protobuf-compiler clang-format-3.7 vim maven inetutils-ping +ARG CC=/usr/bin/gcc-5 +ARG CXX=/usr/bin/g++-5 +ARG CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 -pthread" +ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 -pthread" + +RUN apt-get install -y clang-format-3.7 vim maven inetutils-ping +RUN git clone --depth 1 --branch v2.6.1 https://github.com/google/protobuf.git /usr/src/protobuf && \ + cd /usr/src/protobuf/ && \ + ./autogen.sh && \ + ./configure --disable-shared && \ + make && \ + make check && \ + make install +RUN cd /usr/src && \ + wget http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz && \ + tar zxf zookeeper-3.4.8.tar.gz && \ + rm -rf zookeeper-3.4.8.tar.gz && \ + cd zookeeper-3.4.8 && \ + cd src/c && \ + ./configure --disable-shared && \ + make && \ + make install && \ + make clean WORKDIR /usr/local/src/hbase/hbase-native-client http://git-wip-us.apache.org/repos/asf/hbase/blob/60d259a6/hbase-native-client/third-party/BUCK ---------------------------------------------------------------------- diff --git a/hbase-native-client/third-party/BUCK b/hbase-native-client/third-party/BUCK index b7baa86..e577a5f 100644 --- a/hbase-native-client/third-party/BUCK +++ b/hbase-native-client/third-party/BUCK @@ -15,68 +15,60 @@ # See the License for the specific language governing permissions and # limitations under the License. -def add_system_libs(names = []): +def add_system_libs(names = [], lib_dir = "/usr/lib/x86_64-linux-gnu", deps = [], exported_linker_flags = []): rules = [] for name in names: - prebuilt_cxx_library( - name = name, - lib_name = name, - lib_dir = "/usr/lib/x86_64-linux-gnu", - visibility = [ 'PUBLIC', ], - ) - rules.append(":" + name) - + gen_rule_name = "gen_lib{}".format(name) + genrule( + name = gen_rule_name, + out = gen_rule_name, + bash = "mkdir -p $OUT && cp {}/lib{}.* $OUT".format(lib_dir,name), + ) + prebuilt_cxx_library( + name = name, + lib_name = name, + lib_dir = '$(location :{})'.format(gen_rule_name), + force_static = True, + deps = deps, + visibility = [ 'PUBLIC' ], + exported_linker_flags = exported_linker_flags, + ) + rules.append(":" + name) return rules system_libs = [ + "unwind", + "lzma", +] +local_libs = [ "double-conversion", "glog", - "protobuf", "gflags", - "unwind", - "lzma", + "protobuf", + "zookeeper_mt", "boost_regex", ] -tp_dep_rules = add_system_libs(system_libs) -prebuilt_cxx_library( - name = "folly", - lib_name = "folly", - lib_dir = "/usr/local/lib", - deps = tp_dep_rules, - exported_linker_flags = [ - "-pthread", - "-lstdc++", - ], - visibility = [ - 'PUBLIC', - ] -) -prebuilt_cxx_library( - name = "follybenchmark", - lib_name = "follybenchmark", - lib_dir = "/usr/local/lib", - deps = tp_dep_rules + [":folly"], - exported_linker_flags = [ - "-pthread", - "-lstdc++", - ], - visibility = [ - 'PUBLIC', - ] -) -prebuilt_cxx_library( - name = "wangle", - lib_name = "wangle", - lib_dir = "/usr/local/lib", - deps = tp_dep_rules + [":folly"], - exported_linker_flags = [ - "-pthread", - "-lstdc++", - ], - visibility = [ - 'PUBLIC', - ] -) + +tp_dep_rules = add_system_libs(system_libs) \ + + add_system_libs(local_libs, lib_dir = "/usr/local/lib") +folly = add_system_libs( + ['folly'], + lib_dir = '/usr/local/lib', + deps = tp_dep_rules, + exported_linker_flags = [ "-pthread", "-lstdc++",] + ) +folly_bench = add_system_libs( + ['follybenchmark'], + lib_dir = '/usr/local/lib', + deps = tp_dep_rules + folly, + exported_linker_flags = [ "-pthread", "-lstdc++",] + ) +wangle = add_system_libs( + ['wangle'], + lib_dir = '/usr/local/lib', + deps = tp_dep_rules + folly, + exported_linker_flags = [ "-pthread", "-lstdc++",] + ) cxx_library( name = 'google-test', srcs = [