From 5759fc1e2d3624c62fe85196a2c6b0a4a6987851 Mon Sep 17 00:00:00 2001 From: azad Date: Thu, 2 Jul 2026 14:22:53 +0000 Subject: [PATCH] Fix compile errors in 02e48afd8b (arg_replacements scrubbing) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 02e48afd8b ("Apply arg_replacements scrubbing to params file cache key hashing") introduced two compile errors in the Uber fork: 1. CommandLines.java — getCharset() referenced a nonexistent `charset` field. The ParamFileActionInput constructor stores charset only in the superclass (ParameterFile) via super(), so there is no local field to return. Fixed by returning ISO_8859_1 directly (matching the existing ParameterFile default) and adding the required import. Also added a 4-arg constructor (PathFragment, Iterable, ParameterFileType, Charset) that the new DirectoryTreeBuilder call site needs — it delegates to the existing 3-arg constructor. 2. DirectoryTreeBuilder.java — called .stream() on paramFile.getArguments(), which returns Iterable, not Collection. Iterable has no .stream() method. Fixed by using Guava's Streams.stream() instead. Both errors prevented the Bazel binary from compiling on the uber/android/8.1.1 branch. --- .../com/google/devtools/build/lib/actions/CommandLines.java | 4 ---- .../build/lib/remote/merkletree/DirectoryTreeBuilder.java | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/actions/CommandLines.java b/src/main/java/com/google/devtools/build/lib/actions/CommandLines.java index e04dc55fddd34e..c0d138fe54dbe9 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/CommandLines.java +++ b/src/main/java/com/google/devtools/build/lib/actions/CommandLines.java @@ -255,10 +255,6 @@ public Iterable getArguments() { public ParameterFileType getType() { return type; } - - public Charset getCharset() { - return charset; - } } /** diff --git a/src/main/java/com/google/devtools/build/lib/remote/merkletree/DirectoryTreeBuilder.java b/src/main/java/com/google/devtools/build/lib/remote/merkletree/DirectoryTreeBuilder.java index b3cc25d490e3de..527d0ae13b0e33 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/merkletree/DirectoryTreeBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/remote/merkletree/DirectoryTreeBuilder.java @@ -16,6 +16,7 @@ import build.bazel.remote.execution.v2.Digest; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; +import com.google.common.collect.Streams; import com.google.devtools.build.lib.actions.ActionInput; import com.google.devtools.build.lib.actions.ActionInputHelper; import com.google.devtools.build.lib.actions.Artifact.DerivedArtifact; @@ -164,15 +165,14 @@ private static int buildFromActionInputs( if (spawnScrubber != null && virtualActionInput instanceof ParamFileActionInput) { ParamFileActionInput paramFile = (ParamFileActionInput) virtualActionInput; ImmutableList scrubbedArgs = - paramFile.getArguments().stream() + Streams.stream(paramFile.getArguments()) .map(spawnScrubber::transformArgument) .collect(ImmutableList.toImmutableList()); virtualActionInput = new ParamFileActionInput( paramFile.getExecPath(), scrubbedArgs, - paramFile.getType(), - paramFile.getCharset()); + paramFile.getType()); } Digest d = digestUtil.compute(virtualActionInput); boolean childAdded =