Centralize persistent cache ID construction - #1201
Open
kartikjoshi21 wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Centralizes persistent BuildKit cache ID construction across Dalec鈥檚 package, build-tool, module, and website caches.
Changes:
- Adds
PersistentCacheIDand platform-formatting helpers. - Introduces environment-based cache identities across target families.
- Migrates persistent cache mounts and adds formatter tests.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
cache_id.go |
Defines centralized cache ID construction. |
cache_id_test.go |
Tests ID and platform formatting. |
cache.go |
Migrates user and build-tool caches. |
helpers.go |
Migrates apt cache IDs. |
generator_gomod.go |
Migrates Go module proxy cache. |
preprocess.go |
Uses the Go module cache helper. |
cmd/website/main.go |
Migrates website caches. |
docs/spec.schema.json |
Updates cache namespace documentation. |
packaging/linux/deb/pkg.go |
Accepts explicit build cache identity. |
packaging/linux/rpm/rpmbuild.go |
Replaces target keys with cache identities. |
targets/plugin/init.go |
Unifies alternate-target cache isolation. |
targets/windows/handler.go |
Adds Windows cache-aware routing. |
targets/windows/handle_zip.go |
Uses the Windows environment identity. |
targets/windows/handle_container.go |
Uses configuration-bound handlers. |
targets/linux/deb/distro/distro.go |
Adds Debian cache identity configuration. |
targets/linux/deb/distro/pkg.go |
Supplies Debian build cache identity. |
targets/linux/deb/distro/worker.go |
Centralizes platform-scoped apt IDs. |
targets/linux/deb/debian/bookworm.go |
Configures Bookworm identity. |
targets/linux/deb/debian/bullseye.go |
Configures Bullseye identity. |
targets/linux/deb/debian/trixie.go |
Configures Trixie identity. |
targets/linux/deb/ubuntu/bionic.go |
Configures Bionic identity. |
targets/linux/deb/ubuntu/focal.go |
Configures Focal identity. |
targets/linux/deb/ubuntu/jammy.go |
Configures Jammy identity. |
targets/linux/deb/ubuntu/noble.go |
Configures Noble identity. |
targets/linux/deb/ubuntu/resolute.go |
Configures Resolute identity. |
targets/linux/rpm/distro/distro.go |
Adds RPM and package-cache identities. |
targets/linux/rpm/distro/dnf_install.go |
Centralizes DNF/TDNF cache IDs. |
targets/linux/rpm/distro/pkg.go |
Supplies and validates RPM identity. |
targets/linux/rpm/almalinux/v8.go |
Configures AlmaLinux 8 identity. |
targets/linux/rpm/almalinux/v9.go |
Configures AlmaLinux 9 identity. |
targets/linux/rpm/azlinux/azlinux3.go |
Configures Azure Linux 3 identity. |
targets/linux/rpm/azlinux/azlinux4.go |
Configures Azure Linux 4 identity. |
targets/linux/rpm/rockylinux/v8.go |
Configures Rocky Linux 8 identity. |
targets/linux/rpm/rockylinux/v9.go |
Configures Rocky Linux 9 identity. |
targets/linux/rpm/suse/sles15.go |
Configures SLES 15 identity. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+19
to
+20
| // Namespace is an optional global namespace prepended to the whole cache ID. | ||
| Namespace string |
Comment on lines
+262
to
+266
| key = PersistentCacheID{ | ||
| Environment: cacheIdentity, | ||
| Platform: execCacheIDPlatform(ei, info.Platform), | ||
| Key: key, | ||
| }.String() |
| Key string | ||
| } | ||
|
|
||
| // String format the cache ID from its non-empty parts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Centralizes Dalec persistent BuildKit cache ID construction behind
PersistentCacheID.This replaces ad-hoc cache ID string formatting across user caches,
Go build cache, Rust sccache, Bazel, apt, RPM/DNF/TDNF, gomod proxy,
and website caches.
Fixes #1192
Special notes for your reviewer: