Skip to content

Centralize persistent cache ID construction - #1201

Open
kartikjoshi21 wants to merge 4 commits into
project-dalec:mainfrom
kartikjoshi21:kartik/1192-centralize-cache-ids
Open

Centralize persistent cache ID construction#1201
kartikjoshi21 wants to merge 4 commits into
project-dalec:mainfrom
kartikjoshi21:kartik/1192-centralize-cache-ids

Conversation

@kartikjoshi21

Copy link
Copy Markdown
Member

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:

Copilot AI balanced review requested due to automatic review settings August 13, 2026 18:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Centralizes persistent BuildKit cache ID construction across Dalec鈥檚 package, build-tool, module, and website caches.

Changes:

  • Adds PersistentCacheID and 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 thread cache_id.go
Comment on lines +19 to +20
// Namespace is an optional global namespace prepended to the whole cache ID.
Namespace string
Comment thread cache.go
Comment on lines +262 to +266
key = PersistentCacheID{
Environment: cacheIdentity,
Platform: execCacheIDPlatform(ei, info.Platform),
Key: key,
}.String()
Comment thread cache_id.go
Key string
}

// String format the cache ID from its non-empty parts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centralize Dalec persistent cache-ID construction

2 participants