зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1635664 - Don't capture the output from sdkmanager in ensure_android_packages. r=rstewart
We always print the output when there is no error. In case of error, we stick the output in the thrown exception, but nothing actually prints that out. It's simpler to just let the subprocess print its own output instead of capturing it, so that important error messages are not hidden in the case of failure. Differential Revision: https://phabricator.services.mozilla.com/D74004
This commit is contained in:
Родитель
5e05e2ded9
Коммит
ece7e458a5
|
@ -278,24 +278,21 @@ def ensure_android_packages(sdkmanager_tool, packages=None, no_interactive=False
|
|||
subprocess.check_call(args)
|
||||
return
|
||||
|
||||
# Flush outputs before running sdkmanager.
|
||||
sys.stdout.flush()
|
||||
sys.stderr.flush()
|
||||
# Emulate yes. For a discussion of passing input to check_output,
|
||||
# see https://stackoverflow.com/q/10103551.
|
||||
yes = '\n'.join(['y']*100).encode("UTF-8")
|
||||
proc = subprocess.Popen(args,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
stdin=subprocess.PIPE)
|
||||
output, unused_err = proc.communicate(yes)
|
||||
proc = subprocess.Popen(args, stdin=subprocess.PIPE)
|
||||
proc.communicate(yes)
|
||||
|
||||
retcode = proc.poll()
|
||||
if retcode:
|
||||
cmd = args[0]
|
||||
e = subprocess.CalledProcessError(retcode, cmd)
|
||||
e.output = output
|
||||
raise e
|
||||
|
||||
print(output)
|
||||
|
||||
|
||||
def suggest_mozconfig(os_name, artifact_mode=False):
|
||||
moz_state_dir, sdk_path, ndk_path = get_paths(os_name)
|
||||
|
|
Загрузка…
Ссылка в новой задаче