Git Product home page Git Product logo

Comments (4)

davies avatar davies commented on June 14, 2024

Can you reproduce this failure by compiling a open source project? Then we can reproduce it and analyze the root cause.

from juicefs.

robotslacker avatar robotslacker commented on June 14, 2024

Reproduce it is not very easy and quickly.
But I'll paste all steps here.

  1. Setup Minio, Redis, JuiceFs ....。 Mount JuiceFs to /data/test
  2. Setup a docker for build env.
     # image name: buildenv
     FROM centos:centos7.9.2009
     MAINTAINER [email protected]

     # Install os packages with local repo
     RUN cd /etc/yum.repos.d/ && rename .repo .repo.bak *
     COPY CentOS-Base.repo /etc/yum.repos.d/
     RUN yum clean all
     RUN yum makecache
     RUN yum install -y wget openssl openssl-devel python3 sshpass sudo nfs-utils rsync
     RUN yum install -y centos-release-scl
     RUN yum install -y devtoolset-11*
     RUN source /opt/rh/devtoolset-11/enable

     # Install c++ compiler
     RUN mv /usr/bin/gcc /usr/bin/gcc-4.8.5
     RUN mv /usr/bin/g++ /usr/bin/g++-4.8.5
     RUN mv /usr/bin/c++ /usr/bin/c++-4.8.5
     RUN ln -s /opt/rh/devtoolset-11/root/bin/gcc /usr/bin/gcc
     RUN ln -s /opt/rh/devtoolset-11/root/bin/g++ /usr/bin/g++
     RUN ln -s /opt/rh/devtoolset-11/root/bin/c++ /usr/bin/c++
     RUN ln -s /opt/rh/devtoolset-11/root/lib/gcc/x86_64-redhat-linux/11  /usr/lib/gcc/x86_64-redhat-linux/11

      ADD jdk1.8.0_291.tar.gz /opt/
      ADD apache-maven-3.6.3.tar.gz /opt/
      ADD git-2.29.2.tar.gz /opt
      ADD cmake-3.16.6-Linux-x86_64.tar.gz /usr/local/
      RUN rm -f /usr/bin/git
      RUN alternatives --install /usr/bin/java java /opt/jdk1.8.0_291/bin/java 500
      RUN alternatives --install /usr/bin/mvn mvn /opt/apache-maven-3.6.3/bin/mvn 500
      RUN alternatives --install /usr/bin/git git /opt/git-2.29.2/bin/git 500
      RUN alternatives --install /usr/bin/cmake cmake /usr/local/cmake-3.16.6-Linux-x86_64/bin/cmake 500

      ADD ninja-1.10.1.tar.gz /tmp
      RUN cd /tmp/ninja-1.10.1 && cmake -Bbuild-cmake -H. && cmake --build build-cmake && cp build-cmake/ninja /usr/local/bin/ninja
      RUN ninja --version
      RUN rm -f -r /tmp/ninja-1.10.1

      ADD llvm-project-15.0.7.src.tar.gz /tmp
      RUN cd /tmp/llvm-project-15.0.7.src/ && cmake -S llvm -B build_release -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/llvm -G "Ninja" -DLLVM_USE_LINKER="gold" -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb" -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt;libcxx;libcxxabi;libunwind" -DCMAKE_C_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/gcc  -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/g++
      RUN cd /tmp/llvm-project-15.0.7.src/build_release/ && ninja -j 12 && ninja install
      RUN rm -f -r /tmp/llvm-project-15.0.7.src
      RUN /usr/local/llvm/bin/clang --version

      ENV JAVA_HOME           /opt/jdk1.8.0_291
      ENV MAVEN_HOME          /opt/apache-maven-3.6.3
      ENV PATH                $PATH:$JAVA_HOME/bin
      ENV MAVEN_CUSTOM_LOCAL  /home/jenkins
  1. Compile clickhouse with docker
    # 打包构建到临时目录
    SNAPSHOT_TMPDIR=/data/test
    docker run \
       -v /home/jenkins/build:/home/jenkins/script \
       -v ${SNAPSHOT_TMPDIR}:/home/jenkins/build/src \
       --privileged \
       <your build docker> \
       sh /home/jenkins/script/build.sh
build.sh:
      cd /home/jenkins/build/src/
      git clone --branch v22.8.4.7-lts https://github.com/ClickHouse/ClickHouse.git
      cd ClickHouse
      git submodule update --init --recursive --jobs 6

      WORKSPACE=$(git rev-parse --show-toplevel)
      echo 代码工作空间[${WORKSPACE}].
      cd ${WORKSPACE}

      echo 清理之前的构建目录...
      BUILD_DIR=${BUILD_DIR:-$WORKSPACE/build}
      rm -rf ${BUILD_DIR}
      mkdir -p ${BUILD_DIR}

      echo 更新SubModule...
      git submodule update --init --recursive --jobs 6

      echo 开始构建代码...
      cd ${BUILD_DIR}
      cmake -DENABLE_TESTS=OFF -DBENCHMARK_ENABLE_TESTING=OFF -DENABLE_S3=OFF \
          -DENABLE_CLICKHOUSE_ALL=OFF \
          -DENABLE_CLICKHOUSE_SERVER=ON -DENABLE_CLICKHOUSE_CLIENT=ON \
          -DENABLE_CLICKHOUSE_PONTUS_TOOL=ON \
          -DCMAKE_BUILD_TYPE=Release  \
          -DCMAKE_C_COMPILER=/usr/local/llvm/bin/clang  \
          -DCMAKE_CXX_COMPILER=/usr/local/llvm/bin/clang++ \
          -DENABLE_CCACHE=0 ${WORKSPACE}
      ninja

from juicefs.

robotslacker avatar robotslacker commented on June 14, 2024

maybe upload docker image and clickhouse source code to "百度网盘" can help you?
I'll upload them later.

from juicefs.

SandyXSD avatar SandyXSD commented on June 14, 2024

The docker image should be helpful.

from juicefs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.