Fix Debian builder.

Do not rely on checked in Dart SDK for patch_sdk.py.

Use dart_boostrap instead just like observatory does.

R=kustermann@google.com, whesse@google.com
BUG=

Review URL: https://codereview.chromium.org/2464833002 .
This commit is contained in:
Vyacheslav Egorov 2016-10-31 14:13:33 +01:00
parent e8fbfc4f0d
commit 2cd737abab
2 changed files with 19 additions and 2 deletions

View file

@ -1243,6 +1243,7 @@
'type': 'none',
'toolsets': ['host'],
'dependencies': [
'dart_bootstrap#host',
'generate_async_library_patch',
'generate_collection_library_patch',
'generate_convert_library_patch',
@ -1294,6 +1295,8 @@
'action': [
'python',
'../tools/patch_sdk.py',
'--dart-executable',
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
'vm',
'../sdk',
'<(gen_source_dir)/patches',

View file

@ -3,15 +3,29 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import argparse
import os
import subprocess
import sys
import utils
usage = """patch_sdk.py [options]"""
def BuildArguments():
result = argparse.ArgumentParser(usage=usage)
result.add_argument("--dart-executable", help="dart executable", default=None)
return result
def main():
dart = os.path.join(utils.CheckedInSdkPath(), 'bin', 'dart')
# Parse the options.
parser = BuildArguments()
(options, args) = parser.parse_known_args()
if options.dart_executable is not None:
options.dart_executable = os.path.abspath(options.dart_executable)
else:
options.dart_executable = os.path.join(utils.CheckedInSdkPath(), 'bin', 'dart')
dart_file = os.path.join(os.path.dirname(__file__), 'patch_sdk.dart')
subprocess.check_call([dart, dart_file] + sys.argv[1:]);
subprocess.check_call([options.dart_executable, dart_file] + args);
if __name__ == '__main__':
main()