From commits-return-5339-archive-asf-public=cust-asf.ponee.io@kudu.apache.org Mon Mar 5 07:38:11 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 51C31180676 for ; Mon, 5 Mar 2018 07:38:11 +0100 (CET) Received: (qmail 46297 invoked by uid 500); 5 Mar 2018 06:38:10 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 46284 invoked by uid 99); 5 Mar 2018 06:38:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2018 06:38:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4B961DFA0D; Mon, 5 Mar 2018 06:38:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: todd@apache.org To: commits@kudu.apache.org Date: Mon, 05 Mar 2018 06:38:12 -0000 Message-Id: <63da3084597a46bc84e5f97e492b55c8@git.apache.org> In-Reply-To: <1cad9900a016492c8240149ebc33a4fe@git.apache.org> References: <1cad9900a016492c8240149ebc33a4fe@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/3] kudu git commit: dist_test: add a cache for ldd results dist_test: add a cache for ldd results With ctest-based sharding we ended up running 'ldd' many times on the same executable, which isn't necessary. This adds a simple cache for the results of ldd. Change-Id: I350ce78d61d9f4428424350ea6b41d4e61e3a4ae Reviewed-on: http://gerrit.cloudera.org:8080/9483 Reviewed-by: Adar Dembo Tested-by: Kudu Jenkins Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/9b6034b4 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/9b6034b4 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/9b6034b4 Branch: refs/heads/master Commit: 9b6034b4ecc4d08870edaad366ab24a0f3fd2728 Parents: 2b2b2dd Author: Todd Lipcon Authored: Fri Mar 2 17:35:32 2018 -0800 Committer: Todd Lipcon Committed: Mon Mar 5 06:35:30 2018 +0000 ---------------------------------------------------------------------- build-support/dist_test.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/9b6034b4/build-support/dist_test.py ---------------------------------------------------------------------- diff --git a/build-support/dist_test.py b/build-support/dist_test.py index 34ebc86..0e9ab66 100755 --- a/build-support/dist_test.py +++ b/build-support/dist_test.py @@ -236,7 +236,7 @@ def copy_system_library(lib): shutil.copy2(rel_to_abs(lib), dst) return dst - +LDD_CACHE={} def ldd_deps(exe): """ Runs 'ldd' on the provided 'exe' path, returning a list of @@ -253,9 +253,12 @@ def ldd_deps(exe): exe.endswith(".txt") or os.path.isdir(exe)): return [] - p = subprocess.Popen(["ldd", exe], stdout=subprocess.PIPE) - out, err = p.communicate() - if p.returncode != 0: + if exe not in LDD_CACHE: + p = subprocess.Popen(["ldd", exe], stdout=subprocess.PIPE) + out, err = p.communicate() + LDD_CACHE[exe] = (out, err, p.returncode) + out, err, rc = LDD_CACHE[exe] + if rc != 0: print >>sys.stderr, "failed to run ldd on ", exe return [] ret = []