Change the key type we keep around in our fileset mappings.
There is no need to throw away the fact that the mapping is artifact -> fileset symlinks so early.
This CL is otherwise a no-op.
RELNOTES: None
PiperOrigin-RevId: 211808154
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java
index 04d9427..411506a 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java
@@ -28,7 +28,6 @@
import com.google.devtools.build.lib.util.io.FileOutErr;
import com.google.devtools.build.lib.vfs.FileSystem;
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 com.google.devtools.build.skyframe.SkyFunction;
import com.google.devtools.build.skyframe.SkyFunction.Environment;
@@ -50,7 +49,7 @@
private final boolean shouldShowSubcommands;
private final boolean prettyPrintArgs;
- private ShowSubcommands(boolean shouldShowSubcommands, boolean prettyPrintArgs) {
+ ShowSubcommands(boolean shouldShowSubcommands, boolean prettyPrintArgs) {
this.shouldShowSubcommands = shouldShowSubcommands;
this.prettyPrintArgs = prettyPrintArgs;
}
@@ -63,7 +62,7 @@
private final MetadataHandler metadataHandler;
private final FileOutErr fileOutErr;
private final ImmutableMap<String, String> clientEnv;
- private final ImmutableMap<PathFragment, ImmutableList<FilesetOutputSymlink>> topLevelFilesets;
+ private final ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> topLevelFilesets;
@Nullable private final ArtifactExpander artifactExpander;
@Nullable private final Environment env;
@@ -82,7 +81,7 @@
MetadataHandler metadataHandler,
FileOutErr fileOutErr,
Map<String, String> clientEnv,
- ImmutableMap<PathFragment, ImmutableList<FilesetOutputSymlink>> topLevelFilesets,
+ ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> topLevelFilesets,
@Nullable ArtifactExpander artifactExpander,
@Nullable SkyFunction.Environment env,
@Nullable FileSystem actionFileSystem,
@@ -112,7 +111,7 @@
MetadataHandler metadataHandler,
FileOutErr fileOutErr,
Map<String, String> clientEnv,
- ImmutableMap<PathFragment, ImmutableList<FilesetOutputSymlink>> topLevelFilesets,
+ ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> topLevelFilesets,
ArtifactExpander artifactExpander,
@Nullable FileSystem actionFileSystem,
@Nullable Object skyframeDepsResult) {
@@ -187,8 +186,8 @@
* <p>Notably, in the future, we want any action-scoped artifacts to resolve paths using this
* method instead of {@link Artifact#getPath} because that does not allow filesystem injection.
*
- * <p>TODO(shahan): cleanup {@link Action}-scoped references to {@link Artifact.getPath} and
- * {@link Artifact.getRoot}.
+ * <p>TODO(shahan): cleanup {@link Action}-scoped references to {@link Artifact#getPath} and
+ * {@link Artifact#getRoot}.
*/
public Path getInputPath(ActionInput input) {
return pathResolver.toPath(input);
@@ -228,7 +227,7 @@
return executor.getEventHandler();
}
- public ImmutableMap<PathFragment, ImmutableList<FilesetOutputSymlink>> getTopLevelFilesets() {
+ public ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> getTopLevelFilesets() {
return topLevelFilesets;
}
diff --git a/src/main/java/com/google/devtools/build/lib/actions/BaseSpawn.java b/src/main/java/com/google/devtools/build/lib/actions/BaseSpawn.java
index aa49f2f..dcba403 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/BaseSpawn.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/BaseSpawn.java
@@ -88,7 +88,7 @@
}
@Override
- public ImmutableMap<PathFragment, ImmutableList<FilesetOutputSymlink>> getFilesetMappings() {
+ public ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> getFilesetMappings() {
return ImmutableMap.of();
}
diff --git a/src/main/java/com/google/devtools/build/lib/actions/DelegateSpawn.java b/src/main/java/com/google/devtools/build/lib/actions/DelegateSpawn.java
index 3b6447a..9d1abe4 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/DelegateSpawn.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/DelegateSpawn.java
@@ -17,7 +17,6 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.analysis.platform.PlatformInfo;
-import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.Collection;
import javax.annotation.Nullable;
@@ -54,7 +53,7 @@
}
@Override
- public ImmutableMap<PathFragment, ImmutableList<FilesetOutputSymlink>> getFilesetMappings() {
+ public ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> getFilesetMappings() {
return spawn.getFilesetMappings();
}
diff --git a/src/main/java/com/google/devtools/build/lib/actions/SimpleSpawn.java b/src/main/java/com/google/devtools/build/lib/actions/SimpleSpawn.java
index c5abd15..a9b6e54 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/SimpleSpawn.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/SimpleSpawn.java
@@ -18,7 +18,6 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.analysis.platform.PlatformInfo;
-import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.Map;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@@ -36,7 +35,7 @@
private final ImmutableList<? extends ActionInput> inputs;
private final ImmutableList<? extends ActionInput> tools;
private final RunfilesSupplier runfilesSupplier;
- private final Map<PathFragment, ImmutableList<FilesetOutputSymlink>> filesetMappings;
+ private final Map<Artifact, ImmutableList<FilesetOutputSymlink>> filesetMappings;
private final ImmutableList<? extends ActionInput> outputs;
private final ResourceSet localResources;
@@ -46,7 +45,7 @@
ImmutableMap<String, String> environment,
ImmutableMap<String, String> executionInfo,
RunfilesSupplier runfilesSupplier,
- Map<PathFragment, ImmutableList<FilesetOutputSymlink>> filesetMappings,
+ Map<Artifact, ImmutableList<FilesetOutputSymlink>> filesetMappings,
ImmutableList<? extends ActionInput> inputs,
ImmutableList<? extends ActionInput> tools,
ImmutableList<? extends ActionInput> outputs,
@@ -106,7 +105,7 @@
}
@Override
- public ImmutableMap<PathFragment, ImmutableList<FilesetOutputSymlink>> getFilesetMappings() {
+ public ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> getFilesetMappings() {
return ImmutableMap.copyOf(filesetMappings);
}
diff --git a/src/main/java/com/google/devtools/build/lib/actions/Spawn.java b/src/main/java/com/google/devtools/build/lib/actions/Spawn.java
index 0440d22..3f7aa20 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/Spawn.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/Spawn.java
@@ -17,7 +17,6 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.analysis.platform.PlatformInfo;
-import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.Collection;
import javax.annotation.Nullable;
@@ -58,7 +57,7 @@
* Map of the execpath at which we expect the Fileset symlink trees, to a list of
* FilesetOutputSymlinks which contains the details of the Symlink trees.
*/
- ImmutableMap<PathFragment, ImmutableList<FilesetOutputSymlink>> getFilesetMappings();
+ ImmutableMap<Artifact, ImmutableList<FilesetOutputSymlink>> getFilesetMappings();
/**
* Returns the list of files that are required to execute this spawn (e.g. the compiler binary),