Skip to content

Commit cca544b

Browse files
DanTupCommit Queue
authored andcommitted
[analysis_server] Fix compilation of server when using custom SDK
When running analysis server tests from source, we now (since a recent change) pre-compile the server to avoid compilation on every test. If the first test run was `test\integration\analysis\get_errors_non_standard_sdk_test.dart` we would try to compile with the non-standard (and incomplete) SDK created by the test, and fail because of #52752. This changes to always use the real SDK that we're running with for the compilation instead. Change-Id: I1028c24ecb18f9caa465b579866d07a72c1dc02b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433822 Reviewed-by: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent 40bf581 commit cca544b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/analysis_server/test/support/sdk_paths.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ String get sdkRootPath {
4545
/// When running from source, the server will be compiled to disk for the first
4646
/// request to speed up subsequent tests in the same process.
4747
Future<String> getAnalysisServerPath(String dartSdkPath) async {
48-
var dartBinary = path.join(dartSdkPath, 'bin', 'dart');
48+
// Always use the "real" SDK binary for compilation, not the path provided,
49+
// which might be an incomplete SDK that is the target of the test.
50+
var dartBinary = Platform.resolvedExecutable;
4951
var snapshotPath = path.join(
5052
dartSdkPath,
5153
'bin',

0 commit comments

Comments
 (0)