Skip to content

Commit

Permalink
Add debug image build target for CentOS7 (pingcap#5344)
Browse files Browse the repository at this point in the history
  • Loading branch information
yibin87 authored and Lloyd-Pottiger committed Jul 19, 2022
1 parent 64877b5 commit ce1a403
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
4 changes: 4 additions & 0 deletions release-centos7-llvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ image_tiflash_llvm_base_aarch64:
build_tiflash_release_amd64:
docker run --rm -v $(realpath ..):/build/tics hub.pingcap.net/tiflash/tiflash-llvm-base:amd64 /build/tics/release-centos7-llvm/scripts/build-release.sh

# Add build_tiflash_debug_amd64 target to enable FailPoints on x86. Since outputs are the same as release version, no new package targets added.
build_tiflash_debug_amd64:
docker run --rm -v $(realpath ..):/build/tics hub.pingcap.net/tiflash/tiflash-llvm-base:amd64 /build/tics/release-centos7-llvm/scripts/build-debug.sh

build_tiflash_ci_amd64:
docker run --rm -v $(realpath ..):/build/tics hub.pingcap.net/tiflash/tiflash-llvm-base:amd64 /build/tics/release-centos7-llvm/scripts/build-tiflash-ci.sh

Expand Down
23 changes: 23 additions & 0 deletions release-centos7-llvm/scripts/build-debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# Copyright 2022 PingCAP, Ltd.
#
# 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.


CMAKE_PREFIX_PATH=$1

set -ueox pipefail

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"

${SCRIPTPATH}/build-tiflash-release.sh "DEBUG" "${CMAKE_PREFIX_PATH}"
9 changes: 8 additions & 1 deletion release-centos7-llvm/scripts/build-tiflash-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,21 @@ ENABLE_PCH=${ENABLE_PCH:-ON}
INSTALL_DIR="${SRCPATH}/release-centos7-llvm/tiflash"
rm -rf ${INSTALL_DIR} && mkdir -p ${INSTALL_DIR}

BUILD_DIR="${SRCPATH}/release-centos7-llvm/build-release"
if [ $CMAKE_BUILD_TYPE == "RELWITHDEBINFO" ]; then
BUILD_DIR="$SRCPATH/release-centos7-llvm/build-release"
ENABLE_FAILPOINTS="OFF"
else
BUILD_DIR="$SRCPATH/release-centos7-llvm/build-debug"
ENABLE_FAILPOINTS="ON"
fi
rm -rf ${BUILD_DIR} && mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}

cmake -S "${SRCPATH}" \
${DEFINE_CMAKE_PREFIX_PATH} \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DENABLE_TESTING=OFF \
-DENABLE_TESTS=OFF \
-DENABLE_FAILPOINTS=${ENABLE_FAILPOINTS} \
-Wno-dev \
-DUSE_CCACHE=OFF \
-DRUN_HAVE_STD_REGEX=0 \
Expand Down

0 comments on commit ce1a403

Please sign in to comment.