Skip to content

Commit 4d455c1

Browse files
DanTupCommit Queue
authored andcommitted
[analysis_server] Use sdk.dart instead of Platform.resolvedExecutable
Sam noted that AOT snapshots might return `dartaotruntime` for `Platform.resolvedExecutable`. It doesn't seem to happen if you invoke server with `dart language_server` because `dart` is still the executable, but if you invoked the snapshot directly with `dartaotruntime` then this would fail. To avoid any possibly issues, this changes it to use the same `sdk.dart` getter that some other code uses that handles this difference by constructed the path to the `dart` executable. Change-Id: I099335a255a792b6754d8d2a1f0bde491c09699e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464681 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 1f906f9 commit 4d455c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/analysis_server/lib/src/services/pub/pub_command.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'dart:convert';
77
import 'dart:io';
88

99
import 'package:analysis_server/src/utilities/process.dart';
10+
import 'package:analysis_server/src/utilities/sdk.dart';
1011
import 'package:analyzer/instrumentation/service.dart';
1112
import 'package:path/path.dart' as path;
1213

@@ -120,7 +121,7 @@ class PubCommand {
120121
try {
121122
_instrumentationService.logInfo('Starting pub command $args');
122123
var process = await _processRunner.start(
123-
Platform.resolvedExecutable,
124+
sdk.dart,
124125
['pub', ...args],
125126
workingDirectory: workingDirectory,
126127
environment: {_pubEnvironmentKey: _pubEnvironmentValue},

0 commit comments

Comments
 (0)