-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add darwin build release script (#799)
* add darwin build release script * add hidden-import for cluster manager in darwin build * print git branch correctly if checkout to a tag head Co-authored-by: Tong Zhigao <[email protected]>
- Loading branch information
Showing
9 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
The executable files are located in `tiflash` dir. | ||
|
||
# Deploy Enviroument Requirements | ||
|
||
Following OS are tested OK | ||
|
||
* MacOS Catalina 10.15.5+ | ||
|
||
**NOTE** XCode version should be at least XCode 11 | ||
|
||
Your system needs to install | ||
|
||
* python 3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -ueox pipefail | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
SRCPATH=${1:-$(cd $SCRIPTPATH/../..; pwd -P)} | ||
|
||
install_dir="$SRCPATH/release-darwin/tiflash" | ||
|
||
cd ${SRCPATH}/cluster_manage | ||
./release.sh | ||
cp -r dist/flash_cluster_manager "$install_dir/flash_cluster_manager" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -ueox pipefail | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
SRCPATH=${1:-$(cd $SCRIPTPATH/../..; pwd -P)} | ||
|
||
install_dir="$SRCPATH/release-darwin/tiflash" | ||
if [ -d "$install_dir" ]; then rm -rf "${install_dir:?}"/*; else mkdir -p "$install_dir"; fi | ||
|
||
$SCRIPTPATH/build-tiflash-proxy.sh | ||
$SCRIPTPATH/build-cluster-manager.sh | ||
$SCRIPTPATH/build-tiflash-release.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -ueox pipefail | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
SRCPATH=${1:-$(cd $SCRIPTPATH/../..; pwd -P)} | ||
PATH=$PATH:/root/.cargo/bin | ||
|
||
cd ${SRCPATH}/contrib/tiflash-proxy | ||
make release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
set -ueo pipefail | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
SRCPATH=${1:-$(cd $SCRIPTPATH/../..; pwd -P)} | ||
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 "$SRCPATH/contrib/kvproto" ]; then | ||
cd "$SRCPATH/contrib/kvproto" | ||
rm -rf cpp/kvproto | ||
./scripts/generate_cpp.sh | ||
cd - | ||
fi | ||
|
||
if [ -d "$SRCPATH/contrib/tipb" ]; then | ||
cd "$SRCPATH/contrib/tipb" | ||
rm -rf cpp/tipb | ||
./generate-cpp.sh | ||
cd - | ||
fi | ||
|
||
rm -rf ${SRCPATH}/libs/libtiflash-proxy | ||
mkdir -p ${SRCPATH}/libs/libtiflash-proxy | ||
ln -s ${SRCPATH}/contrib/tiflash-proxy/target/release/libtiflash_proxy.dylib ${SRCPATH}/libs/libtiflash-proxy/libtiflash_proxy.dylib | ||
|
||
build_dir="$SRCPATH/release-darwin/build-release" | ||
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 | ||
|
||
make -j $NPROC | ||
|
||
cp -f "$build_dir/dbms/src/Server/tiflash" "$install_dir/tiflash" | ||
cp -f "${SRCPATH}/libs/libtiflash-proxy/libtiflash_proxy.dylib" "$install_dir/libtiflash_proxy.dylib" | ||
|
||
FILE="$install_dir/tiflash" | ||
otool -L "$FILE" | ||
cd "$install_dir" | ||
# remove .dylib dependency built in other directories | ||
otool -L ${FILE} | egrep -v "$(otool -D ${FILE})" | egrep -v "/(usr/lib|System)" | grep -o "/.*\.dylib" | while read; do | ||
install_name_tool -change $REPLY @executable_path/"$(basename ${REPLY})" $FILE; | ||
done | ||
otool -L "$FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -ueox pipefail | ||
|
||
brew install python | ||
# you might need to run with sudo | ||
pip3 install \ | ||
pybind11 \ | ||
pyinstaller \ | ||
dnspython \ | ||
uri \ | ||
requests \ | ||
urllib3 \ | ||
toml \ | ||
setuptools \ | ||
etcd3 |