From 219e61e0e87774d03a02c2bdeee26f36fdc7fab2 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Mon, 13 May 2024 19:21:30 +0000 Subject: [PATCH] [ 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 Reviewed-by: Derek Xu Commit-Queue: Derek Xu Commit-Queue: Ben Konyi --- pkg/dartdev/lib/src/sdk.dart | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/pkg/dartdev/lib/src/sdk.dart b/pkg/dartdev/lib/src/sdk.dart index 0e1b9f831dab..c1ac01612376 100644 --- a/pkg/dartdev/lib/src/sdk.dart +++ b/pkg/dartdev/lib/src/sdk.dart @@ -148,17 +148,9 @@ class Sdk { if (!Directory(snapshotsDir).existsSync()) { // This is the less common case where the user is in // the checked out Dart SDK, and is executing `dart` via: - // ./out/ReleaseX64/dart ... - // We confirm in a similar manner with the gen directory existence - // and then return the correct sdk path: - final altPath = path.absolute(path.dirname(Platform.resolvedExecutable)); - final genPath = path.join(altPath, 'gen'); - if (Directory(genPath).existsSync()) { - sdkPath = altPath; - runFromBuildRoot = true; - } - // If that snapshot dir does not exist either, - // we use the first guess anyway. + // ./out/ReleaseX64/dart ... or in google3. + sdkPath = path.absolute(path.dirname(Platform.resolvedExecutable)); + runFromBuildRoot = true; } // Defer to [Runtime] for the version.