imay closed pull request #404: Improve build scripts
URL: https://github.com/apache/incubator-doris/pull/404
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/build.sh b/build.sh
index 502f84b5..76685f7e 100755
--- a/build.sh
+++ b/build.sh
@@ -41,29 +41,6 @@ if [[ ! -f ${DORIS_THIRDPARTY}/installed/lib/librdkafka.a
]]; then
${DORIS_THIRDPARTY}/build-thirdparty.sh
fi
-# check java home
-if [[ -z ${JAVA_HOME} ]]; then
- echo "Warning: JAVA_HOME is not set, use thirdparty/installed/jdk1.8.0_131"
- export JAVA_HOME=${DORIS_THIRDPARTY}/installed/jdk1.8.0_131
-fi
-
-# check java version
-if [[ ! -z ${JAVA_HOME} ]]; then
- export JAVA=${JAVA_HOME}/bin/java
- JAVA_VER=$(${JAVA} -version 2>&1 | sed 's/.* version
"\(.*\)\.\(.*\)\..*"/\1\2/; 1q' | cut -f1 -d " ")
- if [[ $JAVA_VER -lt 18 ]]; then
- echo "Error: require JAVA with JDK version at least 1.8"
- return 1
- fi
-fi
-
-# check maven
-export MVN=mvn
-if ! ${MVN} --version; then
- echo "Error: mvn is not found"
- exit 1
-fi
-
PARALLEL=$[$(nproc)/4+1]
# Check args
diff --git a/env.sh b/env.sh
index ba4cc7ae..367ba5e0 100755
--- a/env.sh
+++ b/env.sh
@@ -57,4 +57,24 @@ fi
export CLANG_COMPATIBLE_FLAGS=`echo | ${DORIS_GCC_HOME}/bin/gcc -Wp,-v -xc++ -
-fsyntax-only 2>&1 \
| grep -E '^\s+/' | awk '{print "-I" $1}' | tr '\n' ' '`
+# check java home
+if [[ -z ${JAVA_HOME} ]]; then
+ echo "Error: JAVA_HOME is not set"
+ exit 1
+fi
+
+# check java version
+export JAVA=${JAVA_HOME}/bin/java
+JAVA_VER=$(${JAVA} -version 2>&1 | sed 's/.* version
"\(.*\)\.\(.*\)\..*"/\1\2/; 1q' | cut -f1 -d " ")
+if [[ $JAVA_VER -lt 18 ]]; then
+ echo "Error: require JAVA with JDK version at least 1.8"
+ exit 1
+fi
+
+# check maven
+export MVN=mvn
+if ! ${MVN} --version; then
+ echo "Error: mvn is not found"
+ exit 1
+fi
diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index 560c9cf1..77cb8558 100755
--- a/thirdparty/build-thirdparty.sh
+++ b/thirdparty/build-thirdparty.sh
@@ -471,19 +471,6 @@ build_brpc() {
fi
}
-# java
-build_jdk() {
- check_if_source_exist $JDK_SOURCE
-
- if [ -d $TP_INSTALL_DIR/$JDK_SOURCE ];then
- echo "$JDK_SOURCE already installed"
- else
- cp -rf $TP_SOURCE_DIR/$JDK_SOURCE $TP_INSTALL_DIR/
- fi
-
- export JAVA_HOME=$TP_INSTALL_DIR/$JDK_SOURCE
-}
-
# rocksdb
build_rocksdb() {
check_if_source_exist $ROCKSDB_SOURCE
@@ -530,7 +517,6 @@ build_mysql
build_thrift
build_leveldb
build_brpc
-build_jdk
build_rocksdb
build_librdkafka
diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh
index eea00fd0..d5483053 100644
--- a/thirdparty/vars.sh
+++ b/thirdparty/vars.sh
@@ -175,11 +175,6 @@
BRPC_DOWNLOAD="https://github.com/brpc/brpc/archive/v0.9.0.tar.gz"
BRPC_NAME=brpc-0.9.0.tar.gz
BRPC_SOURCE=brpc-0.9.0
-# JDK
-JDK_DOWNLOAD="http://mirror.cnop.net/jdk/linux/jdk-8u131-linux-x64.tar.gz"
-JDK_NAME=jdk-8u131-linux-x64.tar.gz
-JDK_SOURCE=jdk1.8.0_131
-
# rocksdb
ROCKSDB_DOWNLOAD="https://github.com/facebook/rocksdb/archive/v5.14.2.tar.gz"
ROCKSDB_NAME=rocksdb-5.14.2.tar.gz
@@ -191,4 +186,4 @@ LIBRDKAFKA_NAME=librdkafka-0.11.6-RC5.tar.gz
LIBRDKAFKA_SOURCE=librdkafka-0.11.6-RC5
# all thirdparties which need to be downloaded is set in array TP_ARCHIVES
-export TP_ARCHIVES="LIBEVENT OPENSSL THRIFT LLVM CLANG COMPILER_RT PROTOBUF
GFLAGS GLOG GTEST RAPIDJSON SNAPPY GPERFTOOLS ZLIB LZ4 BZIP LZO2 CURL RE2 BOOST
MYSQL BOOST_FOR_MYSQL LEVELDB BRPC JDK ROCKSDB LIBRDKAFKA"
+export TP_ARCHIVES="LIBEVENT OPENSSL THRIFT LLVM CLANG COMPILER_RT PROTOBUF
GFLAGS GLOG GTEST RAPIDJSON SNAPPY GPERFTOOLS ZLIB LZ4 BZIP LZO2 CURL RE2 BOOST
MYSQL BOOST_FOR_MYSQL LEVELDB BRPC ROCKSDB LIBRDKAFKA"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]