@@ -137,7 +137,6 @@ public class CommandEnvironment {
137
137
private final DelegatingDownloader delegatingDownloader ;
138
138
private final RemoteAnalysisCachingEventListener remoteAnalysisCachingEventListener ;
139
139
private final ImmutableList .Builder <IdleTask > idleTasks = ImmutableList .builder ();
140
- private final ResourceManager resourceManager ;
141
140
142
141
private boolean mergedAnalysisAndExecution ;
143
142
@@ -234,8 +233,7 @@ public void exit(AbruptExitException exception) {
234
233
CommandExtensionReporter commandExtensionReporter ,
235
234
int attemptNumber ,
236
235
@ Nullable String buildRequestIdOverride ,
237
- ConfigFlagDefinitions configFlagDefinitions ,
238
- ResourceManager resourceManager ) {
236
+ ConfigFlagDefinitions configFlagDefinitions ) {
239
237
checkArgument (attemptNumber >= 1 );
240
238
241
239
this .runtime = runtime ;
@@ -256,7 +254,6 @@ public void exit(AbruptExitException exception) {
256
254
this .timestampGranularityMonitor = new TimestampGranularityMonitor (runtime .getClock ());
257
255
this .attemptNumber = attemptNumber ;
258
256
this .configFlagDefinitions = configFlagDefinitions ;
259
- this .resourceManager = resourceManager ;
260
257
261
258
// Record the command's starting time again, for use by
262
259
// TimestampGranularityMonitor.waitForTimestampGranularity().
@@ -358,6 +355,9 @@ public void exit(AbruptExitException exception) {
358
355
value = clientEnv .get (name );
359
356
}
360
357
if (value != null ) {
358
+ if (workspace .getWorkspace () != null ) {
359
+ value = value .replace ("%bazel_workspace%" , workspace .getWorkspace ().getPathString ());
360
+ }
361
361
repoEnv .put (name , value );
362
362
repoEnvFromOptions .put (name , value );
363
363
}
@@ -715,7 +715,7 @@ public WorkspaceInfoFromDiff getWorkspaceInfoFromDiff() {
715
715
}
716
716
717
717
public ResourceManager getLocalResourceManager () {
718
- return resourceManager ;
718
+ return ResourceManager . instance () ;
719
719
}
720
720
721
721
/**
0 commit comments