From 1a486499bf73ee5b007abbe522b94869a1f36d02 Mon Sep 17 00:00:00 2001 From: asiva Date: Tue, 21 Jan 2025 14:18:08 -0800 Subject: [PATCH] [dartdev] Fix ia32 invocation of dart2js from 'compile js' command. TEST=ci Change-Id: I5b7a180cdadeb9a78038af8dc0631fad7b757a5e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405260 Commit-Queue: Siva Annamalai Reviewed-by: Ben Konyi --- pkg/dartdev/lib/src/commands/compile.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/dartdev/lib/src/commands/compile.dart b/pkg/dartdev/lib/src/commands/compile.dart index 1deb16e7d90c..292dc377db7c 100644 --- a/pkg/dartdev/lib/src/commands/compile.dart +++ b/pkg/dartdev/lib/src/commands/compile.dart @@ -93,20 +93,19 @@ class CompileJSCommand extends CompileSubcommandCommand { } final args = argResults!; var snapshot = sdk.dart2jsAotSnapshot; - var runtime = sdk.dartAotRuntime; + var script = sdk.dartAotRuntime; var useExecProcess = true; if (!Sdk.checkArtifactExists(snapshot, logError: false)) { // AOT snapshots cannot be generated on IA32, so we need this fallback // branch until support for IA32 is dropped (https://dartbug.com/49969). - snapshot = sdk.dart2jsSnapshot; - if (!Sdk.checkArtifactExists(snapshot)) { + script = sdk.dart2jsSnapshot; + if (!Sdk.checkArtifactExists(script)) { return genericErrorExitCode; } - runtime = sdk.dart; useExecProcess = false; } final dart2jsCommand = [ - snapshot, + if (useExecProcess) snapshot, '--libraries-spec=${sdk.librariesJson}', '--cfe-invocation-modes=compile', '--invoker=dart_cli', @@ -115,7 +114,7 @@ class CompileJSCommand extends CompileSubcommandCommand { ]; try { VmInteropHandler.run( - runtime, + script, dart2jsCommand, packageConfigOverride: null, useExecProcess: useExecProcess,