Use TEST_SRCDIR instead of RUNFILES to access the test files.

The RUNFILES environment variable is an implementation detail of the
internal build rule, while TEST_SRCDIR is set by bazel. In practice,
they are pointed to the same directory.

See go/lsc-dart-runfiles for context.

R=srawlins@google.com

Change-Id: I2f7ea1aef7ff4ce2209d001eb89054e86abf22d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344342
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Chingjun Lau <chingjun@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This commit is contained in:
Chingjun Lau 2024-01-02 21:45:53 +00:00 committed by Commit Queue
parent 105cd96dc8
commit 4f93e8f093
2 changed files with 2 additions and 2 deletions

View file

@ -156,7 +156,7 @@ class KernelCompilationService {
static _SdkPaths _computeSdkPaths() {
// Check for google3.
final runFiles = io.Platform.environment['RUNFILES'];
final runFiles = io.Platform.environment['TEST_SRCDIR'];
if (runFiles != null) {
final aotRuntimePath = io.Platform.environment['AOT_RUNTIME_PATH']!;
final frontServerPath = io.Platform.environment['FRONTEND_SERVER_PATH']!;

View file

@ -28,7 +28,7 @@ String get packageRoot {
// Try google3 environment. We expect that all packages that will be
// accessed via this root are configured in the BUILD file, and located
// inside this single root.
final runFiles = Platform.environment['RUNFILES'];
final runFiles = Platform.environment['TEST_SRCDIR'];
final analyzerPackagesRoot = Platform.environment['ANALYZER_PACKAGES_ROOT'];
if (runFiles != null && analyzerPackagesRoot != null) {
return pathos.join(runFiles, analyzerPackagesRoot);