4
4
# found in the LICENSE file.
5
5
6
6
"""Argument-less script to select what to run on the buildbots."""
7
+ from __future__ import print_function
7
8
8
9
import os
9
10
import shutil
@@ -24,25 +25,25 @@ def CallSubProcess(*args, **kwargs):
24
25
with open (os .devnull ) as devnull_fd :
25
26
retcode = subprocess .call (stdin = devnull_fd , * args , ** kwargs )
26
27
if retcode != 0 :
27
- print '@@@STEP_EXCEPTION@@@'
28
+ print ( '@@@STEP_EXCEPTION@@@' )
28
29
sys .exit (1 )
29
30
30
31
31
32
def PrepareCmake ():
32
33
"""Build CMake 2.8.8 since the version in Precise is 2.8.7."""
33
34
if os .environ ['BUILDBOT_CLOBBER' ] == '1' :
34
- print '@@@BUILD_STEP Clobber CMake checkout@@@'
35
+ print ( '@@@BUILD_STEP Clobber CMake checkout@@@' )
35
36
shutil .rmtree (CMAKE_DIR )
36
37
37
38
# We always build CMake 2.8.8, so no need to do anything
38
39
# if the directory already exists.
39
40
if os .path .isdir (CMAKE_DIR ):
40
41
return
41
42
42
- print '@@@BUILD_STEP Initialize CMake checkout@@@'
43
+ print ( '@@@BUILD_STEP Initialize CMake checkout@@@' )
43
44
os .mkdir (CMAKE_DIR )
44
45
45
- print '@@@BUILD_STEP Sync CMake@@@'
46
+ print ( '@@@BUILD_STEP Sync CMake@@@' )
46
47
CallSubProcess (
47
48
['git' , 'clone' ,
48
49
'--depth' , '1' ,
@@ -53,7 +54,7 @@ def PrepareCmake():
53
54
CMAKE_DIR ],
54
55
cwd = CMAKE_DIR )
55
56
56
- print '@@@BUILD_STEP Build CMake@@@'
57
+ print ( '@@@BUILD_STEP Build CMake@@@' )
57
58
CallSubProcess (
58
59
['/bin/bash' , 'bootstrap' , '--prefix=%s' % CMAKE_DIR ],
59
60
cwd = CMAKE_DIR )
@@ -74,7 +75,7 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
74
75
if not format :
75
76
format = title
76
77
77
- print '@@@BUILD_STEP ' + title + '@@@'
78
+ print ( '@@@BUILD_STEP ' + title + '@@@' )
78
79
sys .stdout .flush ()
79
80
env = os .environ .copy ()
80
81
if msvs_version :
@@ -89,17 +90,17 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
89
90
retcode = subprocess .call (command , cwd = ROOT_DIR , env = env , shell = True )
90
91
if retcode :
91
92
# Emit failure tag, and keep going.
92
- print '@@@STEP_FAILURE@@@'
93
+ print ( '@@@STEP_FAILURE@@@' )
93
94
return 1
94
95
return 0
95
96
96
97
97
98
def GypBuild ():
98
99
# Dump out/ directory.
99
- print '@@@BUILD_STEP cleanup@@@'
100
- print 'Removing %s...' % OUT_DIR
100
+ print ( '@@@BUILD_STEP cleanup@@@' )
101
+ print ( 'Removing %s...' % OUT_DIR )
101
102
shutil .rmtree (OUT_DIR , ignore_errors = True )
102
- print 'Done.'
103
+ print ( 'Done.' )
103
104
104
105
retcode = 0
105
106
if sys .platform .startswith ('linux' ):
@@ -128,7 +129,7 @@ def GypBuild():
128
129
# after the build proper that could be used for cumulative failures),
129
130
# use that instead of this. This isolates the final return value so
130
131
# that it isn't misattributed to the last stage.
131
- print '@@@BUILD_STEP failures@@@'
132
+ print ( '@@@BUILD_STEP failures@@@' )
132
133
sys .exit (retcode )
133
134
134
135
0 commit comments