mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Extract the prebuilt Dart SDK to a temp directory and then move it after the extraction completes (flutter/engine#27569)
* Extract the prebuilt Dart SDK to a temp directory and then move it after the extraction completes This ensures that the GN script will not see an invalid Dart SDK at the expected path if the extract fails. * Add os_arch to temp extraction path Co-authored-by: Zachary Anderson <zanderso@users.noreply.github.com>
This commit is contained in:
parent
108f9b0a26
commit
ab998239a4
@ -150,7 +150,9 @@ def ExtractDartSDK(archive, os_name, arch, verbose):
|
||||
if os.path.isdir(dart_sdk):
|
||||
shutil.rmtree(dart_sdk)
|
||||
|
||||
extract_dest = os.path.join(FLUTTER_PREBUILTS_DIR, os_arch)
|
||||
extract_dest = os.path.join(FLUTTER_PREBUILTS_DIR, os_arch, 'temp')
|
||||
if os.path.isdir(extract_dest):
|
||||
shutil.rmtree(extract_dest)
|
||||
os.makedirs(extract_dest, exist_ok=True)
|
||||
|
||||
if verbose:
|
||||
@ -159,6 +161,8 @@ def ExtractDartSDK(archive, os_name, arch, verbose):
|
||||
with ZipFileWithPermissions(archive, "r") as z:
|
||||
z.extractall(extract_dest)
|
||||
|
||||
shutil.move(os.path.join(extract_dest, 'dart-sdk'), dart_sdk)
|
||||
|
||||
|
||||
def PrintFileIfSmall(file):
|
||||
if not os.path.isfile(file):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user