Skip to content

Commit 219e61e

Browse files
bkonyiCommit Queue
authored andcommitted
[ CLI ] Simplify check for SDK root
Removes the check for the `gen` directory when trying to identify a non-standard SDK root. This allows for the non-standard SDK in google3 to correctly load snapshots. TEST=CQ Change-Id: I9766ca83a02b19b1c059c13f06e4894e0ec03ae2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366200 Auto-Submit: Ben Konyi <[email protected]> Reviewed-by: Derek Xu <[email protected]> Commit-Queue: Derek Xu <[email protected]> Commit-Queue: Ben Konyi <[email protected]>
1 parent b550c3f commit 219e61e

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

pkg/dartdev/lib/src/sdk.dart

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,9 @@ class Sdk {
148148
if (!Directory(snapshotsDir).existsSync()) {
149149
// This is the less common case where the user is in
150150
// the checked out Dart SDK, and is executing `dart` via:
151-
// ./out/ReleaseX64/dart ...
152-
// We confirm in a similar manner with the gen directory existence
153-
// and then return the correct sdk path:
154-
final altPath = path.absolute(path.dirname(Platform.resolvedExecutable));
155-
final genPath = path.join(altPath, 'gen');
156-
if (Directory(genPath).existsSync()) {
157-
sdkPath = altPath;
158-
runFromBuildRoot = true;
159-
}
160-
// If that snapshot dir does not exist either,
161-
// we use the first guess anyway.
151+
// ./out/ReleaseX64/dart ... or in google3.
152+
sdkPath = path.absolute(path.dirname(Platform.resolvedExecutable));
153+
runFromBuildRoot = true;
162154
}
163155

164156
// Defer to [Runtime] for the version.

0 commit comments

Comments
 (0)