Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Caching Issues in Lombok Plugin #1140

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tylerbertrand
Copy link

Summary

Makes the following changes to LombokConfig:

  1. Updates the configFiles task input to use relative path normalization instead of absolute path normalization
  2. Updates the inputPaths task input to return relative paths instead of absolute paths

Motivation

The usages of absolute paths were causing cache misses in situations that should have been cache hits. For instance, running the task on a CI machine that writes to a remote cache, and then running the same task from a local machine that reads from the remote cache. The absolute path of the two projects is different, which causes a cache miss here, even though the code is identical between them.

Tests

  1. Executed experiment 3 of Gradle's build validation scripts against a test project using a snapshot version of the plugin including the changes in this PR. The test project was built twice, with no code changes between builds, but with the project relocated on disk between builds. With these changes, there are no input differences between the builds, and in the second build, the generateEffectiveLombokConfig task came from cache. Executing the same experiment, using the same test project, but with version 8.6 of the plugin, shows input differences between the two builds, and the generateEffectiveLombokConfig task was executed in the second build.

…h normalization instead of absolute

Absolute path normalization on this property causes the task to re-execute when the absolute path of the config files changes (if the project is moved to another directory, or the build is executed from a different path in a CI machine, for instance), even when none of the inputs have changed otherwise.
…s instead of absolute

Using absolute paths for this property causes the task to re-execute when the absolute paths of the inputPaths changes (if the project is moved to another directory, or the build is executed from a different path in a CI machine, for instance), even when none of the inputs have changed otherwise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant