Skip to content

feat: share sccache across isolated Rust tasks#2105

Open
konard wants to merge 5 commits into
mainfrom
issue-2100-85f57a363847
Open

feat: share sccache across isolated Rust tasks#2105
konard wants to merge 5 commits into
mainfrom
issue-2100-85f57a363847

Conversation

@konard

@konard konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • install verified sccache 0.16.0 binaries in regular, DinD, and Coolify images
  • give every Docker-isolated task a shared, bounded compiler-output cache while leaving each Cargo target/ isolated and disposable
  • normalize Git-root paths and use a stable in-container workspace path so equivalent locked dependency graphs hit across independent containers
  • support HIVE_MIND_SCCACHE=0 opt-out plus configurable cache directory/size and sccache --show-stats observability
  • document the capability in English, Chinese, Hindi, and Russian

Reproduction

Before this change, two isolated tasks building the same Rust dependency graph each kept their own multi-GiB target/ and had no shared RUSTC_WRAPPER/sccache backend. Deleting one task's target/ also discarded every reusable compiler artifact available to that task.

The committed experiment models two independent container filesystems by rebuilding the same locked crate at the stable in-container path, stopping the first sccache server, deleting the entire first checkout (including target/), and starting a second server against the shared cache:

experiments/verify-shared-sccache.sh

Observed second-build result:

Cache hits                             2
Cache hits (Rust)                      2
Cache misses                           0
Cache hits rate                   100.00 %
Max cache size                       100 MiB
Verified a cache hit across independent checkouts after deleting the first target/ tree.

Tests

  • npm test — all 350 default test files passed
  • npm run lint
  • npm run format:check
  • node tests/test-issue-1860-docker-isolation.mjs — 39 passed
  • node tests/test-issue-2100-shared-sccache.mjs
  • experiments/verify-shared-sccache.sh — second build reported 2 Rust cache hits, 0 misses
  • docker build --check -f Dockerfile .
  • docker build --check -f Dockerfile.dind .
  • docker build --check -f coolify/Dockerfile .
  • npm pack --dry-run --json — wrapper included with executable mode

Fixes #2100

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #2100
@konard konard self-assigned this Jul 25, 2026
@konard konard changed the title [WIP] Share sccache across isolated Rust task containers feat: share sccache across isolated Rust tasks Jul 25, 2026
@konard
konard marked this pull request as ready for review July 25, 2026 18:42
@konard

konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Implemented issue #2100 and marked the PR ready for review:

PR #2105 — Share sccache across isolated Rust tasks

Highlights:

  • Shared, bounded sccache across isolated Docker tasks.
  • Stable cache keys across independent workspaces.
  • Project target/ directories remain isolated and disposable.
  • Configurable cache size and opt-out support.
  • Verified cache reuse after deleting the first workspace and target/.
  • Added regression tests, documentation, experiment script, and changeset.
  • Fixed clean-image Docker installation issues discovered by fresh CI.

Final CI passed completely, including full test suites and Docker builds. Branch is synchronized with main, pushed, clean, and the PR merge state is CLEAN.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $34.457518

📊 Context and tokens usage:

  • 396.6K / 200K (198%) input tokens, 43.0K / 128K (34%) output tokens

Total: (396.6K + 28.6M cached) input tokens, 43.0K output tokens, $34.457518 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: low (~7999 tokens)
  • Model: GPT 5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (5769KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

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.

Share sccache across isolated Rust task containers

1 participant