OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 the V8 project authors. All rights reserved. | 2 # Copyright 2016 the V8 project authors. All rights reserved. |
3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """MB - the Meta-Build wrapper around GYP and GN | 7 """MB - the Meta-Build wrapper around GYP and GN |
8 | 8 |
9 MB is a wrapper script for GYP and GN that can be used to generate build files | 9 MB is a wrapper script for GYP and GN that can be used to generate build files |
10 for sets of canned configurations and analyze them. | 10 for sets of canned configurations and analyze them. |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
770 gn_labels.append(gn_isolate_map[target_name]['label']) | 770 gn_labels.append(gn_isolate_map[target_name]['label']) |
771 | 771 |
772 if err: | 772 if err: |
773 raise MBErr('Error: Failed to match swarming targets to %s:\n%s' % | 773 raise MBErr('Error: Failed to match swarming targets to %s:\n%s' % |
774 ('//testing/buildbot/gn_isolate_map.pyl', err)) | 774 ('//testing/buildbot/gn_isolate_map.pyl', err)) |
775 | 775 |
776 gn_runtime_deps_path = self.ToAbsPath(build_dir, 'runtime_deps') | 776 gn_runtime_deps_path = self.ToAbsPath(build_dir, 'runtime_deps') |
777 self.WriteFile(gn_runtime_deps_path, '\n'.join(gn_labels) + '\n') | 777 self.WriteFile(gn_runtime_deps_path, '\n'.join(gn_labels) + '\n') |
778 cmd.append('--runtime-deps-list-file=%s' % gn_runtime_deps_path) | 778 cmd.append('--runtime-deps-list-file=%s' % gn_runtime_deps_path) |
779 | 779 |
780 ret, _, _ = self.Run(cmd) | 780 # Override msvs infra environment variables. |
781 # TODO(machenbach): Remove after GYP_MSVS_VERSION is removed on infra side. | |
Michael Achenbach
2016/11/30 19:23:19
As soon as this sticks, I'll remove the GYP_MSVS_V
| |
782 env = {} | |
783 env.update(os.environ) | |
784 env['GYP_MSVS_VERSION'] = '2015' | |
785 | |
786 ret, _, _ = self.Run(cmd, env=env) | |
781 if ret: | 787 if ret: |
782 # If `gn gen` failed, we should exit early rather than trying to | 788 # If `gn gen` failed, we should exit early rather than trying to |
783 # generate isolates. Run() will have already logged any error output. | 789 # generate isolates. Run() will have already logged any error output. |
784 self.Print('GN gen failed: %d' % ret) | 790 self.Print('GN gen failed: %d' % ret) |
785 return ret | 791 return ret |
786 | 792 |
787 android = 'target_os="android"' in vals['gn_args'] | 793 android = 'target_os="android"' in vals['gn_args'] |
788 for target in swarming_targets: | 794 for target in swarming_targets: |
789 if android: | 795 if android: |
790 # Android targets may be either android_apk or executable. The former | 796 # Android targets may be either android_apk or executable. The former |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1491 # Then check to see if the arg contains any metacharacters other than | 1497 # Then check to see if the arg contains any metacharacters other than |
1492 # double quotes; if it does, quote everything (including the double | 1498 # double quotes; if it does, quote everything (including the double |
1493 # quotes) for safety. | 1499 # quotes) for safety. |
1494 if any(a in UNSAFE_FOR_CMD for a in arg): | 1500 if any(a in UNSAFE_FOR_CMD for a in arg): |
1495 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) | 1501 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) |
1496 return arg | 1502 return arg |
1497 | 1503 |
1498 | 1504 |
1499 if __name__ == '__main__': | 1505 if __name__ == '__main__': |
1500 sys.exit(main(sys.argv[1:])) | 1506 sys.exit(main(sys.argv[1:])) |
OLD | NEW |