aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
index aa98d3b98a..6652bd74ab 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
@@ -69,6 +69,8 @@ public final class BlazeWorkspace {
@Nullable
private Range<Long> lastExecutionRange = null;
+ private final String outputBaseFilesystemTypeName;
+
public BlazeWorkspace(BlazeRuntime runtime, BlazeDirectories directories,
SkyframeExecutor skyframeExecutor, SubscriberExceptionHandler eventBusExceptionHandler,
WorkspaceStatusAction.Factory workspaceStatusActionFactory, BinTools binTools) {
@@ -85,6 +87,9 @@ public final class BlazeWorkspace {
writeDoNotBuildHereFile(runtime.getStartupOptionsProvider());
}
setupExecRoot();
+ // Here we use outputBase instead of outputPath because we need a file system to create the
+ // latter.
+ this.outputBaseFilesystemTypeName = FileSystemUtils.getFileSystem(getOutputBase());
}
/**
@@ -126,6 +131,15 @@ public final class BlazeWorkspace {
}
/**
+ * Returns the cached value of
+ * {@code getOutputBase().getFilesystem().getFileSystemType(getOutputBase())}, which is assumed
+ * to be constant for a fixed workspace for the life of the Blaze server.
+ */
+ public String getOutputBaseFilesystemTypeName() {
+ return outputBaseFilesystemTypeName;
+ }
+
+ /**
* Returns the output path associated with this Blaze server process..
*/
public Path getOutputPath() {