Skip to content

Support BUILDKIT_CACHE_MOUNT_NS for persistent caches - #1203

Open
kartikjoshi21 wants to merge 5 commits into
mainfrom
kartik/1127-buildkit-cache-mount-ns
Open

Support BUILDKIT_CACHE_MOUNT_NS for persistent caches#1203
kartikjoshi21 wants to merge 5 commits into
mainfrom
kartik/1127-buildkit-cache-mount-ns

Conversation

@kartikjoshi21

Copy link
Copy Markdown
Member

Adds support for the Dockerfile-compatible BUILDKIT_CACHE_MOUNT_NS build arg.
When set, DALEC prefixes persistent BuildKit cache mount IDs with the provided namespace. This gives users a single global knob to isolate cache mounts across projects, CI lanes, branches, or shared builders without editing every spec cache key.

Fixes #1127

Copilot AI balanced review requested due to automatic review settings August 14, 2026 08:08
@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

Deploy Preview for dalec ready!

Name Link
🔨 Latest commit 45157cf
🔍 Latest deploy log https://app.netlify.com/projects/dalec/deploys/6a7ecce227b60f00089cf88a
😎 Deploy Preview https://deploy-preview-1203--dalec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Adds BUILDKIT_CACHE_MOUNT_NS support across Dalec’s persistent BuildKit caches.

Changes:

  • Threads the global namespace through package, language, and user-defined caches.
  • Centralizes cache ID construction and target cache identities.
  • Adds tests, schema updates, and documentation.

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
website/content/caches.md Documents global cache namespacing.
targets/windows/handler.go Adds configurable Windows cache identity.
targets/windows/handle_zip.go Applies namespace to Windows build caches.
targets/windows/handle_container.go Uses configured Windows handlers.
targets/plugin/init.go Separates alternate-target cache identities.
targets/linux/rpm/suse/sles15.go Defines SLES cache identity.
targets/linux/rpm/rockylinux/v9.go Defines Rocky 9 cache identity.
targets/linux/rpm/rockylinux/v8.go Defines Rocky 8 cache identity.
targets/linux/rpm/distro/pkg.go Passes namespace into RPM builds.
targets/linux/rpm/distro/dnf_install.go Namespaces DNF cache mounts.
targets/linux/rpm/distro/distro.go Centralizes RPM cache IDs.
targets/linux/rpm/distro/determinism_test.go Tests namespaced RPM caches.
targets/linux/rpm/azlinux/azlinux4.go Defines Azure Linux 4 cache identity.
targets/linux/rpm/azlinux/azlinux3.go Defines Azure Linux 3 cache identity.
targets/linux/rpm/almalinux/v9.go Defines AlmaLinux 9 cache identity.
targets/linux/rpm/almalinux/v8.go Defines AlmaLinux 8 cache identity.
targets/linux/deb/ubuntu/resolute.go Defines Resolute cache identity.
targets/linux/deb/ubuntu/noble.go Defines Noble cache identity.
targets/linux/deb/ubuntu/jammy.go Defines Jammy cache identity.
targets/linux/deb/ubuntu/focal.go Defines Focal cache identity.
targets/linux/deb/ubuntu/bionic.go Defines Bionic cache identity.
targets/linux/deb/distro/worker.go Namespaces worker apt caches.
targets/linux/deb/distro/pkg.go Passes namespace into DEB builds.
targets/linux/deb/distro/install.go Namespaces install-time apt caches.
targets/linux/deb/distro/distro.go Adds configurable DEB cache identity.
targets/linux/deb/distro/container.go Namespaces container apt caches.
targets/linux/deb/debian/trixie.go Defines Trixie cache identity.
targets/linux/deb/debian/bullseye.go Defines Bullseye cache identity.
targets/linux/deb/debian/bookworm.go Defines Bookworm cache identity.
source.go Carries the cache namespace in source options.
preprocess.go Namespaces preprocessing gomod caches.
packaging/linux/rpm/rpmbuild.go Applies namespace to RPM user caches.
packaging/linux/deb/pkg.go Applies namespace to DEB user caches.
load.go Registers the new build argument.
helpers.go Adds namespaced apt-cache helpers.
generator_gomod.go Namespaces gomod proxy caches.
frontend/gateway.go Reads the namespace build argument.
frontend/gateway_test.go Tests build-argument extraction.
docs/spec.schema.json Updates generated cache documentation.
cmd/website/main.go Uses standardized persistent cache IDs.
cache.go Applies namespaces across cache types.
cache_id.go Introduces structured cache ID generation.
cache_id_test.go Tests cache IDs and namespace behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread helpers.go
Comment thread targets/linux/rpm/azlinux/azlinux3.go
Comment thread targets/linux/rpm/azlinux/azlinux4.go
Comment thread targets/linux/rpm/suse/sles15.go
Comment thread targets/windows/handler.go
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.

Support a global persistent-cache namespace via BUILDKIT_CACHE_MOUNT_NS

2 participants