mirror of
https://github.com/dart-lang/sdk
synced 2024-07-20 18:05:01 +00:00
[beta] [ Service ] Include drive letter in path when launching DDS snapshot
The previous logic for building the path to dds.dart.snapshot would result in the Windows drive letter being dropped from the path: \path\to\dart-sdk\bin\dds.dart.snapshot This works most of the time since a leading slash is treated as a reference to the current drive, which often contains the Dart SDK. However, if the SDK is on a different drive than the current (e.g., in a container with two drives), the VM will fail to find the snapshot. This change uses the File(...) APIs from dart:io to build the path rather than trying to use the Uri class to manually hack together a path. TEST=N/A, not reproducible without a second Windows drive Bug: https://github.com/grpc/grpc-dart/issues/697 Change-Id: I71d00b07a98508a780f5aab76417da4aa530f3c4 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/360920 Cherry-pick-request: https://github.com/dart-lang/sdk/issues/55386 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361400 Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
parent
9bf485fe01
commit
66b9bf5ef8
|
@ -96,25 +96,15 @@ class _DebuggingSession {
|
|||
bool disableServiceAuthCodes,
|
||||
bool enableDevTools,
|
||||
) async {
|
||||
final dartPath = Uri.parse(Platform.resolvedExecutable);
|
||||
final dartDir = [
|
||||
'', // Include leading '/'
|
||||
...dartPath.pathSegments.sublist(
|
||||
0,
|
||||
dartPath.pathSegments.length - 1,
|
||||
),
|
||||
].join('/');
|
||||
|
||||
final dartDir = File(Platform.resolvedExecutable).parent.path;
|
||||
final fullSdk = dartDir.endsWith('bin');
|
||||
final snapshotName = [
|
||||
dartDir,
|
||||
fullSdk ? 'snapshots' : 'gen',
|
||||
'dds.dart.snapshot',
|
||||
].join('/');
|
||||
final execName = dartPath.toString();
|
||||
|
||||
].join(Platform.pathSeparator);
|
||||
_process = await Process.start(
|
||||
execName,
|
||||
Platform.resolvedExecutable,
|
||||
[
|
||||
snapshotName,
|
||||
'--vm-service-uri=${server!.serverAddress!}',
|
||||
|
|
Loading…
Reference in a new issue