ribafish commented on PR #15532:
URL: https://github.com/apache/grails-core/pull/15532#issuecomment-4135119295

   Added two more commits on top of the overlapping outputs fix:
   
   **Normalize `APP_BASE_DIR` system property** — `configureForkSettings()` 
sets `BuildSettings.APP_BASE_DIR` to `project.projectDir.absolutePath` as a 
system property on all `Test` and `JavaExec` tasks. Since system properties are 
`@Input` on `Test`, this absolute path becomes part of the cache key and 
prevents cache hits when building from a different directory. Replaced with a 
`CommandLineArgumentProvider` using `@PathSensitive(RELATIVE)`.
   
   **Make SBOM timestamp reproducible** — The CycloneDX SBOM rewrite uses 
`buildDate` (defaults to `Instant.now()` without `SOURCE_DATE_EPOCH`) for the 
metadata timestamp, which also changes the `serialNumber` UUID. Since the SBOM 
is embedded in every jar, this cascades cache misses through the compile 
classpath of downstream projects. Fixed by using `Instant.EPOCH` when 
`SOURCE_DATE_EPOCH` is not set. Release builds continue to use the real build 
date.
   
   **Remaining: `SourceTask` path sensitivity** — `GroovyCompile`, 
`Checkstyle`, `CodeNarc`, and `Groovydoc` tasks still have relocatability 
issues in [experiment 
3](https://github.com/gradle/develocity-build-validation-scripts/blob/main/Gradle.md#experiment-3---validate-local-build-caching---different-locations)
 (validates local build caching by building the same commit from two different 
checkout directories and verifying cache hits on the second build). This 
happens because `SourceTask.getSource()` defaults to `@PathSensitive(ABSOLUTE)` 
in Gradle itself, which cannot be fixed in grails-core. Additionally, since 
`grails-gradle` is an included build compiled from Groovy, the task 
implementation bytecode differs between directories (Groovy compiler embeds 
source paths), causing "Task implementation changed" for all tasks whose class 
originates from the included build. This is a known limitation of experiment 3 
with Groovy-compiled included builds.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to