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

Merged
merged 5 commits into from
Aug 19, 2024

Conversation

tylerbertrand
Copy link
Contributor

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.

@tylerbertrand
Copy link
Contributor Author

Hi, was hoping someone could take a look at this, thanks!

tylerbertrand and others added 5 commits August 19, 2024 23:11
…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.
@larsgrefer larsgrefer merged commit 41868e0 into freefair:main Aug 19, 2024
10 checks passed
@Desoroxxx
Copy link

Hi, I am using Lombok with RetroFuturaGradle for Minecraft mod development and it seems this broke something somewhere, see logs:
https://mclo.gs/7B3oVbB

I am commenting instead of creating an issue as I am not sure if this could be the cause and if it is, if there is some configuration to change.

The reason I believe this can be the cause is because 8.10 is where it broke (previous versions still works fine) and this seems to be the only Lombok related change.

@larsgrefer
Copy link
Member

@Desoroxxx I think you have the same issue as in #1193

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.

3 participants