Skip to content

Output of asciidoctorPdf can be pulled from cache when run on machines with different checkout directories #2520

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

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

erichaagdev
Copy link
Contributor

@erichaagdev erichaagdev commented Sep 1, 2023

This sets the path sensitivity to relative for the sourceDir property of the asciidoctorPdf task. Previously, the full absolute path to the source directory would be considered as an input to the task. This would cause a local build cache miss when executing the task from two different directories or a remote build cache hit given that the paths to the sources directory on CI and for local developers will undoubtedly be different.

You can recreate this with the Gradle Enterprise Build Validation Scripts using the following command:

./03-validate-local-build-caching-different-locations.sh \
  -r https://github.com/spring-projects/spring-amqp \
  -t asciidoctorPdf \
  -c 31834589d727b697833ad5ef38117555dc9a848b

Looking at the task inputs comparison we can see the difference: https://ge.solutions-team.gradle.com/c/5nevshchvo24s/m75khvofipjne/task-inputs?cacheability=cacheable,overlapping-outputs,validation-failure

Using the diffoscope tool we can see the only difference for the generated index.pdf is in the creation and modification dates:

image

See also: spring-projects/spring-kafka#2794

This sets the path sensitivity to relative for the sourceDir property
of the asciidoctorPdf task. Previously, the full absolute path to the
sources directory would be considered as an input to the task. This
would cause a local build cache miss when executing the task from two
different directories or a remote build cache hit given that the paths
to the sources directory on CI and for local developers will undoubtedly
be different.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants