Skip to content

ci: cache Bazel repository + disk caches to speed up runs - #59

Merged
helly25 merged 1 commit into
mainfrom
ci/bazel-cache
Jun 21, 2026
Merged

ci: cache Bazel repository + disk caches to speed up runs#59
helly25 merged 1 commit into
mainfrom
ci/bazel-cache

Conversation

@helly25

@helly25 helly25 commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

CI recompiles and re-fetches everything on every run. This mounts actions/cache over Bazel's two caches so runs reuse prior work:

  • --repository_cache — downloaded external deps (abseil, re2, mbo, the hermetic LLVM toolchain). Also removes the flaky single point of failure where a release-tarball download 500'd and aborted a job.
  • --disk_cache — compiled action outputs, so unchanged sources aren't recompiled across runs.

Key: bazel-<os>-<config>-<hash(MODULE.bazel.lock,.bazelversion)>-<github.sha>. The github.sha suffix makes each run save a fresh entry (so the cache grows), while restore-keys fall back to the newest prior cache for the same os/config; the lockfile hash busts it when deps change. Per-config keys keep default and clang-asan artifacts separate.

Test plan

  • Workflow YAML validated with PyYAML (guards the colon-space-in-run footgun).
  • --disk_cache / --repository_cache flags verified locally on Bazel 9.1.1 (registry_test populated a 42 MB disk cache).
  • Effect is observable on this PR's run and the next: first run primes the cache (no speedup), subsequent runs restore it and skip the redundant fetch/compile.

Mount actions/cache over Bazel's repository cache (downloaded external
deps) and disk cache (compiled action outputs), passed via
--repository_cache / --disk_cache. Runs reuse prior fetch+compile instead
of starting cold, and dependency downloads stop being a flaky single
point of failure (cf. the recent 500 on a release tarball).

Key is per os/config plus a lockfile+bazelversion hash, suffixed with
github.sha so each run saves a fresh entry; restore-keys fall back to the
newest prior cache for the same os/config.
@helly25
helly25 merged commit 0e67978 into main Jun 21, 2026
4 checks passed
@helly25
helly25 deleted the ci/bazel-cache branch June 21, 2026 13:20
helly25 added a commit that referenced this pull request Jun 24, 2026
…t style (config phase E1) (#110)

Invoked through a `find`-named alias (symlink/copy), xff defaults to the strict
find style; invoked as `xff` (or any other name) it defaults to the modern xff
style. An explicit --config still overrides.

- config::DefaultStyleForProgram(argv0): basename "find" -> "find", else "xff".
- main.cc prepends that style to the --config selectors as the lowest-precedence
  base, before discovery, so ActiveStyle's last-wins lets an explicit --config
  override it, and find:/xff: .xffrc lines gate on it too.

This is the headline of the argv[0]-dispatch task (#59): `ln -s xff find && find .
-println` now errors (strict find), while `xff . -println` runs (modern), with no
flag. Per the settled "find stays loose" decision, the find style still rejects
only xff expression primaries; xff globals pass.

Tests: config_test (DefaultStyleForProgram - basename extraction, exact-name match,
non-find -> xff), style_test bashtest (a `find`-named symlink rejects -println with
exit 2; invoked as xff, -println runs). Green in both configs; clang-format +
em-dash clean.
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