diff --git a/engine/src/flutter/tools/download_dart_sdk.py b/engine/src/flutter/tools/download_dart_sdk.py index e9c0491f1b..e46ca41790 100755 --- a/engine/src/flutter/tools/download_dart_sdk.py +++ b/engine/src/flutter/tools/download_dart_sdk.py @@ -160,6 +160,15 @@ def ExtractDartSDK(archive, os_name, arch, verbose): z.extractall(extract_dest) +def PrintFileIfSmall(file): + if not os.path.isfile(file): + return + size = os.path.getsize(file) + if size < (1 << 14): # < 16KB + with open(file) as f: + contents = f.read() + eprint(contents) + def DownloadAndExtract(channel, version, os_name, arch, verbose): archive = DownloadDartSDK(channel, version, os_name, arch, verbose) @@ -171,6 +180,7 @@ def DownloadAndExtract(channel, version, os_name, arch, verbose): ExtractDartSDK(archive, os_name, arch, verbose) except Exception as e: eprint('Failed to extract Dart SDK archive:\n%s' % e) + PrintFileIfSmall(archive) return 1 try: stamp_file = '{}.stamp'.format(archive) @@ -187,7 +197,7 @@ def Main(): parser.add_argument( '--fail-loudly', action='store_true', - default='LUCI_CONTEXT' in os.environ, + default=False, help="Return an error code if a prebuilt couldn't be fetched and extracted") parser.add_argument( '--verbose', diff --git a/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn index 8d4bfd7176..5f07e7736c 100755 --- a/engine/src/flutter/tools/gn +++ b/engine/src/flutter/tools/gn @@ -334,7 +334,6 @@ def to_gn_args(args): print('--prebuilt-dart-sdk was specified, but an appropriate prebuilt ' 'could not be found! Try running ' 'flutter/tools/download_dart_sdk.py manually.') - sys.exit(1) elif args.target_os is None or args.target_os == 'linux': # dart_platform_sdk is only defined for host builds, linux arm host builds # specify target_os=linux.