Skip to content

Commit 1519553

Browse files
[flutter_tools] print out the unzipping method used by update_dart_sdk.ps1 (#133364)
in case there are future issues with unzipping the dart sdk, such as flutter/flutter#132592, we should log out what tool we are using to try to extract the archive.
1 parent acdcbae commit 1519553

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

bin/internal/update_dart_sdk.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,21 @@ Catch {
8383
$ProgressPreference = $OriginalProgressPreference
8484
}
8585

86-
Write-Host "Expanding downloaded archive..."
8786
If (Get-Command 7z -errorAction SilentlyContinue) {
87+
Write-Host "Expanding downloaded archive with 7z..."
8888
# The built-in unzippers are painfully slow. Use 7-Zip, if available.
8989
& 7z x $dartSdkZip "-o$cachePath" -bd | Out-Null
9090
} ElseIf (Get-Command 7za -errorAction SilentlyContinue) {
91+
Write-Host "Expanding downloaded archive with 7za..."
9192
# Use 7-Zip's standalone version 7za.exe, if available.
9293
& 7za x $dartSdkZip "-o$cachePath" -bd | Out-Null
9394
} ElseIf (Get-Command Microsoft.PowerShell.Archive\Expand-Archive -errorAction SilentlyContinue) {
95+
Write-Host "Expanding downloaded archive with PowerShell..."
9496
# Use PowerShell's built-in unzipper, if available (requires PowerShell 5+).
9597
$global:ProgressPreference='SilentlyContinue'
9698
Microsoft.PowerShell.Archive\Expand-Archive $dartSdkZip -DestinationPath $cachePath
9799
} Else {
100+
Write-Host "Expanding downloaded archive with Windows..."
98101
# As last resort: fall back to the Windows GUI.
99102
$shell = New-Object -com shell.application
100103
$zip = $shell.NameSpace($dartSdkZip)

packages/flutter_tools/test/integration.shard/batch_entrypoint_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ Future<void> main() async {
4949
// See: https://github.com/flutter/flutter/issues/132592
5050
expect(dartSdkStamp.existsSync(), true);
5151
expect(output, contains('Downloading Dart SDK from Flutter engine ...'));
52-
expect(output, contains('Expanding downloaded archive...'));
52+
// Do not assert on the exact unzipping method, as this could change on CI
53+
expect(output, contains(RegExp(r'Expanding downloaded archive with (.*)...')));
5354
expect(output, isNot(contains('Use the -Force parameter' /* Luke */)));
5455
},
5556
skip: !platform.isWindows); // [intended] Only Windows uses the batch entrypoint

0 commit comments

Comments
 (0)