summaryrefslogtreecommitdiff
path: root/tools/gyp
diff options
context:
space:
mode:
authorUjjwal Sharma <usharma1998@gmail.com>2018-07-27 15:03:19 +0530
committerUjjwal Sharma <usharma1998@gmail.com>2018-08-25 04:41:56 +0530
commit16cffb0d4890bf4b4ff8ad0bbd7731105fabe845 (patch)
tree21d0190909db812ba4dddf6af181b8bc5c2ef06a /tools/gyp
parent376cc4d0b7543d34c922d4c982d4214055abff22 (diff)
downloadandroid-node-v8-16cffb0d4890bf4b4ff8ad0bbd7731105fabe845.tar.gz
android-node-v8-16cffb0d4890bf4b4ff8ad0bbd7731105fabe845.tar.bz2
android-node-v8-16cffb0d4890bf4b4ff8ad0bbd7731105fabe845.zip
gyp: muffle xcodebuild warnings
Muffle xcodebuild warnings by introducing an alternative quieter alternative to GetStdout, called GetStdoutQuiet, and call it selectively in particularly noisy xcodebuild commands. Co-authored-by: Gibson Fahnestock <gibfahn@gmail.com> PR-URL: https://github.com/nodejs/node/pull/21999 Original-PR-URL: https://github.com/nodejs/node-gyp/pull/1370 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'tools/gyp')
-rw-r--r--tools/gyp/pylib/gyp/xcode_emulation.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
index c303313a30..9481423228 100644
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py
@@ -495,7 +495,7 @@ class XcodeSettings(object):
# Since the CLT has no SDK paths anyway, returning None is the
# most sensible route and should still do the right thing.
try:
- return GetStdout(['xcrun', '--sdk', sdk, infoitem])
+ return GetStdoutQuiet(['xcrun', '--sdk', sdk, infoitem])
except:
pass
@@ -1394,7 +1394,7 @@ def XcodeVersion():
if XCODE_VERSION_CACHE:
return XCODE_VERSION_CACHE
try:
- version_list = GetStdout(['xcodebuild', '-version']).splitlines()
+ version_list = GetStdoutQuiet(['xcodebuild', '-version']).splitlines()
# In some circumstances xcodebuild exits 0 but doesn't return
# the right results; for example, a user on 10.7 or 10.8 with
# a bogus path set via xcode-select
@@ -1444,6 +1444,18 @@ def CLTVersion():
continue
+def GetStdoutQuiet(cmdlist):
+ """Returns the content of standard output returned by invoking |cmdlist|.
+ Ignores the stderr.
+ Raises |GypError| if the command return with a non-zero return code."""
+ job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ out = job.communicate()[0]
+ if job.returncode != 0:
+ raise GypError('Error %d running %s' % (job.returncode, cmdlist[0]))
+ return out.rstrip('\n')
+
+
def GetStdout(cmdlist):
"""Returns the content of standard output returned by invoking |cmdlist|.
Raises |GypError| if the command return with a non-zero return code."""