Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Step Cache
The step cache skips a whole step when Beez determines the step already produced its outputs and nothing material has changed.
A step is cacheable if it has at least one artifact pattern:
step({
name="compile",
phase="build",
scope="default",
input= { "src/**/*.cpp" },
output= { "build/app" },
run="cmake --build build",
})No input, output, or mutate means the step always runs.
On each step run, Beez checks (in order):
Per-step index (
.cache/index/<name>__<phase>__<scope>.index) if present:- Command fingerprint matches (shell command or Lua callback +
build.luahash) - Step config fingerprint matches
- Beez version matches
- Input file stamps match (path, size, modification time)
- All recorded outputs still exist on disk
- Command fingerprint matches (shell command or Lua callback +
If the index misses, content-addressed key lookup in
.cache/entries/<key>.manifest:- Key derived from input file content hashes, step identity, config, env, version
- Skip if manifest exists and outputs still exist
If all checks pass, the step is reported as a cache hit and not executed.
The content-addressed key combines:
| Component | Source |
|---|---|
| Step identity | name, phase, scope |
| Command | Shell run string, or <callback> + hash of build.lua |
| Input files | Content hash of each file matched by input + mutate globs |
| Step config | Serialized config / configure_step() table |
| Environment | Fingerprint of env.hash_vars (see Environment Variables) |
| Beez version | Installed Beez version string |
Input patterns are the union of input and mutate globs.
After a successful step run:
- Manifest at
.cache/entries/<key>.manifestlisting step name and output paths - Index at
.cache/index/<sanitized-name>__<phase>__<scope>.indexwith:- Cache key, command, config, version
- Input stamps (path, size, mtime)
- Output paths
- Last run duration (for time-saved display)
After execution, Beez records which files the step produced:
| Step declares | Outputs recorded as |
|---|---|
output globs | Expanded glob matches |
mutate only (no output) | Expanded mutate matches |
Neither output nor mutate | Directory snapshot diff under build/ (or dirs from output patterns) |
See Artifact Patterns.
run type | Command fingerprint |
|---|---|
| Shell string | Exact command text |
| Lua function | Hash of build.lua (callback body is not hashed separately) |
Changing build.lua invalidates Lua callback step cache entries.
Workers spawned via ctx:spawn() with inputs or outputs can use the same step cache machinery internally (treated as a synthetic step). See Step Context.
| Setting | Effect |
|---|---|
cache.enabled | Master switch |
cache.path | Root directory |
cache.hash.* | Hash algorithm for keys and file content |
performance.cache_write_strategy | When index/manifest writes flush to disk |
env.hash_vars | Env vars in key fingerprint |
See Cache Settings.
beez build --no-cache # always run cacheable steps
beez --clean-cache build # wipe cache first- Artifact Patterns -
input,output,mutate - Cache Keys and Invalidation - bump revisions, version upgrades
- Success Cache - finer-grained per-file caching
Quick Reference · Glossary · FAQ
- Fundamentals
- Core Concepts
- Project Layout
- First Pipeline
- Phases and Scopes
- How Phases and Scopes Work
- Selecting with Phases and Scopes
- Designing Phases and Scopes
- Parallel Execution and Dependencies
- Configuration
- Configuration Overview
- Global User Config
- Project Config
- Environment Variables
- Performance Settings
- Cache Settings
- Config Reference
- CLI
- CLI Overview
- Running Targets
- Filtering by Phase
- Running a Single Step
- Listing Entities
- Output and Logging Flags
- Cache and Maintenance Flags
- Meta and Utility Commands
- Project Scaffolding —
beez --init(embedded Tempify) - CLI Flag Reference
- Lua DSL
- DSL Overview
- Plugin System — Plugins, Config DSL, Standard-Workflows
- Step Declaration
- Task Declaration
- Workflow Declaration
- Order Declaration
- Configure Step
- ReqPack Declaration
- Beez API
- Step Context
- DSL Patterns
- Caching
- Caching Overview
- Step Cache
- Success Cache
- Glob Metadata Cache
- Artifact Patterns
- Cache Keys and Invalidation
- Cache Storage and Maintenance
- Caching Troubleshooting
- Development and Contribution
- Building and Setup
- Repository Layout
- Testing
- Code Quality
- Feature Development Workflow
- Submitting Changes