Skip to content

fix(ci): correct ccache variable CCACHE_IGNOREOPTIONS (was non-existent REGEX variant)#449

Merged
BenJule merged 1 commit into
masterfrom
fix/ccache-ignoreoptions-correct
Jun 4, 2026
Merged

fix(ci): correct ccache variable CCACHE_IGNOREOPTIONS (was non-existent REGEX variant)#449
BenJule merged 1 commit into
masterfrom
fix/ccache-ignoreoptions-correct

Conversation

@BenJule

@BenJule BenJule commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Root cause of the persistent 9% hit rate

CCACHE_IGNOREOPTIONSREGEX does not exist in ccache — it was silently ignored. So -DSLIC3R_DEV_TIMESTAMP=<sekunde> stayed in the hash and every build had ~90% misses, even with a warm -latest cache (confirmed: cache restored successfully in #61, still 9.20% hits).

Fix

Per the ccache 4.10 manual, the correct variable is CCACHE_IGNOREOPTIONS, using shell wildcards (not regex) — a trailing * matches any suffix:

  • Before: CCACHE_IGNOREOPTIONSREGEX=-DSLIC3R_DEV_TIMESTAMP=.* (regex, ignored)
  • After: CCACHE_IGNOREOPTIONS=-DSLIC3R_DEV_TIMESTAMP=* (wildcard, works)

Applies to all 6 occurrences: Debian, Fedora, Arch, Ubuntu, macOS.

Expected: ~9% → ~90%+ hit rate on the next warm run → Linux builds drop from ~60 min to ~10 min.

The variable CCACHE_IGNOREOPTIONSREGEX does not exist in ccache — it was
silently ignored, so SLIC3R_DEV_TIMESTAMP stayed in the hash and every
build saw ~90% cache misses regardless of warm caches.

Per ccache 4.10 manual the correct variable is CCACHE_IGNOREOPTIONS,
which uses shell wildcards (not regex): a trailing '*' matches any
suffix. Changed '-DSLIC3R_DEV_TIMESTAMP=.*' (regex) to
'-DSLIC3R_DEV_TIMESTAMP=*' (wildcard).

Affects Debian, Fedora, Arch (cd-packages.yml) and Ubuntu, macOS
(_build-core.yml). Expected: ~9% -> ~90%+ hit rate on the next warm run.

Source: https://ccache.dev/manual/4.10.html (ignore_options)
@BenJule BenJule self-assigned this Jun 4, 2026
@github-actions github-actions Bot added area: ci GitHub Actions, CI/CD platform: linux Linux-specific issue platform: macos macOS-specific issue labels Jun 4, 2026
@BenJule
BenJule merged commit db91283 into master Jun 4, 2026
6 checks passed
@github-actions github-actions Bot added this to the v02.07.00-dev milestone Jun 4, 2026
@BenJule
BenJule deleted the fix/ccache-ignoreoptions-correct branch June 4, 2026 03:41
BenJule added a commit that referenced this pull request Jun 4, 2026
## The real reason the cache never warmed up
GitHub Actions caches are **immutable**. The `-latest` stable-key
approach (PR #445) meant that once `ccache-<platform>-latest` existed
(from #60, with broken timestamp hashes), every later save failed with
**'Cache save failed'** — the stale cache was frozen forever. Even the
correct `CCACHE_IGNOREOPTIONS` fix (#449) could never store a clean
cache.
([github-action-benchmark#273](benchmark-action/github-action-benchmark#273))

## Fix
- Keys back to `ccache-<platform>-${{ github.run_id }}` — unique per
run, save always succeeds; `restore-keys` prefix finds the newest
previous cache.
- `CCACHE_MAXSIZE` 5G → 2G so big ccache entries don't evict the small
(165 MB) deps caches from the 10 GB repo limit — the original eviction
problem `-latest` tried (and failed) to solve.

After this + #449, the first warm run stores clean hashes, the next hits
~90%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci GitHub Actions, CI/CD platform: linux Linux-specific issue platform: macos macOS-specific issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant