Skip to content

Commit

Permalink
Update toolchain by removing useless dependencies (pingcap#4002)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanmato1984 authored Feb 12, 2022
1 parent 529a34f commit 982f3c3
Show file tree
Hide file tree
Showing 20 changed files with 2 additions and 131 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ include (libs/libcommon/cmake/find_gperftools.cmake)
include (libs/libcommon/cmake/find_jemalloc.cmake)
include (libs/libcommon/cmake/find_mimalloc.cmake)
include (libs/libcommon/cmake/find_cctz.cmake)
if (ENABLE_MYSQL_STORAGE)
include (libs/libmysqlxx/cmake/find_mysqlclient.cmake)
endif()

include (cmake/print_flags.cmake)

Expand Down
2 changes: 0 additions & 2 deletions deprecated/release-centos7/build/build-tiflash-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ fi

NPROC=${NPROC:-$(nproc || grep -c ^processor /proc/cpuinfo)}
ENABLE_TESTS=${ENABLE_TESTS:-1}
ENABLE_EMBEDDED_COMPILER="FALSE"
UPDATE_CCACHE=${UPDATE_CCACHE:-false}
BUILD_UPDATE_DEBUG_CI_CCACHE=${BUILD_UPDATE_DEBUG_CI_CCACHE:-false}
CCACHE_REMOTE_TAR="${BUILD_BRANCH}-${CMAKE_BUILD_TYPE}.tar"
Expand Down Expand Up @@ -121,7 +120,6 @@ BUILD_DIR="$SRCPATH/release-centos7/build-release"
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
cmake "$SRCPATH" \
-DENABLE_EMBEDDED_COMPILER=$ENABLE_EMBEDDED_COMPILER \
-DENABLE_TESTS=${ENABLE_TESTS} \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DUSE_CCACHE=${USE_CCACHE} \
Expand Down
4 changes: 0 additions & 4 deletions deprecated/release-centos7/build/build-tiflash-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ set -ueox pipefail
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
SRCPATH=$(cd ${SCRIPTPATH}/../..; pwd -P)
NPROC=${NPROC:-$(nproc || grep -c ^processor /proc/cpuinfo)}
ENABLE_EMBEDDED_COMPILER="FALSE"

INSTALL_DIR="${SRCPATH}/release-centos7/tiflash"

Expand All @@ -31,9 +30,6 @@ rm -rf ${BUILD_DIR} && mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}

cmake "${SRCPATH}" ${DEFINE_CMAKE_PREFIX_PATH} \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DENABLE_EMBEDDED_COMPILER=${ENABLE_EMBEDDED_COMPILER} \
-DENABLE_ICU=OFF \
-DENABLE_MYSQL=OFF \
-DENABLE_TESTING=OFF \
-DENABLE_TESTS=OFF \
-Wno-dev \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ BUILD_DIR="/build/release-centos7/build-release"
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
cmake "${SRCPATH}" \
-DENABLE_EMBEDDED_COMPILER=FALSE \
-DENABLE_TESTS=ON \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DUSE_CCACHE=${USE_CCACHE} \
Expand Down
1 change: 0 additions & 1 deletion deprecated/release-centos7/build/static-analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ if [[ "${ENABLE_CLANG_TIDY_CHECK}" == "true" ]]; then

