Jerome Prinet (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6310d02...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYzJjYzY1NGE5...
) / Improvement (
https://hibernate.atlassian.net/browse/HHH-16896?atlOrigin=eyJpIjoiYzJjYz...
) HHH-16896 (
https://hibernate.atlassian.net/browse/HHH-16896?atlOrigin=eyJpIjoiYzJjYz...
) Fix build cache misses on JavaCompile tasks when project is relocated (
https://hibernate.atlassian.net/browse/HHH-16896?atlOrigin=eyJpIjoiYzJjYz...
)
Issue Type: Improvement Affects Versions: 6.2.6 Assignee: Unassigned Components: build
Created: 05/Jul/2023 08:09 AM Priority: Minor Reporter: Jerome Prinet (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6310d02...
)
Issue
-----
The JavaCompile tasks reference (
https://github.com/hibernate/hibernate-orm/blob/39bc616cd97a505f0a8816a34...
) the stubs argument (through the check-framework-gradle-plugin (
https://github.com/kelloggm/checkerframework-gradle-plugin ) ) plugin which is defined as
an absolute path to the checkerstubs folder.
When the project folder is different (CI vs local build for instance), this absolute path
is different which changes the build cache key of the task and prevents from getting a
build cache hit.
See related issue
https://github.com/kelloggm/checkerframework-gradle-plugin/issues/252
Experimenting locally, the impact is 5mn28s of CPU time (starting with an empty cache):
Can only create thumbnails for attached images
Fix
---
The stubs argument can't be passed as a relative path because the JavaCompile task is
leveraging the Worker API (
https://docs.gradle.org/current/userguide/worker_api.html )
which changes the current working directory.
The fix is to use a CommandLineArgumentProvider (
https://docs.gradle.org/current/javadoc/org/gradle/process/CommandLineArg...
) which configures PathSensitivity (
https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/PathSensitiv... ) not to
be dependent on the path to the checkerstubs folder.
(
https://hibernate.atlassian.net/browse/HHH-16896#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16896#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100229- sha1:634ba05 )