kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [kudu] 01/02: [mini-cluster] fix on building mini-cluster JAR
Date Thu, 14 Nov 2019 20:02:58 GMT
This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch branch-1.10.x
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit b3d557518bbefb1e25fca23f9280611247e5af73
Author: Alexey Serbin <alexey@apache.org>
AuthorDate: Tue Nov 12 17:49:55 2019 -0800

    [mini-cluster] fix on building mini-cluster JAR
    
    Prior to this patch, build_mini_cluster_binaries.sh script didn't
    properly handle the case of running in the same workspace that
    was used to build the mini-cluster JAR for prior releases.  That
    might result in not building the required JAR, so no binary
    content would be uploaded by running publish_mini_cluster_binaries.sh
    script later on.
    
    This patch fixes the issue: by default, the build directory
    is re-created upon every run of the build_mini_cluster_binaries.sh
    script unless MINI_CLUSTER_NO_FRESH_BUILD environment variable is set.
    Also, even if MINI_CLUSTER_NO_FRESH_BUILD is set and the build directory
    is not re-created, the script now warns on ambiguity when multiple
    artifact directories are present.
    
    Change-Id: Ic2d5c2a83e2a0ab959e2eb7898d47ab736cd1e1f
    Reviewed-on: http://gerrit.cloudera.org:8080/14702
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <adar@cloudera.com>
    (cherry picked from commit 6406123924c3900e8edd65eebbb3d93963fd2a7b)
    Reviewed-on: http://gerrit.cloudera.org:8080/14709
    Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
    Tested-by: Alexey Serbin <aserbin@cloudera.com>
---
 .../mini-cluster/build_mini_cluster_binaries.sh       | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/build-support/mini-cluster/build_mini_cluster_binaries.sh b/build-support/mini-cluster/build_mini_cluster_binaries.sh
index 61efe34..a133ccd 100755
--- a/build-support/mini-cluster/build_mini_cluster_binaries.sh
+++ b/build-support/mini-cluster/build_mini_cluster_binaries.sh
@@ -72,6 +72,16 @@ BUILD_ROOT=$SOURCE_ROOT/build/mini-cluster
 MINI_CLUSTER_SRCDIR=$SOURCE_ROOT/build-support/mini-cluster
 TARGETS="kudu kudu-tserver kudu-master"
 
+# Remove leftovers from previous releases/builds: rename the existing directory.
+# To skip this step, set the MINI_CLUSTER_NO_FRESH_BUILD environment variable.
+if [ -n "$MINI_CLUSTER_NO_FRESH_BUILD" ]; then
+  echo "WARNING: using existing build directory"
+else
+  suffix=$(date "+%Y%m%d.%H%M%S")
+  echo "Moving existing $BUILD_ROOT into $BUILD_ROOT.$suffix"
+  mv $BUILD_ROOT $BUILD_ROOT.$suffix
+fi
+
 cd $SOURCE_ROOT
 if [ -n "$NO_REBUILD_THIRDPARTY" ]; then
   echo Skipping thirdparty because NO_REBUILD_THIRDPARTY is not empty
@@ -116,7 +126,14 @@ make -j$NUM_PROCS $TARGETS
 # Relocate the binaries.
 $MINI_CLUSTER_SRCDIR/relocate_binaries_for_mini_cluster.py $BUILD_ROOT $TARGETS
 
-ARTIFACT_NAME=$(ls -d kudu-binary* | sed 's#/##' | head -1)
+ARTIFACT_NAME="$(ls -dF kudu-binary-* | egrep '.*/$' | sed 's#/##')"
+if [ $(echo $ARTIFACT_NAME | wc -w) -ne 1 ]; then
+  echo "ERROR: this script can handle only single kudu-binary artifact, but"
+  echo "       multiple kudu-binary-* directories found under $BUILD_ROOT:"
+  echo "       $ARTIFACT_NAME"
+  echo "       Remove extra kudu-binary-* directories"
+  exit 1
+fi
 
 # Strip everything to minimize the size of the tarball we generate.
 echo Stripping symbols...


Mime
View raw message