diff --git a/src/main/java/com/google/devtools/build/lib/includescanning/IncludeScanningModule.java b/src/main/java/com/google/devtools/build/lib/includescanning/IncludeScanningModule.java index 54b81e00f84b05..18a5e10dd0a878 100644 --- a/src/main/java/com/google/devtools/build/lib/includescanning/IncludeScanningModule.java +++ b/src/main/java/com/google/devtools/build/lib/includescanning/IncludeScanningModule.java @@ -305,7 +305,6 @@ public void executorCreated() { spawnScannerSupplier, env.getExecRoot()); - spawnScannerSupplier.get().setOutputService(env.getOutputService()); spawnScannerSupplier.get().setInMemoryOutput(options.inMemoryIncludesFiles); } } diff --git a/src/main/java/com/google/devtools/build/lib/includescanning/SpawnIncludeScanner.java b/src/main/java/com/google/devtools/build/lib/includescanning/SpawnIncludeScanner.java index 8e03f89b2434a4..605ecfd69cae36 100644 --- a/src/main/java/com/google/devtools/build/lib/includescanning/SpawnIncludeScanner.java +++ b/src/main/java/com/google/devtools/build/lib/includescanning/SpawnIncludeScanner.java @@ -52,7 +52,6 @@ import com.google.devtools.build.lib.includescanning.IncludeParser.Inclusion; import com.google.devtools.build.lib.util.io.FileOutErr; import com.google.devtools.build.lib.vfs.IORuntimeException; -import com.google.devtools.build.lib.vfs.OutputService; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import java.io.IOException; @@ -72,7 +71,6 @@ public class SpawnIncludeScanner { ResourceSet.createWithRamCpu(/*memoryMb=*/ 10, /*cpuUsage=*/ 1); private final Path execRoot; - private OutputService outputService; private boolean inMemoryOutput; private final int remoteExtractionThreshold; @@ -82,11 +80,6 @@ public SpawnIncludeScanner(Path execRoot, int remoteExtractionThreshold) { this.remoteExtractionThreshold = remoteExtractionThreshold; } - public void setOutputService(OutputService outputService) { - Preconditions.checkState(this.outputService == null); - this.outputService = outputService; - } - public void setInMemoryOutput(boolean inMemoryOutput) { this.inMemoryOutput = inMemoryOutput; } @@ -120,11 +113,11 @@ public boolean shouldParseRemotely(Artifact file, ActionExecutionContext ctx) th if (file.getRoot().getRoot().isAbsolute()) { return false; } - // Files written remotely that are not locally available should be scanned remotely to avoid the + // Output files are generally not locally available should be scanned remotely to avoid the // bandwidth and disk space penalty of bringing them across. Also, enable include scanning - // remotely when explicitly directed to via a flag. + // remotely when the file size exceeds a certain size. return remoteExtractionThreshold == 0 - || (outputService != null && outputService.isRemoteFile(file)) + || !file.isSourceArtifact() || ctx.getPathResolver().toPath(file).getFileSize() > remoteExtractionThreshold; } diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteOutputService.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteOutputService.java index 957af4e4e45089..6939e1ea821015 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteOutputService.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteOutputService.java @@ -28,7 +28,6 @@ import com.google.devtools.build.lib.vfs.FileSystem; import com.google.devtools.build.lib.vfs.ModifiedFileSet; import com.google.devtools.build.lib.vfs.OutputService; -import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.vfs.Root; import java.util.Map; @@ -114,13 +113,6 @@ public void clean() { // Intentionally left empty. } - @Override - public boolean isRemoteFile(Artifact artifact) { - Path path = artifact.getPath(); - return path.getFileSystem() instanceof RemoteActionFileSystem - && ((RemoteActionFileSystem) path.getFileSystem()).isRemote(path); - } - @Override public boolean supportsPathResolverForArtifactValues() { return actionFileSystemType() != ActionFileSystemType.DISABLED; diff --git a/src/main/java/com/google/devtools/build/lib/vfs/OutputService.java b/src/main/java/com/google/devtools/build/lib/vfs/OutputService.java index 88a4cfffcf226c..21da650303de0b 100644 --- a/src/main/java/com/google/devtools/build/lib/vfs/OutputService.java +++ b/src/main/java/com/google/devtools/build/lib/vfs/OutputService.java @@ -141,9 +141,6 @@ void createSymlinkTree(Map symlinks, PathFragment sy */ void clean() throws ExecException, InterruptedException; - /** @return true iff the file actually lives on a remote server */ - boolean isRemoteFile(Artifact file); - default ActionFileSystemType actionFileSystemType() { return ActionFileSystemType.DISABLED; }