Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gyp: muffle xcodebuild warnings #21999

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions tools/gyp/pylib/gyp/xcode_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def _GetSdkVersionInfoItem(self, sdk, infoitem):
# 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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1444,6 +1444,18 @@ def CLTVersion():
continue


def GetStdoutQuiet(cmdlist):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the method duplication.
This should be an overload.

"""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."""
Expand Down