OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 import re | 7 import re |
8 import sys | 8 import sys |
9 | 9 |
10 import bot | 10 import bot |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 def tarball_name(arch, mode, revision): | 27 def tarball_name(arch, mode, revision): |
28 return 'cross_build_%s_%s_%s.tar.bz2' % (arch, mode, revision) | 28 return 'cross_build_%s_%s_%s.tar.bz2' % (arch, mode, revision) |
29 | 29 |
30 def record_names(name, arch, mode): | 30 def record_names(name, arch, mode): |
31 return ('record_%s_%s_%s.json' % (name, arch, mode), | 31 return ('record_%s_%s_%s.json' % (name, arch, mode), |
32 'record_output_%s_%s_%s.json' % (name, arch, mode)) | 32 'record_output_%s_%s_%s.json' % (name, arch, mode)) |
33 | 33 |
34 def cross_compiling_builder(arch, mode): | 34 def cross_compiling_builder(arch, mode): |
35 build_py = os.path.join('tools', 'build.py') | 35 build_py = os.path.join('tools', 'build.py') |
36 revision = int(os.environ['BUILDBOT_GOT_REVISION']) | 36 revision = os.environ['BUILDBOT_GOT_REVISION'] |
37 tarball = tarball_name(arch, mode, revision) | 37 tarball = tarball_name(arch, mode, revision) |
38 temporary_files = [tarball] | 38 temporary_files = [tarball] |
39 bot.Clobber() | 39 bot.Clobber() |
40 try: | 40 try: |
41 num_run = int(os.environ['BUILDBOT_ANNOTATED_STEPS_RUN']) | 41 num_run = int(os.environ['BUILDBOT_ANNOTATED_STEPS_RUN']) |
42 if num_run == 1: | 42 if num_run == 1: |
43 with bot.BuildStep('Build %s %s' % (arch, mode)): | 43 with bot.BuildStep('Build %s %s' % (arch, mode)): |
44 run([sys.executable, build_py, | 44 run([sys.executable, build_py, |
45 '-m%s' % mode, '--arch=%s' % arch]) | 45 '-m%s' % mode, '--arch=%s' % arch]) |
46 | 46 |
(...skipping 18 matching lines...) Expand all Loading... |
65 if os.path.exists(path): | 65 if os.path.exists(path): |
66 os.remove(path) | 66 os.remove(path) |
67 | 67 |
68 def target_builder(arch, mode): | 68 def target_builder(arch, mode): |
69 test_py = os.path.join('tools', 'test.py') | 69 test_py = os.path.join('tools', 'test.py') |
70 test_args = [sys.executable, test_py, '--progress=line', '--report', | 70 test_args = [sys.executable, test_py, '--progress=line', '--report', |
71 '--time', '--compiler=none', '--runtime=vm', '--write-debug-log', | 71 '--time', '--compiler=none', '--runtime=vm', '--write-debug-log', |
72 '--write-test-outcome-log', '--mode=' + mode, '--arch=' + arch, | 72 '--write-test-outcome-log', '--mode=' + mode, '--arch=' + arch, |
73 '--exclude-suite=pkg'] | 73 '--exclude-suite=pkg'] |
74 | 74 |
75 revision = int(os.environ['BUILDBOT_GOT_REVISION']) | 75 revision = os.environ['BUILDBOT_GOT_REVISION'] |
76 tarball = tarball_name(arch, mode, revision) | 76 tarball = tarball_name(arch, mode, revision) |
77 temporary_files = [tarball] | 77 temporary_files = [tarball] |
78 bot.Clobber() | 78 bot.Clobber() |
79 try: | 79 try: |
80 with bot.BuildStep('Fetch build tarball'): | 80 with bot.BuildStep('Fetch build tarball'): |
81 run([GSUTIL, 'cp', "%s/%s" % (GCS_BUCKET, tarball), tarball]) | 81 run([GSUTIL, 'cp', "%s/%s" % (GCS_BUCKET, tarball), tarball]) |
82 | 82 |
83 with bot.BuildStep('Unpack build tarball'): | 83 with bot.BuildStep('Unpack build tarball'): |
84 run(['tar', '-xjf', tarball]) | 84 run(['tar', '-xjf', tarball]) |
85 | 85 |
(...skipping 23 matching lines...) Expand all Loading... |
109 mode = target_vm_pattern_match.group(2) | 109 mode = target_vm_pattern_match.group(2) |
110 target_builder(arch, mode) | 110 target_builder(arch, mode) |
111 else: | 111 else: |
112 raise Exception("Unknown builder name %s" % name) | 112 raise Exception("Unknown builder name %s" % name) |
113 | 113 |
114 if __name__ == '__main__': | 114 if __name__ == '__main__': |
115 try: | 115 try: |
116 sys.exit(main()) | 116 sys.exit(main()) |
117 except OSError as e: | 117 except OSError as e: |
118 sys.exit(e.errno) | 118 sys.exit(e.errno) |
OLD | NEW |