Skip to content

Commit 6fdf399

Browse files
committed
Fix snapshot paths.
1 parent 35bfa78 commit 6fdf399

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

dwds/lib/src/utilities/sdk_configuration.dart

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class SdkLayout {
4545

4646
final String sdkDirectory;
4747
final String summaryPath;
48+
final String dartdevcJitSnapshotPath;
4849
final String dartdevcSnapshotPath;
4950

5051
@Deprecated('Only sound null safety is supported as of Dart 3.0')
@@ -62,19 +63,26 @@ class SdkLayout {
6263
'_internal',
6364
'ddc_outline.dill',
6465
),
65-
dartdevcSnapshotPath: p.join(
66+
dartdevcJitSnapshotPath: p.join(
6667
sdkDirectory,
6768
'bin',
6869
'snapshots',
6970
'dartdevc.dart.snapshot',
7071
),
72+
dartdevcSnapshotPath: p.join(
73+
sdkDirectory,
74+
'bin',
75+
'snapshots',
76+
'dartdevc.aot.dart.snapshot',
77+
),
7178
);
7279

7380
const SdkLayout({
7481
required this.sdkDirectory,
7582
required this.summaryPath,
7683
this.soundSummaryPath = '',
7784
this.weakSummaryPath = '',
85+
required this.dartdevcJitSnapshotPath,
7886
required this.dartdevcSnapshotPath,
7987
});
8088
}
@@ -113,7 +121,10 @@ class SdkConfiguration {
113121
: this(
114122
sdkDirectory: sdkLayout.sdkDirectory,
115123
sdkSummaryPath: sdkLayout.summaryPath,
116-
compilerWorkerPath: sdkLayout.dartdevcSnapshotPath,
124+
// This compiler path is used to spawn the expression compiler
125+
// in a new isolate and hence it needs to be a JIT snapshot
126+
// until dwds itself can run in AOT mode.
127+
compilerWorkerPath: sdkLayout.dartdevcJitSnapshotPath,
117128
);
118129

119130
static Uri? _toUri(String? path) => path == null ? null : p.toUri(path);

dwds/test/sdk_configuration_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void main() {
100100
final sdkLayout = SdkLayout.createDefault(sdkDirectory);
101101
final sdkConfiguration = SdkConfiguration.fromSdkLayout(sdkLayout);
102102
final sdkSummaryPath = sdkLayout.summaryPath;
103-
final compilerWorkerPath = sdkLayout.dartdevcSnapshotPath;
103+
final compilerWorkerPath = sdkLayout.dartdevcJitSnapshotPath;
104104

105105
setUp(() async {
106106
fs = MemoryFileSystem();

test_common/lib/test_sdk_layout.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ class TestSdkLayout {
103103
'snapshots',
104104
'frontend_server_aot.dart.snapshot',
105105
),
106+
dartdevcSnapshotPath: sdkLayout.dartdevcJitSnapshotPath,
106107
dartdevcSnapshotPath: sdkLayout.dartdevcSnapshotPath,
107108
kernelWorkerSnapshotPath: p.join(
108109
sdkLayout.sdkDirectory,
@@ -141,6 +142,7 @@ class TestSdkLayout {
141142
final String dartPath;
142143
final String dartAotRuntimePath;
143144
final String frontendServerSnapshotPath;
145+
final String dartdevcJitSnapshotPath;
144146
final String dartdevcSnapshotPath;
145147
final String kernelWorkerSnapshotPath;
146148
final String devToolsDirectory;
@@ -159,6 +161,7 @@ class TestSdkLayout {
159161
required this.dartPath,
160162
required this.dartAotRuntimePath,
161163
required this.frontendServerSnapshotPath,
164+
required this.dartdevcJitSnapshotPath,
162165
required this.dartdevcSnapshotPath,
163166
required this.kernelWorkerSnapshotPath,
164167
required this.devToolsDirectory,
@@ -169,7 +172,7 @@ class TestSdkLayout {
169172
SdkConfiguration(
170173
sdkDirectory: sdkLayout.sdkDirectory,
171174
sdkSummaryPath: sdkLayout.summaryPath,
172-
compilerWorkerPath: sdkLayout.dartdevcSnapshotPath,
175+
compilerWorkerPath: sdkLayout.dartdevcJitSnapshotPath,
173176
);
174177
}
175178

test_common/test/sdk_asset_generator_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void main() {
3838
final copySdkLayout = TestSdkLayout.createDefault(sdkDirectory);
3939

4040
sdkSummaryPath = copySdkLayout.summaryPath;
41-
compilerWorkerPath = copySdkLayout.dartdevcSnapshotPath;
41+
compilerWorkerPath = copySdkLayout.dartdevcJitSnapshotPath;
4242

4343
// Copy the SDK directory into a temp directory.
4444
await copyDirectory(TestSdkLayout.defaultSdkDirectory, sdkDirectory);

0 commit comments

Comments
 (0)