From bbcff1802423fca7ee5bd6a3e527c12d6d7d80ba Mon Sep 17 00:00:00 2001 From: hvadehra Date: Tue, 19 Apr 2022 17:20:31 +0200 Subject: [PATCH] [5.2.0] Update java_tools 11.7.1 (#15231) * Update java_tools v11.7.1 A new release was required because https://github.com/bazelbuild/bazel/commit/0c65082a8aae2572d5c016fcb74273ae5e8786a0 caused java_tools to be built targetting java11, inadvertently dropping support for jre8/9/10 Closes #15258. PiperOrigin-RevId: 441834316 (cherry picked from commit 22c91dab43558503a1d6759ccfd77587d87b28cd) * Automatic code cleanup. PiperOrigin-RevId: 414481809 (cherry picked from commit 1987af2216b3adb7d0e19a70f0e1778eee519d4c) * Automatic code cleanup. PiperOrigin-RevId: 415349792 (cherry picked from commit ccc9b9d65623d454d987185af4e14ce26a67fa53) A clean cherry pick was not possible since the contents of various files in the change have diverged since this release branch was cut. --- distdir_deps.bzl | 32 +++++++++---------- .../build/lib/analysis/BuildView.java | 2 +- .../BuildEventServiceModule.java | 8 ++--- .../BuildEventServiceUploader.java | 12 +++---- .../transports/FileTransport.java | 2 +- .../build/lib/buildtool/ExecutionTool.java | 2 +- .../lib/exec/local/LocalSpawnRunner.java | 2 +- .../lib/platform/SystemSuspensionModule.java | 2 +- .../build/lib/remote/RemoteModule.java | 2 +- .../build/lib/runtime/BlazeOptionHandler.java | 4 +-- .../build/lib/runtime/BlazeRuntime.java | 2 +- .../lib/runtime/BuildSummaryStatsModule.java | 2 +- .../build/lib/server/GrpcServerImpl.java | 2 +- .../build/lib/server/ShutdownHooks.java | 2 +- .../devtools/build/lib/shell/Command.java | 2 +- .../skyframe/SequencedSkyframeExecutor.java | 2 +- .../desugar/testing/junit/DesugarRunner.java | 2 +- .../build/remote/worker/ExecutionServer.java | 2 +- 18 files changed, 42 insertions(+), 42 deletions(-) diff --git a/distdir_deps.bzl b/distdir_deps.bzl index 4db9bde9aec9e1..2ca988e260dafc 100644 --- a/distdir_deps.bzl +++ b/distdir_deps.bzl @@ -283,11 +283,11 @@ DIST_DEPS = { "remote_java_tools_test", "remote_java_tools_for_testing", ], - "archive": "java_tools-v11.6.zip", - "sha256": "a7ac5922ee01e8b8fcb546ffc264ef314d0a0c679328b7fa4c432e5f54a86067", + "archive": "java_tools-v11.7.1.zip", + "sha256": "2eede49b2d80135e0ea22180f63df26db2ed4b795c1c041b25cc653d6019fbec", "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.6/java_tools-v11.6.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.6/java_tools-v11.6.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.7.1/java_tools-v11.7.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.7.1/java_tools-v11.7.1.zip", ], "used_in": [ "additional_distfiles", @@ -299,11 +299,11 @@ DIST_DEPS = { "remote_java_tools_test_linux", "remote_java_tools_linux_for_testing", ], - "archive": "java_tools_linux-v11.6.zip", - "sha256": "15da4f84a7d39cd179acf3035d9def638eea6ba89a0ed8f4e8a8e6e1d6c8e328", + "archive": "java_tools_linux-v11.7.1.zip", + "sha256": "f78077f0c043d0d13c82de0ee4a99753e66bb18ec46e3601fa2a10e7f26798a8", "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.6/java_tools_linux-v11.6.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.6/java_tools_linux-v11.6.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.7.1/java_tools_linux-v11.7.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.7.1/java_tools_linux-v11.7.1.zip", ], "used_in": [ "additional_distfiles", @@ -315,11 +315,11 @@ DIST_DEPS = { "remote_java_tools_test_windows", "remote_java_tools_windows_for_testing", ], - "archive": "java_tools_windows-v11.6.zip", - "sha256": "939f9d91f0df02851bbad8f5b1d26d24011329394cafe5668c1234e31ac2a1f7", + "archive": "java_tools_windows-v11.7.1.zip", + "sha256": "a7086734866505292ee4c206328c73c6af127e69bd51b98c9c186ae4b9b6d2db", "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.6/java_tools_windows-v11.6.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.6/java_tools_windows-v11.6.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.7.1/java_tools_windows-v11.7.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.7.1/java_tools_windows-v11.7.1.zip", ], "used_in": [ "additional_distfiles", @@ -331,11 +331,11 @@ DIST_DEPS = { "remote_java_tools_test_darwin", "remote_java_tools_darwin_for_testing", ], - "archive": "java_tools_darwin-v11.6.zip", - "sha256": "f17ee54582b61f1ebd84c8fa2c54df796914cfbaac3cb821fb1286b55b080bc0", + "archive": "java_tools_darwin-v11.7.1.zip", + "sha256": "4d6d388b54ad3b9aa35b30dd67af8d71c4c240df8cfb5000bbec67bdd5c53a73", "urls": [ - "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.6/java_tools_darwin-v11.6.zip", - "https://github.com/bazelbuild/java_tools/releases/download/java_v11.6/java_tools_darwin-v11.6.zip", + "https://mirror.bazel.build/bazel_java_tools/releases/java/v11.7.1/java_tools_darwin-v11.7.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v11.7.1/java_tools_darwin-v11.7.1.zip", ], "used_in": [ "additional_distfiles", diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java index ea261a9ad2de5d..5c8421e9e7171c 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java @@ -410,7 +410,7 @@ public AnalysisResult update( "Analysis succeeded for only %d of %d top-level targets", numSuccessful, numTargetsToAnalyze); eventHandler.handle(Event.info(msg)); - logger.atInfo().log(msg); + logger.atInfo().log("%s", msg); } AnalysisResult result; diff --git a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceModule.java b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceModule.java index 463551c9de19a6..b352779c72d8d5 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceModule.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceModule.java @@ -163,7 +163,7 @@ private void reportError( // Don't hide unchecked exceptions as part of the error reporting. Throwables.throwIfUnchecked(exception); - logger.atSevere().withCause(exception).log(msg); + logger.atSevere().withCause(exception).log("%s", msg); reportCommandLineError(commandLineReporter, exception); moduleEnvironment.exit(createAbruptExitException(exception, msg, besCode)); } @@ -254,7 +254,7 @@ private void waitForPreviousInvocation(boolean isShutdown) { + "Cancelling and starting a new invocation...", waitedMillis / 1000, waitedMillis % 1000); reporter.handle(Event.warn(msg)); - logger.atWarning().withCause(exception).log(msg); + logger.atWarning().withCause(exception).log("%s", msg); cancelCloseFutures = true; } catch (ExecutionException e) { String msg; @@ -274,7 +274,7 @@ private void waitForPreviousInvocation(boolean isShutdown) { e.getMessage()); } reporter.handle(Event.warn(msg)); - logger.atWarning().withCause(e).log(msg); + logger.atWarning().withCause(e).log("%s", msg); cancelCloseFutures = true; } finally { if (cancelCloseFutures) { @@ -671,7 +671,7 @@ private BuildEventServiceTransport createBesTransport( String.format( "Build Event Service uploads disabled due to a connectivity problem: %s", status); reporter.handle(Event.warn(message)); - logger.atWarning().log(message); + logger.atWarning().log("%s", message); return null; } diff --git a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceUploader.java b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceUploader.java index 748a6743f07210..16b9e9e98a4d29 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceUploader.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceUploader.java @@ -293,7 +293,7 @@ ListenableFuture getHalfCloseFuture() { private DetailedExitCode logAndSetException( String message, BuildProgress.Code bpCode, Throwable cause) { - logger.atSevere().log(message); + logger.atSevere().log("%s", message); DetailedExitCode detailedExitCode = DetailedExitCode.of( FailureDetail.newBuilder() @@ -490,7 +490,7 @@ private void publishBuildEvents() String.format( "Expected ACK with seqNum=%d but received ACK with seqNum=%d", expected.getSequenceNumber(), actualSeqNum); - logger.atInfo().log(message); + logger.atInfo().log("%s", message); streamContext.abortStream(Status.FAILED_PRECONDITION.withDescription(message)); } } else { @@ -498,7 +498,7 @@ private void publishBuildEvents() String.format( "Received ACK (seqNum=%d) when no ACK was expected", ackEvent.getSequenceNumber()); - logger.atInfo().log(message); + logger.atInfo().log("%s", message); streamContext.abortStream(Status.FAILED_PRECONDITION.withDescription(message)); } } @@ -537,7 +537,7 @@ private void publishBuildEvents() if (!shouldRetryStatus(streamStatus)) { String message = String.format("Not retrying publishBuildEvents: status='%s'", streamStatus); - logger.atInfo().log(message); + logger.atInfo().log("%s", message); throw withFailureDetail( streamStatus.asException(), BuildProgress.Code.BES_STREAM_NOT_RETRYING_FAILURE, @@ -548,7 +548,7 @@ private void publishBuildEvents() String.format( "Not retrying publishBuildEvents, no more attempts left: status='%s'", streamStatus); - logger.atInfo().log(message); + logger.atInfo().log("%s", message); throw withFailureDetail( streamStatus.asException(), BuildProgress.Code.BES_UPLOAD_RETRY_LIMIT_EXCEEDED_FAILURE, @@ -636,7 +636,7 @@ private void publishLifecycleEvent(PublishLifecycleEventRequest request) if (!shouldRetryStatus(e.getStatus())) { String message = String.format("Not retrying publishLifecycleEvent: status='%s'", e.getStatus()); - logger.atInfo().log(message); + logger.atInfo().log("%s", message); throw withFailureDetail(e, BuildProgress.Code.BES_STREAM_NOT_RETRYING_FAILURE, message); } diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/FileTransport.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/FileTransport.java index 01ab3d10113c43..7bc427d7849342 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/FileTransport.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/FileTransport.java @@ -186,7 +186,7 @@ private void exitFailure(Throwable e) { .build()), e)); pendingWrites.clear(); - logger.atSevere().withCause(e).log(message); + logger.atSevere().withCause(e).log("%s", message); } private static BuildProgress.Code getBuildProgressCode(Throwable e) { diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java index 245e08ab1b9c86..c9a4005ff83a63 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java @@ -578,7 +578,7 @@ private static void logDeleteTreeFailure( for (Path entry : entries) { directoryDetails.append(" '").append(entry.getBaseName()).append("'"); } - logger.atWarning().log(directoryDetails.toString()); + logger.atWarning().log("%s", directoryDetails); } catch (IOException e) { logger.atWarning().withCause(e).log("'%s' exists but could not be read", directory); } diff --git a/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java index 46894f941df28f..351bfc8307f1d2 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java +++ b/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java @@ -251,7 +251,7 @@ private void stepLog( Level level, @Nullable Throwable cause, @FormatString String fmt, Object... args) { String msg = String.format(fmt, args); String toLog = String.format("%s (#%d %s)", msg, id, desc()); - logger.at(level).withCause(cause).log(toLog); + logger.at(level).withCause(cause).log("%s", toLog); } private String desc() { diff --git a/src/main/java/com/google/devtools/build/lib/platform/SystemSuspensionModule.java b/src/main/java/com/google/devtools/build/lib/platform/SystemSuspensionModule.java index 9a9b9db54d8009..ff80e0985a6a74 100644 --- a/src/main/java/com/google/devtools/build/lib/platform/SystemSuspensionModule.java +++ b/src/main/java/com/google/devtools/build/lib/platform/SystemSuspensionModule.java @@ -59,7 +59,7 @@ synchronized void suspendCallback(int reason) { String logString = event.logString(); reporter.handle(Event.info(logString)); reporter.post(event); - logger.atInfo().log(logString); + logger.atInfo().log("%s", logString); } } } diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java index 0e165d15217e87..871a9d42e6a4d7 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java @@ -868,7 +868,7 @@ public void afterCommand() throws AbruptExitException { failure = e; failureCode = Code.RPC_LOG_FAILURE; failureMessage = "Partially wrote rpc log file"; - logger.atWarning().withCause(e).log(failureMessage); + logger.atWarning().withCause(e).log("%s", failureMessage); } executorService = null; diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java index 57ad0283a3f0c6..bbf7abbb022fcb 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java @@ -274,7 +274,7 @@ DetailedExitCode parseStarlarkOptions(CommandEnvironment env, ExtendedEventHandl StarlarkOptionsParser.newStarlarkOptionsParser(env, optionsParser).parse(eventHandler); } catch (OptionsParsingException e) { String logMessage = "Error parsing Starlark options"; - logger.atInfo().withCause(e).log(logMessage); + logger.atInfo().withCause(e).log("%s", logMessage); return processOptionsParsingException( eventHandler, e, logMessage, Code.STARLARK_OPTIONS_PARSE_FAILURE); } @@ -343,7 +343,7 @@ DetailedExitCode parseOptions(List args, ExtendedEventHandler eventHandl } } catch (OptionsParsingException e) { String logMessage = "Error parsing options"; - logger.atInfo().withCause(e).log(logMessage); + logger.atInfo().withCause(e).log("%s", logMessage); return processOptionsParsingException( eventHandler, e, logMessage, Code.OPTIONS_PARSE_FAILURE); } catch (InterruptedException e) { diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java index 77f1f5fb4c5583..1fb99f77e23107 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java @@ -947,7 +947,7 @@ private static int batchMain(Iterable modules, String[] args) { try { logger.atInfo().log( - SafeRequestLogging.getRequestLogString(commandLineOptions.getOtherArgs())); + "%s", SafeRequestLogging.getRequestLogString(commandLineOptions.getOtherArgs())); BlazeCommandResult result = dispatcher.exec( policy, diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BuildSummaryStatsModule.java b/src/main/java/com/google/devtools/build/lib/runtime/BuildSummaryStatsModule.java index daad07acc7d55c..355e3c7dcb3002 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BuildSummaryStatsModule.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BuildSummaryStatsModule.java @@ -138,7 +138,7 @@ public void buildComplete(BuildCompleteEvent event) { event.getResult().getBuildToolLogCollection() .addDirectValue( "critical path", criticalPath.toString().getBytes(StandardCharsets.UTF_8)); - logger.atInfo().log(criticalPath.toString()); + logger.atInfo().log("%s", criticalPath); logger.atInfo().log( "Slowest actions:\n %s", Joiner.on("\n ").join(criticalPathComputer.getSlowestComponents())); diff --git a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java index 5a9df0b86687a0..9f73f5a3db5e85 100644 --- a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java +++ b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java @@ -545,7 +545,7 @@ private void executeCommand(RunRequest request, BlockingStreamObserver modifiedValues) { diff --git a/src/tools/android/java/com/google/devtools/build/android/desugar/testing/junit/DesugarRunner.java b/src/tools/android/java/com/google/devtools/build/android/desugar/testing/junit/DesugarRunner.java index c2c171c0366fce..aef4a80fb36bd7 100644 --- a/src/tools/android/java/com/google/devtools/build/android/desugar/testing/junit/DesugarRunner.java +++ b/src/tools/android/java/com/google/devtools/build/android/desugar/testing/junit/DesugarRunner.java @@ -267,7 +267,7 @@ static final class VacuousSuccess extends Statement { @Override public void evaluate() throws Throwable { - logger.atWarning().log(reason); + logger.atWarning().log("%s", reason); } @Override diff --git a/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java b/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java index f034870abb02f4..c1e23f417af4b0 100644 --- a/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java +++ b/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java @@ -331,7 +331,7 @@ private ActionResult execute( String.format( "Command:\n%s\nexceeded deadline of %f seconds.", Arrays.toString(command.getArgumentsList().toArray()), timeoutMillis / 1000.0); - logger.atWarning().log(errMessage); + logger.atWarning().log("%s", errMessage); errStatus = Status.newBuilder() .setCode(Code.DEADLINE_EXCEEDED.getNumber())