This is an automated email from the ASF dual-hosted git repository.
laiyingchun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
The following commit(s) were added to refs/heads/master by this push:
new 908313d8e feat(run.sh): make it possible to build partial objects
(#1798)
908313d8e is described below
commit 908313d8ef1e204afbbe352e26aa29090ad9810a
Author: Yingchun Lai <[email protected]>
AuthorDate: Thu Dec 21 11:24:56 2023 +0800
feat(run.sh): make it possible to build partial objects (#1798)
Now it's possible to build partial objects by specifying "-m obj1,obj2"
parameter to `./run.sh build`.
---
.github/workflows/lint_and_test_cpp.yaml | 1 +
run.sh | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/.github/workflows/lint_and_test_cpp.yaml
b/.github/workflows/lint_and_test_cpp.yaml
index 852c83c19..572d11b1a 100644
--- a/.github/workflows/lint_and_test_cpp.yaml
+++ b/.github/workflows/lint_and_test_cpp.yaml
@@ -605,6 +605,7 @@ jobs:
rm -rf hadoop-bin/share/doc
rm -rf zookeeper-bin/docs
- name: Compilation
+ # TODO(yingchun): Append "-m dsn_utils_tests" to the command if not
needed to pack server or tools, for example, the dependencies are static linked.
run: |
ccache -p
ccache -z
diff --git a/run.sh b/run.sh
index d89ac6715..c73d3e529 100755
--- a/run.sh
+++ b/run.sh
@@ -81,6 +81,9 @@ function usage_build()
{
echo "Options for subcommand 'build':"
echo " -h|--help print the help info"
+ echo " -m|--modules specify modules to build, split by ',',"
+ echo " e.g.,
\"pegasus_unit_test,dsn_runtime_tests,dsn_meta_state_tests\","
+ echo " if not set, then build all objects"
echo " -t|--type build type: debug|release, default is
release"
echo " -c|--clear clear pegasus before building, not clear
thirdparty"
echo " --clear_thirdparty clear thirdparty/pegasus before building"
@@ -128,6 +131,7 @@ function run_build()
USE_JEMALLOC=OFF
BUILD_TEST=OFF
IWYU=""
+ BUILD_MODULES=""
while [[ $# > 0 ]]; do
key="$1"
case $key in
@@ -135,6 +139,10 @@ function run_build()
usage_build
exit 0
;;
+ -m|--modules)
+ BUILD_MODULES=$2
+ shift
+ ;;
-t|--type)
BUILD_TYPE="$2"
shift
@@ -213,6 +221,12 @@ function run_build()
exit 1
fi
+ # Replace all ',' to ' ' in $BUILD_MODULES.
+ if [ "$BUILD_MODULES" != "" ]; then
+ BUILD_MODULES=${BUILD_MODULES//,/ }
+ fi
+ echo "build_modules=$BUILD_MODULES"
+
CMAKE_OPTIONS="-DCMAKE_C_COMPILER=${C_COMPILER}
-DCMAKE_CXX_COMPILER=${CXX_COMPILER}
-DUSE_JEMALLOC=${USE_JEMALLOC}"
@@ -325,6 +339,8 @@ function run_build()
pushd $BUILD_DIR
if [ ! -z "${IWYU}" ]; then
make $MAKE_OPTIONS 2> iwyu.out
+ elif [ "$BUILD_MODULES" != "" ]; then
+ make $BUILD_MODULES $MAKE_OPTIONS
else
make install $MAKE_OPTIONS
fi
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]