Skip to content

Commit 2b700b5

Browse files
tjgqlberki
andauthored
[7.0.0] Remove RunfilesSupplier.getManifest(). (#20357)
It appears to be always empty. RELNOTES: None. PiperOrigin-RevId: 585627763 Change-Id: I7f39896c7f3a4ffb1040211265793b7f64d8d64d Co-authored-by: Googler <[email protected]>
1 parent a9747c1 commit 2b700b5

File tree

14 files changed

+14
-134
lines changed

14 files changed

+14
-134
lines changed

src/main/java/com/google/devtools/build/lib/actions/CompositeRunfilesSupplier.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,6 @@ public ImmutableMap<PathFragment, Map<PathFragment, Artifact>> getMappings() {
9393
return ImmutableMap.copyOf(result);
9494
}
9595

96-
@Override
97-
public ImmutableList<Artifact> getManifests() {
98-
ImmutableList.Builder<Artifact> result = ImmutableList.builder();
99-
for (RunfilesSupplier supplier : suppliers) {
100-
result.addAll(supplier.getManifests());
101-
}
102-
return result.build();
103-
}
104-
10596
@Override
10697
@Nullable
10798
public RunfileSymlinksMode getRunfileSymlinksMode(PathFragment runfilesDir) {

src/main/java/com/google/devtools/build/lib/actions/EmptyRunfilesSupplier.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package com.google.devtools.build.lib.actions;
1616

17-
import com.google.common.collect.ImmutableList;
1817
import com.google.common.collect.ImmutableMap;
1918
import com.google.common.collect.ImmutableSet;
2019
import com.google.devtools.build.lib.analysis.config.BuildConfigurationValue.RunfileSymlinksMode;
@@ -49,11 +48,6 @@ public ImmutableMap<PathFragment, Map<PathFragment, Artifact>> getMappings() {
4948
return ImmutableMap.of();
5049
}
5150

52-
@Override
53-
public ImmutableList<Artifact> getManifests() {
54-
return ImmutableList.of();
55-
}
56-
5751
@Override
5852
@Nullable
5953
public RunfileSymlinksMode getRunfileSymlinksMode(PathFragment runfilesDir) {

src/main/java/com/google/devtools/build/lib/actions/RunfilesSupplier.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package com.google.devtools.build.lib.actions;
1616

17-
import com.google.common.collect.ImmutableList;
1817
import com.google.common.collect.ImmutableMap;
1918
import com.google.common.collect.ImmutableSet;
2019
import com.google.devtools.build.lib.analysis.config.BuildConfigurationValue.RunfileSymlinksMode;
@@ -41,9 +40,6 @@ public interface RunfilesSupplier extends StarlarkValue {
4140
/** Returns mappings from runfiles directories to artifact mappings in that directory. */
4241
ImmutableMap<PathFragment, Map<PathFragment, Artifact>> getMappings();
4342

44-
/** Returns the runfiles manifest artifacts, if any. */
45-
ImmutableList<Artifact> getManifests();
46-
4743
/**
4844
* Returns the {@link RunfileSymlinksMode} for the given {@code runfilesDir}, or {@code null} if
4945
* the {@link RunfilesSupplier} doesn't know about the directory.

src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,19 +554,13 @@ public ImmutableMap<PathFragment, Map<PathFragment, Artifact>> getMappings() {
554554
/* eventHandler= */ null, /* location= */ null, repoMappingManifest));
555555
}
556556

557-
@Override
558-
public ImmutableList<Artifact> getManifests() {
559-
return ImmutableList.of();
560-
}
561-
562557
@Override
563558
public RunfilesSupplier withOverriddenRunfilesDir(PathFragment newRunfilesDir) {
564559
return newRunfilesDir.equals(getRunfilesDirectoryExecPath())
565560
? this
566561
: new SingleRunfilesSupplier(
567562
newRunfilesDir,
568563
runfiles,
569-
/* manifest= */ null,
570564
repoMappingManifest,
571565
runfileSymlinksMode,
572566
buildRunfileLinks);

src/main/java/com/google/devtools/build/lib/analysis/SingleRunfilesSupplier.java

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import static com.google.common.base.Preconditions.checkArgument;
1818
import static com.google.common.base.Preconditions.checkNotNull;
1919

20-
import com.google.common.collect.ImmutableList;
2120
import com.google.common.collect.ImmutableMap;
2221
import com.google.common.collect.ImmutableSet;
2322
import com.google.devtools.build.lib.actions.Artifact;
@@ -38,15 +37,14 @@ public final class SingleRunfilesSupplier implements RunfilesSupplier {
3837
private final PathFragment runfilesDir;
3938
private final Runfiles runfiles;
4039
private final Supplier<Map<PathFragment, Artifact>> runfilesInputs;
41-
@Nullable private final Artifact manifest;
4240
@Nullable private final Artifact repoMappingManifest;
4341
private final RunfileSymlinksMode runfileSymlinksMode;
4442
private final boolean buildRunfileLinks;
4543

4644
/**
47-
* Same as {@link SingleRunfilesSupplier#SingleRunfilesSupplier(PathFragment, Runfiles, Artifact,
48-
* Artifact, boolean, boolean)}, except adds caching for {@linkplain Runfiles#getRunfilesInputs
49-
* runfiles inputs}.
45+
* Same as {@link SingleRunfilesSupplier#SingleRunfilesSupplier(PathFragment, Runfiles, boolean,
46+
* Artifact, RunfileSymlinksMode, boolean)}, except adds caching for {@linkplain
47+
* Runfiles#getRunfilesInputs runfiles inputs}.
5048
*
5149
* <p>The runfiles inputs are computed lazily and softly cached. Caching is shared across
5250
* instances created via {@link #withOverriddenRunfilesDir}.
@@ -61,7 +59,6 @@ public static SingleRunfilesSupplier createCaching(
6159
runfilesDir,
6260
runfiles,
6361
/* runfilesCachingEnabled= */ true,
64-
/* manifest= */ null,
6562
repoMappingManifest,
6663
runfileSymlinksMode,
6764
buildRunfileLinks);
@@ -72,25 +69,20 @@ public static SingleRunfilesSupplier createCaching(
7269
*
7370
* @param runfilesDir the desired runfiles directory. Should be relative.
7471
* @param runfiles the runfiles for runilesDir.
75-
* @param manifest runfiles' associated runfiles manifest artifact, if present. Important: this
76-
* parameter will be used to filter the resulting spawn's inputs to not poison downstream
77-
* caches.
7872
* @param runfileSymlinksMode how to create runfile symlinks
7973
* @param buildRunfileLinks whether runfile symlinks should be created during the build
8074
*/
8175
@AutoCodec.Instantiator
8276
public SingleRunfilesSupplier(
8377
PathFragment runfilesDir,
8478
Runfiles runfiles,
85-
@Nullable Artifact manifest,
8679
@Nullable Artifact repoMappingManifest,
8780
RunfileSymlinksMode runfileSymlinksMode,
8881
boolean buildRunfileLinks) {
8982
this(
9083
runfilesDir,
9184
runfiles,
9285
/* runfilesCachingEnabled= */ false,
93-
manifest,
9486
repoMappingManifest,
9587
runfileSymlinksMode,
9688
buildRunfileLinks);
@@ -100,7 +92,6 @@ private SingleRunfilesSupplier(
10092
PathFragment runfilesDir,
10193
Runfiles runfiles,
10294
boolean runfilesCachingEnabled,
103-
@Nullable Artifact manifest,
10495
@Nullable Artifact repoMappingManifest,
10596
RunfileSymlinksMode runfileSymlinksMode,
10697
boolean buildRunfileLinks) {
@@ -112,7 +103,6 @@ private SingleRunfilesSupplier(
112103
: () ->
113104
runfiles.getRunfilesInputs(
114105
/* eventHandler= */ null, /* location= */ null, repoMappingManifest),
115-
manifest,
116106
repoMappingManifest,
117107
runfileSymlinksMode,
118108
buildRunfileLinks);
@@ -122,15 +112,13 @@ private SingleRunfilesSupplier(
122112
PathFragment runfilesDir,
123113
Runfiles runfiles,
124114
Supplier<Map<PathFragment, Artifact>> runfilesInputs,
125-
@Nullable Artifact manifest,
126115
@Nullable Artifact repoMappingManifest,
127116
RunfileSymlinksMode runfileSymlinksMode,
128117
boolean buildRunfileLinks) {
129118
checkArgument(!runfilesDir.isAbsolute());
130119
this.runfilesDir = checkNotNull(runfilesDir);
131120
this.runfiles = checkNotNull(runfiles);
132121
this.runfilesInputs = checkNotNull(runfilesInputs);
133-
this.manifest = manifest;
134122
this.repoMappingManifest = repoMappingManifest;
135123
this.runfileSymlinksMode = runfileSymlinksMode;
136124
this.buildRunfileLinks = buildRunfileLinks;
@@ -151,11 +139,6 @@ public ImmutableMap<PathFragment, Map<PathFragment, Artifact>> getMappings() {
151139
return ImmutableMap.of(runfilesDir, runfilesInputs.get());
152140
}
153141

154-
@Override
155-
public ImmutableList<Artifact> getManifests() {
156-
return manifest != null ? ImmutableList.of(manifest) : ImmutableList.of();
157-
}
158-
159142
@Override
160143
@Nullable
161144
public RunfileSymlinksMode getRunfileSymlinksMode(PathFragment runfilesDir) {
@@ -178,7 +161,6 @@ public SingleRunfilesSupplier withOverriddenRunfilesDir(PathFragment newRunfiles
178161
newRunfilesDir,
179162
runfiles,
180163
runfilesInputs,
181-
manifest,
182164
repoMappingManifest,
183165
runfileSymlinksMode,
184166
buildRunfileLinks);

src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,6 @@ protected void computeKey(
378378
// definition and the output of an action shouldn't change whether something is considered a
379379
// tool or not.
380380
fp.addPaths(runfilesSupplier.getRunfilesDirs());
381-
ImmutableList<Artifact> runfilesManifests = runfilesSupplier.getManifests();
382-
fp.addInt(runfilesManifests.size());
383-
for (Artifact runfilesManifest : runfilesManifests) {
384-
fp.addPath(runfilesManifest.getExecPath());
385-
}
386381
env.addTo(fp);
387382
fp.addStringMap(getExecutionInfo());
388383
PathMappers.addToFingerprint(getMnemonic(), getExecutionInfo(), outputPathsMode, fp);
@@ -522,9 +517,8 @@ private ActionSpawn(
522517
parent,
523518
parent.resourceSetOrBuilder);
524519
NestedSetBuilder<ActionInput> inputsBuilder = NestedSetBuilder.stableOrder();
525-
ImmutableList<Artifact> manifests = getRunfilesSupplier().getManifests();
526520
for (Artifact input : inputs.toList()) {
527-
if (!input.isFileset() && !manifests.contains(input)) {
521+
if (!input.isFileset()) {
528522
inputsBuilder.add(input);
529523
}
530524
}

src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendAction.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,6 @@ protected void computeKey(
261261
}
262262
fp.addString(getMnemonic());
263263
fp.addPaths(getRunfilesSupplier().getRunfilesDirs());
264-
ImmutableList<Artifact> runfilesManifests = getRunfilesSupplier().getManifests();
265-
for (Artifact runfilesManifest : runfilesManifests) {
266-
fp.addPath(runfilesManifest.getExecPath());
267-
}
268264
for (Artifact input : mandatoryInputs.toList()) {
269265
fp.addPath(input.getExecPath());
270266
}

src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,6 @@ protected void computeKey(
237237
// definition and the output of an action shouldn't change whether something is considered a
238238
// tool or not.
239239
fp.addPaths(getRunfilesSupplier().getRunfilesDirs());
240-
ImmutableList<Artifact> runfilesManifests = getRunfilesSupplier().getManifests();
241-
fp.addInt(runfilesManifests.size());
242-
for (Artifact runfilesManifest : runfilesManifests) {
243-
fp.addPath(runfilesManifest.getExecPath());
244-
}
245240
getEnvironment().addTo(fp);
246241
fp.addStringMap(executionInfo);
247242
PathMappers.addToFingerprint(

src/main/java/com/google/devtools/build/lib/rules/python/PyBuiltins.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ public Object addEnv(StarlarkRuleContext ruleContext, String runfilesStr, Runfil
150150
return new SingleRunfilesSupplier(
151151
PathFragment.create(runfilesStr),
152152
runfiles,
153-
/* manifest= */ null,
154153
/* repoMappingManifest= */ null,
155154
ruleContext.getConfiguration().getRunfileSymlinksMode(),
156155
ruleContext.getConfiguration().buildRunfileLinks());

src/test/java/com/google/devtools/build/lib/analysis/SingleRunfilesSupplierTest.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -56,48 +56,19 @@ public void testGetArtifactsWithSingleMapping() {
5656
new SingleRunfilesSupplier(
5757
PathFragment.create("notimportant"),
5858
mkRunfiles(artifacts),
59-
/* manifest= */ null,
6059
/* repoMappingManifest= */ null,
6160
RunfileSymlinksMode.SKIP,
6261
/* buildRunfileLinks= */ false);
6362

6463
assertThat(underTest.getArtifacts().toList()).containsExactlyElementsIn(artifacts);
6564
}
6665

67-
@Test
68-
public void testGetManifestsWhenNone() {
69-
RunfilesSupplier underTest =
70-
new SingleRunfilesSupplier(
71-
PathFragment.create("ignored"),
72-
Runfiles.EMPTY,
73-
/* manifest= */ null,
74-
/* repoMappingManifest= */ null,
75-
RunfileSymlinksMode.SKIP,
76-
/* buildRunfileLinks= */ false);
77-
assertThat(underTest.getManifests()).isEmpty();
78-
}
79-
80-
@Test
81-
public void testGetManifestsWhenSupplied() {
82-
Artifact manifest = ActionsTestUtil.createArtifact(rootDir, "manifest");
83-
RunfilesSupplier underTest =
84-
new SingleRunfilesSupplier(
85-
PathFragment.create("ignored"),
86-
Runfiles.EMPTY,
87-
manifest,
88-
/* repoMappingManifest= */ null,
89-
RunfileSymlinksMode.SKIP,
90-
/* buildRunfileLinks= */ false);
91-
assertThat(underTest.getManifests()).containsExactly(manifest);
92-
}
93-
9466
@Test
9567
public void withOverriddenRunfilesDir() {
9668
SingleRunfilesSupplier original =
9769
new SingleRunfilesSupplier(
9870
PathFragment.create("old"),
9971
Runfiles.EMPTY,
100-
ActionsTestUtil.createArtifact(rootDir, "manifest"),
10172
/* repoMappingManifest= */ null,
10273
RunfileSymlinksMode.SKIP,
10374
/* buildRunfileLinks= */ false);
@@ -109,7 +80,6 @@ public void withOverriddenRunfilesDir() {
10980
assertThat(overridden.getMappings())
11081
.containsExactly(newDir, Iterables.getOnlyElement(original.getMappings().values()));
11182
assertThat(overridden.getArtifacts()).isEqualTo(original.getArtifacts());
112-
assertThat(overridden.getManifests()).isEqualTo(original.getManifests());
11383
}
11484

11585
@Test
@@ -119,7 +89,6 @@ public void withOverriddenRunfilesDir_noChange_sameObject() {
11989
new SingleRunfilesSupplier(
12090
dir,
12191
Runfiles.EMPTY,
122-
ActionsTestUtil.createArtifact(rootDir, "manifest"),
12392
/* repoMappingManifest= */ null,
12493
RunfileSymlinksMode.SKIP,
12594
/* buildRunfileLinks= */ false);

0 commit comments

Comments
 (0)