[Tool] separate gen_build_version.py, only build java for fe and cpp for be (backport #61775) (#61826)
Signed-off-by: Kevin Cai <kevin.cai@celerdata.com> Co-authored-by: Kevin Cai <caixiaohua@starrocks.com> Co-authored-by: Kevin Cai <kevin.cai@celerdata.com>
This commit is contained in:
parent
50302db68a
commit
64966e6023
|
|
@ -19,6 +19,7 @@ import os
|
|||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
|
|
@ -199,10 +200,14 @@ const char* STARROCKS_BUILD_ARCH = "{BUILD_ARCH}";
|
|||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--cpp", dest='cpp_path', default="./version.cpp", help="Path of generated cpp file", type=str)
|
||||
parser.add_argument("--java", dest='java_path', default="./Version.java", help="Path of generated java file", type=str)
|
||||
parser.add_argument("--cpp", dest='cpp_path', default="", help="Path of generated cpp file", type=str)
|
||||
parser.add_argument("--java", dest='java_path', default="", help="Path of generated java file", type=str)
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.cpp_path and not args.java_path:
|
||||
print("Neither --cpp nor --java provided, do nothing!", file=sys.stderr)
|
||||
return False
|
||||
|
||||
version = get_version()
|
||||
commit_hash = get_commit_hash()
|
||||
build_type = get_build_type()
|
||||
|
|
@ -217,8 +222,10 @@ def main():
|
|||
|
||||
java_version = get_java_version()
|
||||
|
||||
generate_cpp_file(args.cpp_path, version, commit_hash, build_type, build_time, user, hostname, build_distro_id, build_arch)
|
||||
generate_java_file(args.java_path, version, commit_hash, build_type, build_time, user, hostname, java_version, build_distro_id, build_arch)
|
||||
if args.cpp_path:
|
||||
generate_cpp_file(args.cpp_path, version, commit_hash, build_type, build_time, user, hostname, build_distro_id, build_arch)
|
||||
if args.java_path:
|
||||
generate_java_file(args.java_path, version, commit_hash, build_type, build_time, user, hostname, java_version, build_distro_id, build_arch)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
|||
18
build.sh
18
build.sh
|
|
@ -379,14 +379,15 @@ do
|
|||
done
|
||||
|
||||
# Clean and build generated code
|
||||
echo "Build generated code"
|
||||
cd ${STARROCKS_HOME}/gensrc
|
||||
if [ ${CLEAN} -eq 1 ]; then
|
||||
make clean
|
||||
rm -rf ${STARROCKS_HOME}/fe/fe-core/target
|
||||
if [ ${BUILD_BE} -eq 1 ] || [ ${BUILD_FORMAT_LIB} -eq 1 ] ; then
|
||||
echo "Build generated code"
|
||||
cd ${STARROCKS_HOME}/gensrc
|
||||
if [ ${CLEAN} -eq 1 ]; then
|
||||
make clean
|
||||
fi
|
||||
# DO NOT using parallel make(-j) for gensrc
|
||||
make
|
||||
fi
|
||||
# DO NOT using parallel make(-j) for gensrc
|
||||
make
|
||||
cd ${STARROCKS_HOME}
|
||||
|
||||
if [[ "${MACHINE_TYPE}" == "aarch64" ]]; then
|
||||
|
|
@ -527,7 +528,8 @@ if [ ${FE_MODULES}x != ""x ]; then
|
|||
if [ ${CLEAN} -eq 1 ]; then
|
||||
${MVN_CMD} clean
|
||||
fi
|
||||
${MVN_CMD} $addon_mvn_opts package -am -pl ${FE_MODULES} -DskipTests -T ${PARALLEL}
|
||||
# clean phase is explicited by `--clean` option, don't bother doing clean again.
|
||||
${MVN_CMD} $addon_mvn_opts package -am -pl ${FE_MODULES} -DskipTests -Dmaven.clean.skip=true -T ${PARALLEL}
|
||||
cd ${STARROCKS_HOME}/java-extensions
|
||||
${MVN_CMD} $addon_mvn_opts package -am -pl hadoop-ext -DskipTests -T ${PARALLEL}
|
||||
cd ${STARROCKS_HOME}
|
||||
|
|
|
|||
|
|
@ -1083,8 +1083,6 @@ under the License.
|
|||
<exec executable="${ant.python}">
|
||||
<env key="JAVA_HOME" value="${java.home}"/>
|
||||
<arg value="${starrocks.home}/build-support/gen_build_version.py"/>
|
||||
<arg value="--cpp"/>
|
||||
<arg value="${starrocks.home}/fe/fe-core/target/generated-sources/build"/>
|
||||
<arg value="--java"/>
|
||||
<arg value="${starrocks.home}/fe/fe-core/target/generated-sources/build"/>
|
||||
</exec>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ gen_functions: ${GEN_FUNCTIONS_OUTPUT}
|
|||
|
||||
# generate version info
|
||||
gen_version:
|
||||
${PYTHON} ${CURDIR}/../../build-support/gen_build_version.py --cpp ${BUILD_DIR}/gen_cpp --java ${FE_TARGET_DIR}
|
||||
${PYTHON} ${CURDIR}/../../build-support/gen_build_version.py --cpp ${BUILD_DIR}/gen_cpp
|
||||
.PHONY: gen_version
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue