Improve task relocatability in Protobuf plugin#49842
Merged
wilkinsona merged 2 commits intospring-projects:mainfrom Apr 7, 2026
Merged
Improve task relocatability in Protobuf plugin#49842wilkinsona merged 2 commits intospring-projects:mainfrom
wilkinsona merged 2 commits intospring-projects:mainfrom
Conversation
338b22e to
74fc7b2
Compare
wilkinsona
pushed a commit
to erichaagdev/spring-boot
that referenced
this pull request
Apr 7, 2026
Clears the `javaExecutablePath` on the Protobuf extension. This prevents absolute Java installation paths from being tracked as task inputs, avoiding cross-machine build cache misses and ensuring the task is fully relocatable. This is safe because `protoc` and `grpc` are configured to use native binaries rather than executable JARs. See: google/protobuf-gradle-plugin#785 Signed-off-by: Eric Haag <ehaag@gradle.com> See spring-projectsgh-49842
wilkinsona
added a commit
to erichaagdev/spring-boot
that referenced
this pull request
Apr 7, 2026
wilkinsona
added a commit
to erichaagdev/spring-boot
that referenced
this pull request
Apr 7, 2026
…utablePath" See spring-projectsgh-49842 Signed-off-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
74fc7b2 to
bfd2c1b
Compare
Clears the `javaExecutablePath` on the Protobuf extension. This prevents absolute Java installation paths from being tracked as task inputs, avoiding cross-machine build cache misses and ensuring the task is fully relocatable. This is safe because `protoc` and `grpc` are configured to use native binaries rather than executable JARs. See: google/protobuf-gradle-plugin#785 Signed-off-by: Eric Haag <ehaag@gradle.com> See spring-projectsgh-49842
…utablePath" See spring-projectsgh-49842 Signed-off-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
bfd2c1b to
bd72e50
Compare
Member
|
Thanks, @erichaagdev. The Detekt changes are applicable to 3.5.x and later so I'll apply those separately. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR improves build cache relocatability by fixing cross-machine cache misses in the Detekt and Protobuf tasks. Previously, absolute paths were leaking into task inputs, causing unnecessary cache invalidation between different environments (e.g., CI servers vs. local developer machines).
Changes
basePathon Detekt tasks to use a relative path from the root project. This prevents absolute paths from being used during analysis.javaExecutablePathon the Protobuf extension. This prevents absolute Java installation paths from being tracked as task inputs. (Note: This is safe becauseprotocandgrpcare configured to use native binaries rather than executable JARs).Impact
Normalizing these inputs ensures both tasks are fully relocatable. This will maximize remote build cache hits and prevent duplicate work across environments.
References
GenerateProtoTaskcaused by inputjavaExecutablePathgoogle/protobuf-gradle-plugin#785