[PR #409] [MERGED] Enable caching of native image building and test tasks #537

Closed
opened 2025-12-30 01:25:12 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/409
Author: @stefanobaghino
Created: 4/8/2024
Status: Merged
Merged: 4/18/2024
Merged by: @bioball

Base: mainHead: leverage-build-caching


📝 Commits (2)

  • edcbec4 Enable caching of native image building and test tasks
  • dff32c0 Update pkl-cli/pkl-cli.gradle.kts

📊 Changes

4 files changed (+16 additions, -14 deletions)

View changed files

📝 docs/docs.gradle.kts (+1 -1)
📝 pkl-cli/pkl-cli.gradle.kts (+4 -2)
📝 pkl-core/pkl-core.gradle.kts (+9 -9)
📝 pkl-server/pkl-server.gradle.kts (+2 -2)

📄 Description

This pull requests enables caching for the native image building task and improves the caching effectiveness of some of the test tasks in the project.

  1. the native image building is a generic Exec tasks for which caching needs to be enabled explicitly (see docs) as the build tool doesn't have natively have enough information to cache it effectively -- furthermore some steps need to be taken to normalize the classpath (JARs come with an embedded timestamp in their manifest and this needs to be ignored), as well as not rely on absolute paths
  2. while tests are usually cacheable, path relativity needs to be added as a property to ensure the results can be retrieved from a cache without relying on the environment of the machine running the task

All touched properties got a name to make sure it was easy to find them with Build Scan®.

These issues have been diagnosed using the build validation scripts by Gradle.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/409 **Author:** [@stefanobaghino](https://github.com/stefanobaghino) **Created:** 4/8/2024 **Status:** ✅ Merged **Merged:** 4/18/2024 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `leverage-build-caching` --- ### 📝 Commits (2) - [`edcbec4`](https://github.com/apple/pkl/commit/edcbec4b688bad2c1a44b20b0139e332e59f3d00) Enable caching of native image building and test tasks - [`dff32c0`](https://github.com/apple/pkl/commit/dff32c022f92483bc4b55f99b82637bf778d2e56) Update pkl-cli/pkl-cli.gradle.kts ### 📊 Changes **4 files changed** (+16 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/docs.gradle.kts` (+1 -1) 📝 `pkl-cli/pkl-cli.gradle.kts` (+4 -2) 📝 `pkl-core/pkl-core.gradle.kts` (+9 -9) 📝 `pkl-server/pkl-server.gradle.kts` (+2 -2) </details> ### 📄 Description This pull requests enables caching for the native image building task and improves the caching effectiveness of some of the test tasks in the project. 1. the native image building is a generic `Exec` tasks for which caching needs to be enabled explicitly (see [docs](https://docs.gradle.org/current/userguide/build_cache.html#using_the_runtime_api)) as the build tool doesn't have natively have enough information to cache it effectively -- furthermore some steps need to be taken to normalize the classpath (JARs come with an embedded timestamp in their manifest and this needs to be ignored), as well as not rely on absolute paths 2. while tests are usually cacheable, path relativity needs to be added as a property to ensure the results can be retrieved from a cache without relying on the environment of the machine running the task All touched properties got a name to make sure it was easy to find them with [Build Scan®](https://scans.gradle.com/). These issues have been diagnosed using [the build validation scripts by Gradle](https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/bf70ec7e5e57ab0996d68a970745512b79462134/Gradle.md). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:25:12 +01:00
adam closed this issue 2025-12-30 01:25:12 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#537