From 818e5d8e2da0153f6d7bbbd120a1a35d310eeb0c Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 12:49:16 +0800 Subject: [PATCH 01/12] feat: add build env --- .github/workflows/docker-lint.yml | 31 +++ .github/workflows/docker-publish.yml | 51 ++++ .github/workflows/pr.yml | 13 + LICENSE | 201 ++++++++++++++++ build_env/Dockerfile | 80 +++++++ build_env/build_library.sh | 341 +++++++++++++++++++++++++++ build_env/download_source.sh | 43 ++++ build_env/library.csv | 20 ++ env.sh | 6 + set_env_ubuntu.sh | 7 +- 10 files changed, 790 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/docker-lint.yml create mode 100644 .github/workflows/docker-publish.yml create mode 100644 .github/workflows/pr.yml create mode 100644 LICENSE create mode 100644 build_env/Dockerfile create mode 100755 build_env/build_library.sh create mode 100755 build_env/download_source.sh create mode 100644 build_env/library.csv create mode 100644 env.sh diff --git a/.github/workflows/docker-lint.yml b/.github/workflows/docker-lint.yml new file mode 100644 index 0000000..23ec1bb --- /dev/null +++ b/.github/workflows/docker-lint.yml @@ -0,0 +1,31 @@ +name: lint + +on: pull_request + +jobs: + hadolintOnPr: + name: hadolint on pr + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: hadolint + uses: reviewdog/action-hadolint@v1 + with: + github_token: ${{ secrets.github_token }} + level: info + filter_mode: diff_context + reporter: github-pr-review # Default is github-pr-check + + shellcheck: + name: shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: shellcheck + uses: reviewdog/action-shellcheck@v1 + with: + github_token: ${{ secrets.github_token }} + reporter: github-pr-review + path: "." + pattern: "*.sh" + exclude: "./.git/*" diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..7dd66d3 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,51 @@ +name: Docker + +on: + push: + # Publish `main` as Docker `latest` image. + branches: + - main + + # Publish `v1.2.3` tags as releases. + tags: + - v* + - stable + + # Run tests for any PRs. + pull_request: + +env: + IMAGE_NAME: centos7_gcc7_build_env + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build image + run: cd build_env && docker build --no-cache . --file Dockerfile --tag $IMAGE_NAME + - name: Log into registry + if: github.event_name == 'push' + run: echo "${{ secrets.PUSH_TOKEN}}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin + - name: Push image + if: github.event_name == 'push' + run: | + IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + + # Strip "v" prefix from tag name + [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') + + # Use Docker `latest` tag convention + [ "$VERSION" == "main" ] && VERSION=latest + + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + + docker tag $IMAGE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..6105cef --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,13 @@ +name: pr-linter +on: + pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize'] + +jobs: + pr-name-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Install Dependencies + run: npm install @commitlint/config-conventional + - uses: JulienKode/pull-request-name-linter-action@v0.2.0 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/build_env/Dockerfile b/build_env/Dockerfile new file mode 100644 index 0000000..eb32455 --- /dev/null +++ b/build_env/Dockerfile @@ -0,0 +1,80 @@ +# Copyright 2022 the auther of devbox +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# Copyright 2021 4Paradigm +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +FROM centos:7 AS base + +RUN yum update -y && yum install -y centos-release-scl epel-release && yum clean all + +RUN yum install -y devtoolset-7 rh-git218 devtoolset-7-libasan-devel flex \ + autoconf automake unzip bc expect libtool \ + java-1.8.0-openjdk-devel lcov rh-python38-python-devel && \ + yum clean all + +COPY --chown=root:root etc/profile.d/enable-rh.sh /etc/profile.d/ + +FROM base AS builder + +RUN yum install -y gettext byacc xz tcl cppunit-devel && \ + yum clean all + +WORKDIR /depends + +COPY --chown=root:root *.sh ./ + +RUN bash download_source.sh + +RUN bash build_libray.sh + +RUN tar cvzf thirdparty.tar.gz thirdparty/ + +FROM base + +COPY etc/profile.d/enable-thirdparty.sh /etc/profile.d/ +COPY --from=builder /usr/local/ /usr/local/ + +WORKDIR /depends/thirdsrc +COPY --from=builder /depends/thirdsrc/scala-2.12.8.rpm ./ +RUN rpm -i scala-2.12.8.rpm && rm ./*.rpm + +# use compressed in order to reduce image size +# hadolint ignore=DL3010 +COPY --from=builder /depends/thirdparty.tar.gz /depends/ +COPY --from=builder /depends/thirdsrc/zookeeper-3.4.14/ /depends/thirdsrc/zookeeper-3.4.14/ +COPY --from=builder /opt/maven/ /opt/maven/ + +RUN yum install -y rh-python38-python-wheel && yum clean all + +ENV PATH=/opt/rh/rh-git218/root/usr/bin:/opt/rh/rh-python38/root/usr/local/bin:/opt/rh/rh-python38/root/usr/bin:/opt/rh/devtoolset-7/root/usr/bin:/opt/maven/bin:/depends/thirdparty/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV LD_LIBRARY_PATH=/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-python38/root/usr/lib64:/opt/rh/devtoolset-7/root/usr/lib64:/opt/rh/devtoolset-7/root/usr/lib:/opt/rh/devtoolset-7/root/usr/lib64/dyninst +ENV LANG=en_US.UTF-8 + +WORKDIR /root + +CMD [ "/bin/bash" ] diff --git a/build_env/build_library.sh b/build_env/build_library.sh new file mode 100755 index 0000000..ba2509a --- /dev/null +++ b/build_env/build_library.sh @@ -0,0 +1,341 @@ +#!/bin/bash + +# Copyright 2022 author of devbox +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# install_deps.sh: build and install dependencies into to specific directory. +# Installation directory is /depends/thirdparty, while source file located in +# /depends/thirdsrc + +set -eE +set -x + +if [ -d '/opt/rh/devtoolset-7' ] ; then + # shellcheck disable=SC1091 + source /opt/rh/devtoolset-7/enable +fi + +if [ -d '/opt/rh/sclo-git212' ] ; then + # shellcheck disable=SC1091 + source /opt/rh/sclo-git212/enable +fi +if [ -d '/opt/rh/python27' ] ; then + # shellcheck disable=SC1091 + source /opt/rh/python27/enable +fi + +DEPS_SOURCE=/depends/thirdsrc +DEPS_PREFIX=/depends/thirdparty +DEPS_CONFIG="--prefix=$DEPS_PREFIX --disable-shared --with-pic" + +export CXXFLAGS=" -O3 -fPIC" +export CFLAGS=" -O3 -fPIC" + +mkdir -p "$DEPS_PREFIX/lib" "$DEPS_PREFIX/include" "$DEPS_SOURCE" +export PATH=${DEPS_PREFIX}/bin:$PATH + +if ! command -v nproc; then + alias nproc='sysctl -n hw.logicalcpu' +fi + +pushd "$DEPS_SOURCE" + +# install cmake +tar xzf cmake-3.19.* +pushd cmake-3.19.7-Linux-x86_64 +find . -type f -exec install -D -m 755 {} /usr/local/{} \; > /dev/null +popd + +if [ ! -f gtest_succ ]; then + echo "installing gtest ...." + tar xzf googletest-release-1.10.0.tar.gz + + pushd googletest-release-1.10.0 + cmake -DCMAKE_INSTALL_PREFIX="$DEPS_PREFIX" -DCMAKE_CXX_FLAGS=-fPIC + make "-j$(nproc)" + make install + popd + + touch gtest_succ + echo "install gtest done" +fi + +if [ -f "zlib_succ" ]; then + echo "zlib exist" +else + echo "installing zlib..." + tar xzf zlib-1.2.11.tar.gz + pushd zlib-1.2.11 + sed -i '/CFLAGS="${CFLAGS--O3}"/c\ CFLAGS="${CFLAGS--O3} -fPIC"' configure + ./configure --static --prefix="$DEPS_PREFIX" + make -j"$(nproc)" + make install + popd + touch zlib_succ + echo "install zlib done" +fi + +if [ -f "protobuf_succ" ]; then + echo "protobuf exist" +else + echo "start install protobuf ..." + tar zxf protobuf-2.6.1.tar.gz + + pushd protobuf-2.6.1 + ./configure $DEPS_CONFIG CPPFLAGS=-I${DEPS_PREFIX}/include LDFLAGS=-L${DEPS_PREFIX}/lib + make -j"$(nproc)" + make install + popd + + touch protobuf_succ + echo "install protobuf done" +fi + +if [ -f "snappy_succ" ]; then + echo "snappy exist" +else + echo "start install snappy ..." + tar zxf snappy-1.1.1.tar.gz + pushd snappy-1.1.1 + ./configure $DEPS_CONFIG + make "-j$(nproc)" + make install + popd + + touch snappy_succ + echo "install snappy done" +fi + +if [ -f "gflags_succ" ]; then + echo "gflags-2.2.0.tar.gz exist" +else + tar zxf gflags-2.2.0.tar.gz + pushd gflags-2.2.0 + cmake -DCMAKE_INSTALL_PREFIX="$DEPS_PREFIX" -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC + make "-j$(nproc)" + make install + popd + + touch gflags_succ + echo "install gflags done" +fi + +if [ -f "unwind_succ" ]; then + echo "unwind_exist" +else + tar zxf libunwind-1.1.tar.gz + pushd libunwind-1.1 + autoreconf -i + ./configure --prefix="$DEPS_PREFIX" + make -j"$(nproc)" + make install + popd + + touch unwind_succ +fi + +if [ -f "gperf_tool" ]; then + echo "gperf_tool exist" +else + tar zxf gperftools-2.5.tar.gz + pushd gperftools-2.5 + ./configure --enable-cpu-profiler --enable-heap-checker --enable-heap-profiler --enable-static --prefix="$DEPS_PREFIX" + make "-j$(nproc)" + make install + popd + touch gperf_tool +fi + +if [ -f "leveldb_succ" ]; then + echo "leveldb exist" +else + # TODO fix compile on leveldb 1.23 + tar zxf leveldb-1.20.tar.gz + pushd leveldb-1.20 + sed -i 's/^OPT ?= -O2 -DNDEBUG/OPT ?= -O2 -DNDEBUG -fPIC/' Makefile + make "-j$(nproc)" + cp -rf include/* "$DEPS_PREFIX/include" + cp out-static/libleveldb.a "$DEPS_PREFIX/lib" + popd + touch leveldb_succ +fi + +if [ -f "openssl_succ" ]; then + echo "openssl exist" +else + unzip OpenSSL_1_1_0.zip + pushd openssl-OpenSSL_1_1_0 + ./config --prefix="$DEPS_PREFIX" --openssldir="$DEPS_PREFIX" + make "-j$(nproc)" + make install + rm -rf "$DEPS_PREFIX"/lib/libssl.so* + rm -rf "$DEPS_PREFIX"/lib/libcrypto.so* + popd + touch openssl_succ + echo "openssl done" +fi + +if [ -f "glog_succ" ]; then + echo "glog exist" +else + echo "installing glog ..." + tar xzf glog-0.4.0.tar.gz + pushd glog-0.4.0 + ./autogen.sh && CXXFLAGS=-fPIC ./configure --prefix="$DEPS_PREFIX" + make -j"$(nproc)" install + popd + touch glog_succ + echo "installed glog" +fi + +if [ -f "brpc_succ" ]; then + echo "brpc exist" +else + unzip incubator-brpc.zip + pushd incubator-brpc-* + sh config_brpc.sh --with-glog --headers="$DEPS_PREFIX/include" --libs="$DEPS_PREFIX/lib" + make "-j$(nproc)" libbrpc.a output/include + cp -rf output/include/* "$DEPS_PREFIX/include/" + cp libbrpc.a "$DEPS_PREFIX/lib" + popd + + touch brpc_succ + echo "brpc done" +fi + +if [ -f "zk_succ" ] +then + echo "zk exist" +else + tar -zxf apache-zookeeper-3.4.14.tar.gz + pushd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c + autoreconf -if + ./configure --prefix="$DEPS_PREFIX" + make -j"$(nproc)" + make install + popd + touch zk_succ + echo "installed zookeeper c" +fi + +if [ -f "bison_succ" ]; then + echo "bison exist" +else + tar zxf bison-3.4.tar.gz + pushd bison-3.4 + ./configure --prefix="$DEPS_PREFIX" + make install + popd + touch bison_succ +fi + +if [ -f "benchmark_succ" ]; then + echo "benchmark exist" +else + tar zxf v1.5.0.tar.gz + pushd benchmark-1.5.0 + mkdir -p build + cd build + cmake -DCMAKE_INSTALL_PREFIX="$DEPS_PREFIX" -DCMAKE_CXX_FLAGS=-fPIC -DBENCHMARK_ENABLE_GTEST_TESTS=OFF .. + make -j"$(nproc)" + make install + popd + touch benchmark_succ +fi + +if [ -f "swig_succ" ]; then + echo "swig exist" +else + tar -zxf swig-4.0.1.tar.gz + pushd swig-4.0.1 + ./autogen.sh + ./configure --without-pcre --prefix="$DEPS_PREFIX" + make -j"$(nproc)" + make install + popd + touch swig_succ +fi + +if [ -f "yaml_succ" ]; then + echo "yaml-cpp installed" +else + tar -zxf yaml-cpp-0.6.3.tar.gz + pushd yaml-cpp-yaml-cpp-0.6.3 + mkdir -p build + cd build + cmake -DCMAKE_INSTALL_PREFIX="$DEPS_PREFIX" .. + make -j"$(nproc)" + make install + popd + touch yaml_succ +fi + +if [ -f "sqlite_succ" ]; then + echo "sqlite installed" +else + unzip sqlite-*.zip + pushd sqlite-version-3.32.3 + mkdir -p build + cd build + ../configure --prefix="$DEPS_PREFIX" + make -j"$(nproc)" && make install + popd + touch sqlite_succ +fi + +if [ -f "llvm_succ" ]; then + echo "llvm_exist" +else + tar xf llvm-9.0.0.src.tar.xz + pushd llvm-9.0.0.src + mkdir -p build && cd build + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$DEPS_PREFIX" -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_CXX_FLAGS=-fPIC .. + make "-j$(nproc)" + make install + popd + touch llvm_succ +fi + +if [ -f "boost_succ" ]; then + echo "boost exist" +else + tar -zxf boost_1_69_0.tar.gz + pushd boost_1_69_0 + ./bootstrap.sh + ./b2 link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX" + popd + touch boost_succ +fi + +if [ -f "zetasql_succ"]; then + echo "zetasql_succ" +else + wget https://github.com/4paradigm/zetasql/releases/download/v0.2.6/libzetasql-0.2.6-linux-gnu-x86_64-centos.tar.gz + tar -zxvf libzetasql-0.2.6-linux-gnu-x86_64-centos.tar.gz + pushd libzetasql-0.2.6 + cp -rf include/* $DEPS_PREFIX/include/ + cp -rf lib/* $DEPS_CONFIG/lib/ + popd + touch zetasql_succ +fi + +# install maven +tar xzf apache-maven-3.6.3-bin.tar.gz +mv apache-maven-3.6.3 "/opt/maven" + +# Remove dynamic library files for static link +find /depends/thirdparty/lib/ -name "lib*so*" | grep -v "libRemarks" | grep -v "libLTO" | xargs rm +find /depends/thirdparty/lib64/ -name "lib*so*" | grep -v "libRemarks" | grep -v "libLTO" | xargs rm + +popd diff --git a/build_env/download_source.sh b/build_env/download_source.sh new file mode 100755 index 0000000..907f22c --- /dev/null +++ b/build_env/download_source.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2022 the author of devbox +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eE + +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' +DOWNLOAD_DIR=${1:-/depends/thirdsrc} +LIBRARY_CSV="$PWD/library.csv" + +download() +{ + if [ $# -ne 2 ]; then + echo "usage: fetch url output_file" + exit 1 + fi + local url=$1 + local file_name=$2 + if [ ! -e "$file_name" ]; then + echo -e "${GREEN}downloading $url ...${NC}" + curl -SL -o "$file_name" "$url" + echo -e "${GREEN}download $url${NC}" + fi +} + +mkdir -p "$DOWNLOAD_DIR" +pushd "$DOWNLOAD_DIR" +echo -e "${GREEN}downloading source into $DOWNLOAD_DIR${NC}" +less $LIBRARY_CSV | while IFS="," read -r url pkg; do download $url $pkg; done +popd diff --git a/build_env/library.csv b/build_env/library.csv new file mode 100644 index 0000000..030bdba --- /dev/null +++ b/build_env/library.csv @@ -0,0 +1,20 @@ +https://github.com/Kitware/CMake/releases/download/v3.19.7/cmake-3.19.7-Linux-x86_64.tar.gz,cmake-3.19.7-Linux-x86_64.tar.gz +https://github.com/google/googletest/archive/refs/tags/release-1.10.0.tar.gz,googletest-release-1.10.0.tar.gz +https://github.com/madler/zlib/archive/v1.2.11.tar.gz,zlib-1.2.11.tar.gz +https://src.fedoraproject.org/lookaside/pkgs/snappy/snappy-1.1.1.tar.gz/8887e3b7253b22a31f5486bca3cbc1c2/snappy-1.1.1.tar.gz,snappy-1.1.1.tar.gz +https://github.com/gflags/gflags/archive/refs/tags/v2.2.0.tar.gz,gflags-2.2.0.tar.gz +https://github.com/libunwind/libunwind/archive/refs/tags/v1.1.tar.gz,libunwind-1.1.tar.gz +https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz,gperftools-2.5.tar.gz +https://github.com/google/leveldb/archive/refs/tags/v1.20.tar.gz,leveldb-1.20.tar.gz +https://github.com/openssl/openssl/archive/OpenSSL_1_1_0.zip,OpenSSL_1_1_0.zip +https://github.com/google/glog/archive/refs/tags/v0.4.0.tar.gz,glog-0.4.0.tar.gz +https://ftp.gnu.org/gnu/bison/bison-3.4.tar.gz,bison-3.4.tar.gz +https://github.com/swig/swig/archive/v4.0.1.tar.gz,swig-4.0.1.tar.gz +https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.6.3.tar.gz,yaml-cpp-0.6.3.tar.gz +https://github.com/protocolbuffers/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz,protobuf-2.6.1.tar.gz +https://releases.llvm.org/9.0.0/llvm-9.0.0.src.tar.xz,llvm-9.0.0.src.tar.xz +https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz,boost_1_69_0.tar.gz +https://github.com/4paradigm/incubator-brpc/archive/4f69bc0c04abc0734962722ba43aecb4dd7a5dea.zip,incubator-brpc.zip +https://mirrors.ocf.berkeley.edu/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz,apache-maven-3.6.3-bin.tar.gz +https://downloads.lightbend.com/scala/2.12.8/scala-2.12.8.rpm,scala-2.12.8.rpm +https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz,apache-zookeeper-3.4.14.tar.gz diff --git a/env.sh b/env.sh new file mode 100644 index 0000000..332a2bf --- /dev/null +++ b/env.sh @@ -0,0 +1,6 @@ +#! /bin/sh +# +# env.sh +USER_NAME="imotai" +USER_EMAIL="codego.me@gmail.com" + diff --git a/set_env_ubuntu.sh b/set_env_ubuntu.sh index 50240b6..6e38d22 100644 --- a/set_env_ubuntu.sh +++ b/set_env_ubuntu.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash +source ./env.sh sudo apt-get install -y build-essential sudo apt-get install -y vim git -git config --global user.name "imotai" -git config --global user.email "codego.me@gmail.com" +git config --global user.name $USER_NAME +git config --global user.email $USER_EMAIL addgnupghome imotai gpg --full-generate-key -gpg --export --armor "codego.me@gmail.com" +gpg --export --armor $USER_EMAIL git config --global commit.gpgsign true From 6735371a031b7778998fdc1a4e07b635f0108125 Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 13:06:40 +0800 Subject: [PATCH 02/12] fea: add readme --- .github/workflows/docker-lint.yml | 31 ------------------------------- README.md | 29 ++++++++++++++++++++++++++++- build_env/download_source.sh | 2 +- set_env_ubuntu.sh | 8 ++++---- set_vim.sh | 1 - 5 files changed, 33 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/docker-lint.yml diff --git a/.github/workflows/docker-lint.yml b/.github/workflows/docker-lint.yml deleted file mode 100644 index 23ec1bb..0000000 --- a/.github/workflows/docker-lint.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: lint - -on: pull_request - -jobs: - hadolintOnPr: - name: hadolint on pr - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: hadolint - uses: reviewdog/action-hadolint@v1 - with: - github_token: ${{ secrets.github_token }} - level: info - filter_mode: diff_context - reporter: github-pr-review # Default is github-pr-check - - shellcheck: - name: shellcheck - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: shellcheck - uses: reviewdog/action-shellcheck@v1 - with: - github_token: ${{ secrets.github_token }} - reporter: github-pr-review - path: "." - pattern: "*.sh" - exclude: "./.git/*" diff --git a/README.md b/README.md index 3f25221..5e52316 100644 --- a/README.md +++ b/README.md @@ -1 +1,28 @@ -## devbox based on ubuntu +# what's devbox + +devbox helps you to initialize c++ development enviroment quickly + +## 1 + +modify env.sh to your github name and email + +``` +USER_NAME="your github name" +USER_EMAIL="your github emal" +``` + +## 2 + +use `set_env_ubuntu.sh` to complete following steps + +* install git vim +* install build-esssential +* git config +* generate gpg key + +`Note` You must run `git config --global user.signingkey $YOUR_GPG_KEY` manually + +## 3 + +use docker image to compile your c++ project + diff --git a/build_env/download_source.sh b/build_env/download_source.sh index 907f22c..7b19ce0 100755 --- a/build_env/download_source.sh +++ b/build_env/download_source.sh @@ -39,5 +39,5 @@ download() mkdir -p "$DOWNLOAD_DIR" pushd "$DOWNLOAD_DIR" echo -e "${GREEN}downloading source into $DOWNLOAD_DIR${NC}" -less $LIBRARY_CSV | while IFS="," read -r url pkg; do download $url $pkg; done +less "$LIBRARY_CSV" | while IFS="," read -r url pkg; do download "$url" "$pkg"; done popd diff --git a/set_env_ubuntu.sh b/set_env_ubuntu.sh index 6e38d22..50b54ae 100644 --- a/set_env_ubuntu.sh +++ b/set_env_ubuntu.sh @@ -2,9 +2,9 @@ source ./env.sh sudo apt-get install -y build-essential sudo apt-get install -y vim git -git config --global user.name $USER_NAME -git config --global user.email $USER_EMAIL -addgnupghome imotai +git config --global user.name "$USER_NAME" +git config --global user.email "$USER_EMAIL" +addgnupghome "$USER_NAME" gpg --full-generate-key -gpg --export --armor $USER_EMAIL +gpg --export --armor "$USER_EMAIL" git config --global commit.gpgsign true diff --git a/set_vim.sh b/set_vim.sh index 70a2209..07cc7c1 100644 --- a/set_vim.sh +++ b/set_vim.sh @@ -4,4 +4,3 @@ mv ~/.vimrc ~/.vimrc.orig cp -rf vim ~/.vim ln -s ~/.vim/vimrc ~/.vimrc echo "config vim ok , please run PluginInstal in vim!" - From 2fae19d55ad04434707e346c0f13496ddcf079bd Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 13:13:53 +0800 Subject: [PATCH 03/12] feat: add etc thirdparty --- .github/workflows/pr.yml | 13 ------- README.md | 2 +- build_env/etc/profile.d/enable-rh.sh | 22 +++++++++++ build_env/etc/profile.d/enable-thirdparty.sh | 12 ++++++ build_env/etc/yum.repos.d/CentOS-Base.repo | 39 ++++++++++++++++++++ 5 files changed, 74 insertions(+), 14 deletions(-) delete mode 100644 .github/workflows/pr.yml create mode 100644 build_env/etc/profile.d/enable-rh.sh create mode 100644 build_env/etc/profile.d/enable-thirdparty.sh create mode 100644 build_env/etc/yum.repos.d/CentOS-Base.repo diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 6105cef..0000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: pr-linter -on: - pull_request: - types: ['opened', 'edited', 'reopened', 'synchronize'] - -jobs: - pr-name-lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Install Dependencies - run: npm install @commitlint/config-conventional - - uses: JulienKode/pull-request-name-linter-action@v0.2.0 diff --git a/README.md b/README.md index 5e52316..6a5c081 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # what's devbox -devbox helps you to initialize c++ development enviroment quickly +devbox helps you to initialize c++ development enviroment in minutes ## 1 diff --git a/build_env/etc/profile.d/enable-rh.sh b/build_env/etc/profile.d/enable-rh.sh new file mode 100644 index 0000000..2b86cd4 --- /dev/null +++ b/build_env/etc/profile.d/enable-rh.sh @@ -0,0 +1,22 @@ +if [ -d '/opt/rh/devtoolset-7' ] ; then + source /opt/rh/devtoolset-7/enable +fi + +if [ -d '/opt/rh/sclo-git212' ] ; then + source /opt/rh/sclo-git212/enable +fi +if [ -d '/opt/rh/python27' ] ; then + source /opt/rh/python27/enable +fi + +if [ -d '/opt/rh/rh-python36' ]; then + source /opt/rh/rh-python36/enable +fi + +if [ -d '/opt/rh/rh-python38' ]; then + source /opt/rh/rh-python38/enable +fi + +if [ -d '/opt/rh/rh-git218' ] ; then + source /opt/rh/rh-git218/enable +fi diff --git a/build_env/etc/profile.d/enable-thirdparty.sh b/build_env/etc/profile.d/enable-thirdparty.sh new file mode 100644 index 0000000..1d8e70e --- /dev/null +++ b/build_env/etc/profile.d/enable-thirdparty.sh @@ -0,0 +1,12 @@ +if [ -d /depends/thirdparty/bin ]; then + export PATH=/depends/thirdparty/bin:$PATH +fi + +if [ -d /depends/thirdparty/jdk ] ; then + export JAVA_HOME=/depends/thirdparty/jdk + export PATH=$JAVA_HOME/bin:$PATH +fi + +if [ -d /opt/maven/bin ]; then + export PATH=/opt/maven/bin:$PATH +fi diff --git a/build_env/etc/yum.repos.d/CentOS-Base.repo b/build_env/etc/yum.repos.d/CentOS-Base.repo new file mode 100644 index 0000000..611bf6e --- /dev/null +++ b/build_env/etc/yum.repos.d/CentOS-Base.repo @@ -0,0 +1,39 @@ +[C6.10-base] +name=CentOS-6.10 - Base +baseurl=http://vault.centos.org/6.10/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=1 +metadata_expire=never + +[C6.10-updates] +name=CentOS-6.10 - Updates +baseurl=http://vault.centos.org/6.10/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=1 +metadata_expire=never + +[C6.10-extras] +name=CentOS-6.10 - Extras +baseurl=http://vault.centos.org/6.10/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=1 +metadata_expire=never + +[C6.10-contrib] +name=CentOS-6.10 - Contrib +baseurl=http://vault.centos.org/6.10/contrib/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=0 +metadata_expire=never + +[C6.10-centosplus] +name=CentOS-6.10 - CentOSPlus +baseurl=http://vault.centos.org/6.10/centosplus/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=0 +metadata_expire=never From 70cc26a9a7eb1025fab0727ef46221e26c7546e3 Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 13:22:43 +0800 Subject: [PATCH 04/12] feat: add csv to docker --- build_env/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/build_env/Dockerfile b/build_env/Dockerfile index eb32455..e90704e 100644 --- a/build_env/Dockerfile +++ b/build_env/Dockerfile @@ -47,6 +47,7 @@ RUN yum install -y gettext byacc xz tcl cppunit-devel && \ WORKDIR /depends COPY --chown=root:root *.sh ./ +COPY --chown=root:root *.csv ./ RUN bash download_source.sh From 8d6174bd4c2447d8b45aa0c3eabd9894dbf742d4 Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 13:46:57 +0800 Subject: [PATCH 05/12] feat: add install debug info --- build_env/build_library.sh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/build_env/build_library.sh b/build_env/build_library.sh index ba2509a..8e1dcbb 100755 --- a/build_env/build_library.sh +++ b/build_env/build_library.sh @@ -51,10 +51,12 @@ fi pushd "$DEPS_SOURCE" +echo "installing cmake ...." # install cmake -tar xzf cmake-3.19.* +tar xzf cmake-3.19.7-Linux-x86_64.tar.gz pushd cmake-3.19.7-Linux-x86_64 find . -type f -exec install -D -m 755 {} /usr/local/{} \; > /dev/null +echo "install cmake done" popd if [ ! -f gtest_succ ]; then @@ -66,7 +68,6 @@ if [ ! -f gtest_succ ]; then make "-j$(nproc)" make install popd - touch gtest_succ echo "install gtest done" fi @@ -202,6 +203,7 @@ fi if [ -f "brpc_succ" ]; then echo "brpc exist" else + echo "installing brpc..." unzip incubator-brpc.zip pushd incubator-brpc-* sh config_brpc.sh --with-glog --headers="$DEPS_PREFIX/include" --libs="$DEPS_PREFIX/lib" @@ -218,6 +220,7 @@ if [ -f "zk_succ" ] then echo "zk exist" else + echo "installing zookeeper..." tar -zxf apache-zookeeper-3.4.14.tar.gz pushd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c autoreconf -if @@ -232,17 +235,20 @@ fi if [ -f "bison_succ" ]; then echo "bison exist" else + echo "installing bison...." tar zxf bison-3.4.tar.gz pushd bison-3.4 ./configure --prefix="$DEPS_PREFIX" make install popd touch bison_succ + echo "install bison done" fi if [ -f "benchmark_succ" ]; then echo "benchmark exist" else + echo "installing benchmark...." tar zxf v1.5.0.tar.gz pushd benchmark-1.5.0 mkdir -p build @@ -252,11 +258,13 @@ else make install popd touch benchmark_succ + echo "install benchmark done" fi if [ -f "swig_succ" ]; then echo "swig exist" else + echo "installing swig ...." tar -zxf swig-4.0.1.tar.gz pushd swig-4.0.1 ./autogen.sh @@ -265,11 +273,13 @@ else make install popd touch swig_succ + echo "install swig done" fi if [ -f "yaml_succ" ]; then echo "yaml-cpp installed" else + echo "installing yaml-cpp...." tar -zxf yaml-cpp-0.6.3.tar.gz pushd yaml-cpp-yaml-cpp-0.6.3 mkdir -p build @@ -279,11 +289,13 @@ else make install popd touch yaml_succ + echo "install yaml-cpp done" fi if [ -f "sqlite_succ" ]; then echo "sqlite installed" else + echo "installing sqlite..." unzip sqlite-*.zip pushd sqlite-version-3.32.3 mkdir -p build @@ -292,11 +304,13 @@ else make -j"$(nproc)" && make install popd touch sqlite_succ + echo "install sqlite done" fi if [ -f "llvm_succ" ]; then echo "llvm_exist" else + echo "installing llvm...." tar xf llvm-9.0.0.src.tar.xz pushd llvm-9.0.0.src mkdir -p build && cd build @@ -305,22 +319,26 @@ else make install popd touch llvm_succ + echo "install llvm done" fi if [ -f "boost_succ" ]; then echo "boost exist" else + echo "installing boost...." tar -zxf boost_1_69_0.tar.gz pushd boost_1_69_0 ./bootstrap.sh ./b2 link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX" popd touch boost_succ + echo "install boost done" fi -if [ -f "zetasql_succ"]; then +if [ -f "zetasql_succ" ]; then echo "zetasql_succ" else + echo "installing zetasql...." wget https://github.com/4paradigm/zetasql/releases/download/v0.2.6/libzetasql-0.2.6-linux-gnu-x86_64-centos.tar.gz tar -zxvf libzetasql-0.2.6-linux-gnu-x86_64-centos.tar.gz pushd libzetasql-0.2.6 @@ -328,6 +346,7 @@ else cp -rf lib/* $DEPS_CONFIG/lib/ popd touch zetasql_succ + echo "install zetasql done" fi # install maven From 422ddbc9872269f44dae36e8952493a41b80eadd Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 14:29:48 +0800 Subject: [PATCH 06/12] fix: fix spell error --- build_env/Dockerfile | 2 +- build_env/build_library.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/build_env/Dockerfile b/build_env/Dockerfile index e90704e..62c9dea 100644 --- a/build_env/Dockerfile +++ b/build_env/Dockerfile @@ -51,7 +51,7 @@ COPY --chown=root:root *.csv ./ RUN bash download_source.sh -RUN bash build_libray.sh +RUN bash build_library.sh RUN tar cvzf thirdparty.tar.gz thirdparty/ diff --git a/build_env/build_library.sh b/build_env/build_library.sh index 8e1dcbb..8883a11 100755 --- a/build_env/build_library.sh +++ b/build_env/build_library.sh @@ -127,7 +127,6 @@ else make "-j$(nproc)" make install popd - touch gflags_succ echo "install gflags done" fi From aeeeb491e266947e507b0717cfc816119b125593 Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 14:50:53 +0800 Subject: [PATCH 07/12] fix: add google benchmark --- build_env/library.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/build_env/library.csv b/build_env/library.csv index 030bdba..34acccb 100644 --- a/build_env/library.csv +++ b/build_env/library.csv @@ -18,3 +18,4 @@ https://github.com/4paradigm/incubator-brpc/archive/4f69bc0c04abc0734962722ba43a https://mirrors.ocf.berkeley.edu/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz,apache-maven-3.6.3-bin.tar.gz https://downloads.lightbend.com/scala/2.12.8/scala-2.12.8.rpm,scala-2.12.8.rpm https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz,apache-zookeeper-3.4.14.tar.gz +https://github.com/google/benchmark/archive/refs/tags/v1.5.0.tar.gz,v1.5.0.tar.gz From a42287357ddf7ac17378739ba1767bce129cee1e Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 15:08:08 +0800 Subject: [PATCH 08/12] fix: remove sqlite --- build_env/build_library.sh | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/build_env/build_library.sh b/build_env/build_library.sh index 8883a11..bcbd3af 100755 --- a/build_env/build_library.sh +++ b/build_env/build_library.sh @@ -291,21 +291,6 @@ else echo "install yaml-cpp done" fi -if [ -f "sqlite_succ" ]; then - echo "sqlite installed" -else - echo "installing sqlite..." - unzip sqlite-*.zip - pushd sqlite-version-3.32.3 - mkdir -p build - cd build - ../configure --prefix="$DEPS_PREFIX" - make -j"$(nproc)" && make install - popd - touch sqlite_succ - echo "install sqlite done" -fi - if [ -f "llvm_succ" ]; then echo "llvm_exist" else From c5c4a57566033336e678d1b7fec3ba3d2e78cf7a Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 18:02:53 +0800 Subject: [PATCH 09/12] fix: update library --- build_env/library.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_env/library.csv b/build_env/library.csv index 34acccb..1fe09a8 100644 --- a/build_env/library.csv +++ b/build_env/library.csv @@ -13,7 +13,7 @@ https://github.com/swig/swig/archive/v4.0.1.tar.gz,swig-4.0.1.tar.gz https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.6.3.tar.gz,yaml-cpp-0.6.3.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz,protobuf-2.6.1.tar.gz https://releases.llvm.org/9.0.0/llvm-9.0.0.src.tar.xz,llvm-9.0.0.src.tar.xz -https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz,boost_1_69_0.tar.gz +https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.gz,boost_1_69_0.tar.gz https://github.com/4paradigm/incubator-brpc/archive/4f69bc0c04abc0734962722ba43aecb4dd7a5dea.zip,incubator-brpc.zip https://mirrors.ocf.berkeley.edu/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz,apache-maven-3.6.3-bin.tar.gz https://downloads.lightbend.com/scala/2.12.8/scala-2.12.8.rpm,scala-2.12.8.rpm From 93e23cfb8a0e60d39d9b5456cf63630e75b503b5 Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 21:35:32 +0800 Subject: [PATCH 10/12] fix: remove python in boost --- build_env/build_library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_env/build_library.sh b/build_env/build_library.sh index bcbd3af..b06b343 100755 --- a/build_env/build_library.sh +++ b/build_env/build_library.sh @@ -313,7 +313,7 @@ else tar -zxf boost_1_69_0.tar.gz pushd boost_1_69_0 ./bootstrap.sh - ./b2 link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX" + ./b2 --without-python link=static cxxflags=-fPIC cflags=-fPIC release install --prefix="$DEPS_PREFIX" popd touch boost_succ echo "install boost done" From 4962172255392dc7c8d4ceaba8819137a6c490aa Mon Sep 17 00:00:00 2001 From: imotai Date: Wed, 16 Feb 2022 23:12:19 +0800 Subject: [PATCH 11/12] fix: fix wget not found error --- build_env/build_library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_env/build_library.sh b/build_env/build_library.sh index b06b343..04897b8 100755 --- a/build_env/build_library.sh +++ b/build_env/build_library.sh @@ -323,7 +323,7 @@ if [ -f "zetasql_succ" ]; then echo "zetasql_succ" else echo "installing zetasql...." - wget https://github.com/4paradigm/zetasql/releases/download/v0.2.6/libzetasql-0.2.6-linux-gnu-x86_64-centos.tar.gz + curl -SL -o libzetasql-0.2.6-linux-gnu-x86_64-centos.tar.gz https://github.com/4paradigm/zetasql/releases/download/v0.2.6/libzetasql-0.2.6-linux-gnu-x86_64-centos.tar.gz tar -zxvf libzetasql-0.2.6-linux-gnu-x86_64-centos.tar.gz pushd libzetasql-0.2.6 cp -rf include/* $DEPS_PREFIX/include/ From 072f5837653629a1ac4f81a58534d85a491d4ad4 Mon Sep 17 00:00:00 2001 From: imotai Date: Thu, 17 Feb 2022 09:34:31 +0800 Subject: [PATCH 12/12] fix: fix install zetasql build --- build_env/build_library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_env/build_library.sh b/build_env/build_library.sh index 04897b8..2b3c1b8 100755 --- a/build_env/build_library.sh +++ b/build_env/build_library.sh @@ -327,7 +327,7 @@ else tar -zxvf libzetasql-0.2.6-linux-gnu-x86_64-centos.tar.gz pushd libzetasql-0.2.6 cp -rf include/* $DEPS_PREFIX/include/ - cp -rf lib/* $DEPS_CONFIG/lib/ + cp -rf lib/* $DEPS_PREFIX/lib/ popd touch zetasql_succ echo "install zetasql done"