cd ${BUILD_DIR}
cmake "${SRCPATH}" \
-DENABLE_EMBEDDED_COMPILER=FALSE \
-DENABLE_TESTS=0 \
-DCMAKE_BUILD_TYPE=RELWITHDEBINFO \
-DUSE_CCACHE=OFF \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ function bake_llvm_base_aarch64() {
export CXX=clang++
export LD=ld.lld

# OpenSSL
source $SCRIPTPATH/install_openssl.sh
install_openssl "1_1_1l"
export OPENSSL_ROOT_DIR="/usr/local/opt/openssl"

# Go
source $SCRIPTPATH/install_go.sh
install_go "1.17" "arm64"
Expand All @@ -41,10 +36,6 @@ function bake_llvm_base_aarch64() {
install_rust
source $HOME/.cargo/env

# Curl
source $SCRIPTPATH/install_curl.sh
install_curl "7.80.0"

# ccache
source $SCRIPTPATH/install_ccache.sh
install_ccache "4.5.1"
Expand Down
9 changes: 0 additions & 9 deletions release-centos7-llvm/dockerfiles/misc/bake_llvm_base_amd64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ function bake_llvm_base_amd64() {
export CXX=clang++
export LD=ld.lld

# OpenSSL
source $SCRIPTPATH/install_openssl.sh
install_openssl "1_1_1l"
export OPENSSL_ROOT_DIR="/usr/local/opt/openssl"

# Go
source $SCRIPTPATH/install_go.sh
install_go "1.17" "amd64"
Expand All @@ -40,10 +35,6 @@ function bake_llvm_base_amd64() {
install_rust
source $HOME/.cargo/env

# Curl
source $SCRIPTPATH/install_curl.sh
install_curl "7.80.0"

# ccache
source $SCRIPTPATH/install_ccache.sh
install_ccache "4.5.1"
Expand Down
20 changes: 0 additions & 20 deletions release-centos7-llvm/dockerfiles/misc/install_curl.sh

This file was deleted.

28 changes: 0 additions & 28 deletions release-centos7-llvm/dockerfiles/misc/install_openssl.sh

This file was deleted.

2 changes: 1 addition & 1 deletion release-centos7-llvm/dockerfiles/misc/prepare_basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function prepare_basic() {
python3-devel \
bzip2 \
chrpath \
yum install -y git perl wget cmake3 glibc-static zlib-static diffutils ninja-build devtoolset-10
yum install -y curl git perl wget cmake3 glibc-static zlib-devel diffutils ninja-build devtoolset-10
yum -y install 'perl(Data::Dumper)'
yum clean all -y
}
1 change: 0 additions & 1 deletion release-centos7-llvm/dockerfiles/tiflash-llvm-base-aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ENV PATH="/opt/cmake/bin:/usr/local/bin/:${PATH}:/usr/local/go/bin:/root/.cargo/
LIBRARY_PATH="/usr/local/lib/aarch64-unknown-linux-gnu/:${LIBRARY_PATH}" \
LD_LIBRARY_PATH="/usr/local/lib/aarch64-unknown-linux-gnu/:${LD_LIBRARY_PATH}" \
CPLUS_INCLUDE_PATH="/usr/local/include/aarch64-unknown-linux-gnu/c++/v1/:${CPLUS_INCLUDE_PATH}" \
OPENSSL_ROOT_DIR="/usr/local/opt/openssl" \
CC=clang \
CXX=clang++ \
LD=ld.lld
Expand Down
1 change: 0 additions & 1 deletion release-centos7-llvm/dockerfiles/tiflash-llvm-base-amd64
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ENV PATH="/opt/cmake/bin:/usr/local/bin/:${PATH}:/usr/local/go/bin:/root/.cargo/
LIBRARY_PATH="/usr/local/lib/x86_64-unknown-linux-gnu/:${LIBRARY_PATH}" \
LD_LIBRARY_PATH="/usr/local/lib/x86_64-unknown-linux-gnu/:${LD_LIBRARY_PATH}" \
CPLUS_INCLUDE_PATH="/usr/local/include/x86_64-unknown-linux-gnu/c++/v1/:${CPLUS_INCLUDE_PATH}" \
OPENSSL_ROOT_DIR="/usr/local/opt/openssl" \
CC=clang \
CXX=clang++ \
LD=ld.lld
Expand Down
1 change: 0 additions & 1 deletion release-centos7-llvm/env/loader
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ libdir = "{}lib/".format(sysroot)
triple = "{}-unknown-linux-gnu".format(platform.machine())
shell = os.getenv('SHELL', '/bin/sh')
env = {
"OPENSSL_ROOT_DIR" : sysroot,
"PS1" : "[\\u@\\h \\W] (TiFlash) > ",
"CMAKE_PREFIX_PATH" : sysroot,
"PATH" : ":".join([bindir, sysroot + "go/bin/", os.getenv("PATH", "")]),
Expand Down
40 changes: 0 additions & 40 deletions release-centos7-llvm/env/prepare-sysroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ GO_VERSION="1.17"
ARCH=$(uname -m)
GO_ARCH=$([[ "$ARCH" == "aarch64" ]] && echo "arm64" || echo "amd64")
LLVM_VERSION="13.0.0"
CURL_VERSION="7.80.0"
CCACHE_VERSION="4.5.1"
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
SYSROOT="$SCRIPTPATH/sysroot"
OPENSSL_VERSION="1_1_1l"

function install_cmake() {
wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-$ARCH.sh
Expand Down Expand Up @@ -50,48 +48,12 @@ function install_llvm() {
rm -rf llvm-project
}

function install_openssl() {
wget https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_${OPENSSL_VERSION}.tar.gz
tar xvf OpenSSL_${OPENSSL_VERSION}.tar.gz
cd openssl-OpenSSL_${OPENSSL_VERSION}

./config \
-fPIC \
no-shared \
no-afalgeng \
--prefix="$SYSROOT" \
--openssldir="$SYSROOT" \
-static

NPROC=${NPROC:-$(nproc || grep -c ^processor /proc/cpuinfo)}
make -j ${NPROC}
make install_sw install_ssldirs

cd ..
rm -rf openssl-OpenSSL_${OPENSSL_VERSION}
rm -rf OpenSSL_${OPENSSL_VERSION}.tar.gz
}

function install_go() {
wget https://dl.google.com/go/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
tar -C "$SYSROOT" -xzvf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
rm -rf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
}

function install_curl() {
NPROC=$(nproc || grep -c ^processor /proc/cpuinfo)
ENCODED_VERSION=$(echo $CURL_VERSION | tr . _)
wget https://github.com/curl/curl/releases/download/curl-$ENCODED_VERSION/curl-$CURL_VERSION.tar.gz && \
tar zxf curl-$CURL_VERSION.tar.gz && \
cd curl-$CURL_VERSION && \
./configure --with-openssl="$SYSROOT" --disable-shared --prefix=$SYSROOT && \
make -j ${NPROC} && \
make install && \
cd .. && \
rm -rf curl-$CURL_VERSION && \
rm -rf curl-$CURL_VERSION.tar.gz
}

function install_ccache() {
wget "https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz"
tar xvaf "ccache-${CCACHE_VERSION}.tar.gz" && rm -rf "ccache-${CCACHE_VERSION}.tar.gz"
Expand All @@ -113,9 +75,7 @@ mkdir -p $SYSROOT

install_cmake
install_llvm
install_openssl
install_go
install_curl
install_ccache

# some extra steps
Expand Down
2 changes: 0 additions & 2 deletions release-centos7-llvm/scripts/build-tiflash-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ fi

NPROC=${NPROC:-$(nproc || grep -c ^processor /proc/cpuinfo)}
ENABLE_TESTS=${ENABLE_TESTS:-1}
ENABLE_EMBEDDED_COMPILER="FALSE"
UPDATE_CCACHE=${UPDATE_CCACHE:-false}
BUILD_UPDATE_DEBUG_CI_CCACHE=${BUILD_UPDATE_DEBUG_CI_CCACHE:-false}
CCACHE_REMOTE_TAR="${BUILD_BRANCH}-${CMAKE_BUILD_TYPE}-llvm.tar"
Expand Down Expand Up @@ -125,7 +124,6 @@ BUILD_DIR="$SRCPATH/release-centos7-llvm/build-release"
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
cmake "$SRCPATH" ${CMAKE_PREBUILT_LIBS_ROOT_ARG} \
-DENABLE_EMBEDDED_COMPILER=$ENABLE_EMBEDDED_COMPILER \
-DENABLE_TESTS=${ENABLE_TESTS} \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DUSE_CCACHE=${USE_CCACHE} \
Expand Down
2 changes: 0 additions & 2 deletions release-centos7-llvm/scripts/build-tiflash-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ set -ueox pipefail

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
SRCPATH=$(cd ${SCRIPTPATH}/../..; pwd -P)
ENABLE_EMBEDDED_COMPILER="FALSE"

INSTALL_DIR="${SRCPATH}/release-centos7-llvm/tiflash"
BUILD_DIR="${SRCPATH}/release-centos7-llvm/build-release"
rm -rf ${BUILD_DIR} && mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}

cmake "${SRCPATH}" ${DEFINE_CMAKE_PREFIX_PATH} \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DENABLE_EMBEDDED_COMPILER=${ENABLE_EMBEDDED_COMPILER} \
-DENABLE_TESTING=OFF \
-DENABLE_TESTS=OFF \
-Wno-dev \
Expand Down
1 change: 0 additions & 1 deletion release-centos7-llvm/scripts/build-tiflash-ut-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ BUILD_DIR="/build/release-centos7-llvm/build-release"
rm -rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
cmake "${SRCPATH}" \
-DENABLE_EMBEDDED_COMPILER=FALSE \
-DENABLE_TESTS=ON \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DUSE_CCACHE=${USE_CCACHE} \
Expand Down
1 change: 0 additions & 1 deletion release-centos7-llvm/scripts/static-analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ if [[ "${ENABLE_CLANG_TIDY_CHECK}" == "true" ]]; then

cd ${BUILD_DIR}
cmake "${SRCPATH}" \
-DENABLE_EMBEDDED_COMPILER=FALSE \
-DENABLE_TESTS=0 \
-DCMAKE_BUILD_TYPE=RELWITHDEBINFO \
-DUSE_CCACHE=OFF \
Expand Down
1 change: 1 addition & 0 deletions release-darwin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Following OS are tested OK
Your system needs to install

* python 3.7
* openssl 1.1
4 changes: 0 additions & 4 deletions release-darwin/build/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ SRCPATH=${1:-$(cd $SCRIPTPATH/../..; pwd -P)}
PATH=$PATH:/root/.cargo/bin
NPROC=${NPROC:-$(sysctl -n hw.physicalcpu || grep -c ^processor /proc/cpuinfo)}
CMAKE_BUILD_TYPE="RELWITHDEBINFO"
ENABLE_EMBEDDED_COMPILER="FALSE"

install_dir="$SRCPATH/release-darwin/tiflash"
if [ -d "$install_dir" ]; then rm -rf "${install_dir:?}"/*; else mkdir -p "$install_dir"; fi
Expand All @@ -16,9 +15,6 @@ rm -rf $build_dir && mkdir -p $build_dir && cd $build_dir

cmake "$SRCPATH" \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DENABLE_EMBEDDED_COMPILER=$ENABLE_EMBEDDED_COMPILER \
-DENABLE_ICU=OFF \
-DENABLE_MYSQL=OFF \
-Wno-dev \
-DNO_WERROR=ON

Expand Down

0 comments on commit 982f3c3

Please sign in to comment.