Skip to content

Commit 584cf9b

Browse files
natebiggsCommit Queue
authored andcommitted
[dartdev] Only require wasm-opt binary when compiling optimized wasm.
Passing tool test run: https://ci.chromium.org/ui/p/dart/builders/try.monorepo/flutter-linux-web-tool-tests-try/155/overview Bug: #61540 Change-Id: I312d71bcb83ba5dd20a50e3934bf962217d1e88a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450580 Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Nate Biggs <[email protected]>
1 parent 898bbb1 commit 584cf9b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/dartdev/lib/src/commands/compile.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,7 @@ class CompileWasmCommand extends CompileSubcommandCommand {
901901

902902
if (!checkArtifactExists(sdk.wasmPlatformDill, warnIfBuildRoot: true) ||
903903
!checkArtifactExists(sdk.dartAotRuntime) ||
904-
!checkArtifactExists(sdk.dart2wasmSnapshot) ||
905-
!checkArtifactExists(sdk.wasmOpt)) {
904+
!checkArtifactExists(sdk.dart2wasmSnapshot)) {
906905
return 255;
907906
}
908907

@@ -957,6 +956,10 @@ class CompileWasmCommand extends CompileSubcommandCommand {
957956
final optimizationLevel = int.parse(args.option('optimization-level')!);
958957
final runWasmOpt = optimizationLevel >= 1;
959958

959+
if (runWasmOpt && !checkArtifactExists(sdk.wasmOpt)) {
960+
return 255;
961+
}
962+
960963
void handleOverride(List<String> flags, String name, bool? value) {
961964
// If no override provided, default to what -O implies.
962965
if (value == null) return;

0 commit comments

Comments
 (0)