Skip to content

ci: add build caching to release pipeline - #329

Merged
Finesssee merged 1 commit into
mainfrom
ci/build-caching
Aug 16, 2026
Merged

Finesssee merged 1 commit into
mainfrom
ci/build-caching

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Summary

Add three CircleCI caches to the release-build job to speed up builds:

1. Cargo registry cache (~/.cargo/registry)

  • Keyed on Cargo.lock checksum
  • Saves downloaded crate sources between runs
  • Biggest single win — avoids re-downloading all dependencies

2. Cargo target cache (~/cb/release/cache/cargo-target + cargo-target-cli)

  • Keyed on Cargo.lock + both Cargo.toml checksums
  • Fallback key release-cache-{Cargo.lock}- for partial hits when versions change
  • circleci-release-build.ps1 now uses a fixed WorkRoot (~/cb/release) instead of a random GUID
  • The finally block preserves cache/ while cleaning only source/ and assets/

3. pnpm store cache (~/cb/release/cache/pnpm-store)

  • Same cache key as cargo target (both live under ~/cb/release/cache)
  • Saves node_modules store between runs

Files changed

  • .circleci/config.yml — add restore_cache/save_cache steps
  • scripts/circleci-release-build.ps1 — fixed WorkRoot, preserve cache in finally

Validation

  • circleci config validate → valid
  • PowerShell parser → PARSE_OK

…se-build

Add CircleCI save_cache/restore_cache for three caches:

1. Cargo registry (~/.cargo/registry) — keyed on Cargo.lock checksum,
   saves downloaded crate sources between runs.

2. Cargo target + pnpm store (~/cb/release/cache) — keyed on Cargo.lock
   + both Cargo.toml checksums. circleci-release-build.ps1 now uses a
   fixed WorkRoot (~/cb/release) instead of a random GUID, and the
   finally block preserves cache/ (cargo-target, cargo-target-cli,
   pnpm-store) while cleaning only source/ and assets/. This lets the
   compiled artifacts and node_modules persist across runs.

The fallback key (release-cache-{Cargo.lock}-) provides a partial
cache hit when Cargo.toml versions change but dependencies are stable.
@Finesssee
Finesssee merged commit 499293d into main Aug 16, 2026
2 checks passed
Finesssee added a commit to hellhole8/Win-CodexBar that referenced this pull request Aug 16, 2026
The initial design avoided persistent compiled-output caches for OSS
fork safety (random GUID WorkRoot, deleted per run). This is now
superseded by the CircleCI save_cache/restore_cache added in PR nesszer#329.

Document the decision change, what is cached (cargo registry, cargo
target, pnpm store), and why it is safe (tag-only pipeline, protected
tags, preflight validation, cache-key sensitivity, no poisoning
surface).
@Finesssee
Finesssee deleted the ci/build-caching branch August 28, 2026 02:37
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.

1 participant