Skip to content

Commit c9f4996

Browse files
committed
Allow remote build with no-op scrubber
1 parent 8f2fb63 commit c9f4996

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public boolean mayBeExecutedRemotely(Spawn spawn) {
342342
return remoteCache instanceof RemoteExecutionCache
343343
&& remoteExecutor != null
344344
&& Spawns.mayBeExecutedRemotely(spawn)
345-
&& !isScrubbedSpawn(spawn, scrubber);
345+
&& !hasScrubbedInput(spawn, scrubber);
346346
}
347347

348348
@VisibleForTesting
@@ -1597,8 +1597,29 @@ void report(Event evt) {
15971597
}
15981598
}
15991599

1600-
private static boolean isScrubbedSpawn(Spawn spawn, @Nullable Scrubber scrubber) {
1601-
return scrubber != null && scrubber.forSpawn(spawn) != null;
1600+
private static boolean hasScrubbedInput(Spawn spawn, @Nullable Scrubber scrubber) {
1601+
if (scrubber == null) {
1602+
return false;
1603+
}
1604+
SpawnScrubber spawnScrubber = scrubber.forSpawn(spawn);
1605+
if (spawnScrubber == null) {
1606+
return false;
1607+
}
1608+
if (!spawnScrubber.getSalt().isEmpty()) {
1609+
return true;
1610+
}
1611+
for (String arg : spawn.getArguments()) {
1612+
if (!arg.equals(spawnScrubber.transformArgument(arg))) {
1613+
return true;
1614+
}
1615+
}
1616+
var inputFiles = spawn.getInputFiles();
1617+
for (ActionInput inputFile : inputFiles.toList()) {
1618+
if (spawnScrubber.shouldOmitInput(inputFile.getExecPath())) {
1619+
return true;
1620+
}
1621+
}
1622+
return false;
16021623
}
16031624

16041625
/**

0 commit comments

Comments
 (0)