You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2020/03/11 16:12:27 UTC

[kudu] branch master updated (1cb4a0a -> 0b858e6)

This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git.


    from 1cb4a0a  ranger: fix the expected main class for the subprocess
     new 3782dd6  [build] Fix compilation when NO_CHRONY is not defined
     new 0b858e6  [build] Fix relocate_binaries_for_mini_cluster.py on Python 3

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../mini-cluster/relocate_binaries_for_mini_cluster.py    | 15 +++++++++++++--
 src/kudu/mini-cluster/external_mini_cluster.cc            |  2 +-
 2 files changed, 14 insertions(+), 3 deletions(-)


[kudu] 01/02: [build] Fix compilation when NO_CHRONY is not defined

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 3782dd6d74d558d9d7d9ce37a023ae290a26385c
Author: Grant Henke <gr...@apache.org>
AuthorDate: Wed Mar 11 09:53:55 2020 -0500

    [build] Fix compilation when NO_CHRONY is not defined
    
    I found when building the test binary jar that compilation fails
    when `NO_CHRONY` is not defined because `num_ntp_servers`
    is accessed outside of the `NO_CHRONY` guard but does
    not exist when `!NO_CHRONY`.
    
    This patch fixes compilation by moving it into the guard.
    
    Change-Id: I9b6cc4bda188fb56f6dc4c67653ecdaecb7ad2de
    Reviewed-on: http://gerrit.cloudera.org:8080/15404
    Tested-by: Grant Henke <gr...@apache.org>
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
 src/kudu/mini-cluster/external_mini_cluster.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kudu/mini-cluster/external_mini_cluster.cc b/src/kudu/mini-cluster/external_mini_cluster.cc
index e368a6e..66da128 100644
--- a/src/kudu/mini-cluster/external_mini_cluster.cc
+++ b/src/kudu/mini-cluster/external_mini_cluster.cc
@@ -172,10 +172,10 @@ Status ExternalMiniCluster::AddTimeSourceFlags(
     int idx, std::vector<std::string>* flags) {
   DCHECK_LE(0, idx);
   DCHECK(flags);
-  CHECK_LE(0, opts_.num_ntp_servers);
 #if defined(NO_CHRONY)
   flags->emplace_back("--time_source=system_unsync");
 #else
+  CHECK_LE(0, opts_.num_ntp_servers);
   if (opts_.num_ntp_servers == 0) {
     flags->emplace_back("--time_source=system_unsync");
   } else {


[kudu] 02/02: [build] Fix relocate_binaries_for_mini_cluster.py on Python 3

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 0b858e67f0ab3a41789490d00a6ebcebe342798d
Author: Grant Henke <gr...@apache.org>
AuthorDate: Wed Mar 11 10:11:02 2020 -0500

    [build] Fix relocate_binaries_for_mini_cluster.py on Python 3
    
    This patch fixes relocate_binaries_for_mini_cluster.py on Python 3
    by ignoring decode failures on string like objects.
    This keeps Python 2 compatibility as well.
    
    Change-Id: I792edd867546315baa05b15c711c72f456bb5bd3
    Reviewed-on: http://gerrit.cloudera.org:8080/15405
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
 .../mini-cluster/relocate_binaries_for_mini_cluster.py    | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/build-support/mini-cluster/relocate_binaries_for_mini_cluster.py b/build-support/mini-cluster/relocate_binaries_for_mini_cluster.py
index a443814..21bed54 100755
--- a/build-support/mini-cluster/relocate_binaries_for_mini_cluster.py
+++ b/build-support/mini-cluster/relocate_binaries_for_mini_cluster.py
@@ -158,10 +158,15 @@ def parse_load_commands_macos(cmd_type, dump):
   state = PARSING_NONE
   values = []
   for line in dump:
+    # Ensure the line is a string-like object.
+    try:
+      line = line.decode('utf-8')
+    except (UnicodeDecodeError, AttributeError):
+      pass
     if re.match('^Load command', line):
       state = PARSING_NEW_RECORD
       continue
-    splits = re.split('\s+', line.strip().decode("utf-8"), maxsplit=2)
+    splits = re.split('\s+', line.strip(), maxsplit=2)
     key = splits[0]
     val = splits[1] if len(splits) > 1 else None
     if state == PARSING_NEW_RECORD:
@@ -236,7 +241,13 @@ def get_artifact_name():
     raise NotImplementedError("Unsupported platform")
   arch = os.uname()[4]
   with open(os.path.join(SOURCE_ROOT, "version.txt"), 'r') as version:
-    version = version.readline().strip().decode("utf-8")
+    line = version.readline()
+    # Ensure the line is a string-like object.
+    try:
+      line = line.decode('utf-8')
+    except (UnicodeDecodeError, AttributeError):
+      pass
+    version = line.strip()
   artifact_name = "kudu-binary-%s-%s-%s" % (version, os_str, arch)
   return artifact_name