Skip to content

Commit 1181ddc

Browse files
committed
chore(cli): vm_platform_strong renamed to vm_platform
The latest Dart SDKs have renamed `vm_platform_strong` to `vm_platform`.
1 parent 538d379 commit 1181ddc

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

apps/cli/lib/src/sdk/dart_sdk.dart

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,35 @@ class Sdk {
216216
'platform_strong.dill',
217217
);
218218

219-
String get vmPlatformDill =>
220-
p.absolute(sdkPath, 'lib', '_internal', 'vm_platform_strong.dill');
219+
String get vmPlatformDill {
220+
final dillPath = p.absolute(
221+
sdkPath,
222+
'lib',
223+
'_internal',
224+
'vm_platform_strong.dill',
225+
);
226+
if (_fileSystem.file(dillPath).existsSync()) {
227+
return dillPath;
228+
}
229+
// In newer SDKs, `vm_platform_strong.dill` is replaced with
230+
// `vm_platform.dill`.
231+
return p.absolute(sdkPath, 'lib', '_internal', 'vm_platform.dill');
232+
}
221233

222-
String get vmPlatformProductDill => p.absolute(
223-
sdkPath,
224-
'lib',
225-
'_internal',
226-
'vm_platform_strong_product.dill',
227-
);
234+
String get vmPlatformProductDill {
235+
final dillPath = p.absolute(
236+
sdkPath,
237+
'lib',
238+
'_internal',
239+
'vm_platform_strong_product.dill',
240+
);
241+
if (_fileSystem.file(dillPath).existsSync()) {
242+
return dillPath;
243+
}
244+
// In newer SDKs, `vm_platform_strong_product.dill` is replaced with
245+
// `vm_platform_product.dill`.
246+
return p.absolute(sdkPath, 'lib', '_internal', 'vm_platform_product.dill');
247+
}
228248

229249
/// The version when cross-compilation was introduced.
230250
static final Version _crossCompilationVersion = Version.parse('3.8.0');

apps/distroless/dart/test/test-docker.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ echo "DART_VERSION: $DART_VERSION"
1919
DART="$DART_HOME/bin/dartaotruntime"
2020
FE_SNAPSHOT="$DART_HOME/bin/snapshots/frontend_server_aot.dart.snapshot"
2121
VM_PLATFORM="$DART_HOME/lib/_internal/vm_platform_strong_product.dill"
22+
if [ ! -f "$DART" ]; then
23+
VM_PLATFORM="$DART_HOME/lib/_internal/vm_platform_product.dill"
24+
fi
2225

2326
SCRIPT_DIR=$(cd $(dirname $0); pwd)
2427

0 commit comments

Comments
 (0)