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

tools: use print() function in buildbot_run.py #30148

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
23 changes: 12 additions & 11 deletions tools/gyp/buildbot/buildbot_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# found in the LICENSE file.

"""Argument-less script to select what to run on the buildbots."""
from __future__ import print_function

import os
import shutil
Expand All @@ -24,25 +25,25 @@ def CallSubProcess(*args, **kwargs):
with open(os.devnull) as devnull_fd:
retcode = subprocess.call(stdin=devnull_fd, *args, **kwargs)
if retcode != 0:
print '@@@STEP_EXCEPTION@@@'
print('@@@STEP_EXCEPTION@@@')
sys.exit(1)


def PrepareCmake():
"""Build CMake 2.8.8 since the version in Precise is 2.8.7."""
if os.environ['BUILDBOT_CLOBBER'] == '1':
print '@@@BUILD_STEP Clobber CMake checkout@@@'
print('@@@BUILD_STEP Clobber CMake checkout@@@')
shutil.rmtree(CMAKE_DIR)

# We always build CMake 2.8.8, so no need to do anything
# if the directory already exists.
if os.path.isdir(CMAKE_DIR):
return

print '@@@BUILD_STEP Initialize CMake checkout@@@'
print('@@@BUILD_STEP Initialize CMake checkout@@@')
os.mkdir(CMAKE_DIR)

print '@@@BUILD_STEP Sync CMake@@@'
print('@@@BUILD_STEP Sync CMake@@@')
CallSubProcess(
['git', 'clone',
'--depth', '1',
Expand All @@ -53,7 +54,7 @@ def PrepareCmake():
CMAKE_DIR],
cwd=CMAKE_DIR)

print '@@@BUILD_STEP Build CMake@@@'
print('@@@BUILD_STEP Build CMake@@@')
CallSubProcess(
['/bin/bash', 'bootstrap', '--prefix=%s' % CMAKE_DIR],
cwd=CMAKE_DIR)
Expand All @@ -74,7 +75,7 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
if not format:
format = title

print '@@@BUILD_STEP ' + title + '@@@'
print('@@@BUILD_STEP ' + title + '@@@')
sys.stdout.flush()
env = os.environ.copy()
if msvs_version:
Expand All @@ -89,17 +90,17 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
if retcode:
# Emit failure tag, and keep going.
print '@@@STEP_FAILURE@@@'
print('@@@STEP_FAILURE@@@')
return 1
return 0


def GypBuild():
# Dump out/ directory.
print '@@@BUILD_STEP cleanup@@@'
print 'Removing %s...' % OUT_DIR
print('@@@BUILD_STEP cleanup@@@')
print('Removing %s...' % OUT_DIR)
shutil.rmtree(OUT_DIR, ignore_errors=True)
print 'Done.'
print('Done.')

retcode = 0
if sys.platform.startswith('linux'):
Expand Down Expand Up @@ -128,7 +129,7 @@ def GypBuild():
# after the build proper that could be used for cumulative failures),
# use that instead of this. This isolates the final return value so
# that it isn't misattributed to the last stage.
print '@@@BUILD_STEP failures@@@'
print('@@@BUILD_STEP failures@@@')
sys.exit(retcode)


Expand Down