OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import optparse | 6 import optparse |
7 import os | 7 import os |
8 import re | 8 import re |
9 import shutil | 9 import shutil |
10 import subprocess | 10 import subprocess |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 # Invoke scons to get dependency tree. | 53 # Invoke scons to get dependency tree. |
54 cmd = [ | 54 cmd = [ |
55 sys.executable, 'scons.py', '-n', '--tree=all', | 55 sys.executable, 'scons.py', '-n', '--tree=all', |
56 '--mode=nacl', 'platform=' + platform, | 56 '--mode=nacl', 'platform=' + platform, |
57 'scons-out/nacl_irt-' + platform + '/staging/irt.nexe', | 57 'scons-out/nacl_irt-' + platform + '/staging/irt.nexe', |
58 ] | 58 ] |
59 p = subprocess.Popen(cmd, cwd=NACL_DIR, | 59 p = subprocess.Popen(cmd, cwd=NACL_DIR, |
60 stdout=subprocess.PIPE, | 60 stdout=subprocess.PIPE, |
61 stderr=subprocess.PIPE) | 61 stderr=subprocess.PIPE) |
62 (p_stdout, p_stderr) = p.communicate() | 62 (p_stdout, p_stderr) = p.communicate() |
63 # If things fail on windows, try running --help, if that fails, | |
noelallen_use_chromium
2011/08/24 00:21:38
How about returning a specific error code from sco
| |
64 # emit this script as an input (to satiate gyp), and assume we're being | |
65 # run on a test only bot. | |
66 if p.returncode != 0 and sys.platform == 'win32': | |
67 cmd = [sys.executable, 'scons.py', '--help'] | |
68 p = subprocess.Popen(cmd, cwd=NACL_DIR, | |
69 stdout=subprocess.PIPE, | |
70 stderr=subprocess.PIPE) | |
71 (p_stdout, p_stderr) = p.communicate() | |
72 if p.returncode !=0: | |
73 # If scons can't even run, emit just this script as an input. | |
74 # See comment above this one. | |
75 print RelativePath(__file__, SCRIPT_DIR) | |
76 return | |
63 if p.returncode != 0: | 77 if p.returncode != 0: |
64 sys.exit(2) | 78 sys.exit(2) |
65 # Extract unique inputs. | 79 # Extract unique inputs. |
66 for line in p_stdout.splitlines(): | 80 for line in p_stdout.splitlines(): |
67 m = re.match('^[ -+|]*\+\-(.+)', line) | 81 m = re.match('^[ -+|]*\+\-(.+)', line) |
68 if not m: | 82 if not m: |
69 continue | 83 continue |
70 filename = m.group(1) | 84 filename = m.group(1) |
71 if '[' in filename: | 85 if '[' in filename: |
72 continue | 86 continue |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 sys.exit(1) | 191 sys.exit(1) |
178 | 192 |
179 if options.inputs: | 193 if options.inputs: |
180 PrintInputs(options.platforms) | 194 PrintInputs(options.platforms) |
181 else: | 195 else: |
182 BuildIRT(options.platforms, options.outdir) | 196 BuildIRT(options.platforms, options.outdir) |
183 | 197 |
184 | 198 |
185 if __name__ == '__main__': | 199 if __name__ == '__main__': |
186 Main(sys.argv) | 200 Main(sys.argv) |
OLD | NEW |