Build Caching
SynDB uses multiple layers of caching to keep compile times short across local development, CI pipelines, and production deploys.
Cargo profile settings
Configured in .cargo/config.toml, these profile settings keep local cargo
artifacts smaller and avoid leaking nightly-only compiler flags into nested
workspaces:
| Setting | Effect |
|---|---|
debug = "line-tables-only" | Keeps local debug symbols useful for stack traces while reducing debug-info size |
split-debuginfo = "unpacked" | Stores debug information outside the main binary on platforms that support it |
profile.dev.package."*".debug = false | Avoids generating debug information for third-party dependencies during local dev builds |
CI caching (GitHub Actions)
In CI, syndb-ci ci runs the pure Rust gate directly on the host (no Docker
for the ci subcommand). The generated Nix-runtime workflow opts into an
Actions cache for /tmp/.cargo/registry, /tmp/.cargo/git, and the workspace
target/ directory. The key includes Cargo.lock, flake.lock, the Rust
toolchain, flake source, Cargo configuration, runner architecture, and the
generated job scope.
For integration tests (local-stack-test, e2e-test, and the federation or
distributed ClickHouse lanes), syndb-ci uses Bollard to start only the
services required by that command. Test binaries run on the host with
environment variables pointing at isolated localhost:<port> endpoints or
Docker-network service names. No Cargo cache volumes are needed inside service
containers because the host target/ is used directly.
Nix OCI cache
Local stack images (syndb stack prepare) for the API and ETL are built with
Nix and cached using syndb ci nix-oci-cache. This command uses Nix
store paths as content-addressed fingerprints to skip unnecessary rebuilds:
nix build .#oci-syndb-apiproduces a store path (a hash of all inputs)- The script compares the current store path against a stamp file
(
/tmp/.oci-syndb-api.storepath) - If unchanged, the build is skipped entirely
- If changed, the new tarball is copied to
/tmp/and loaded into Docker
This means syndb stack prepare is near-instant when source hasn’t changed.
Nix Crane dependency caching
For Nix-based OCI image builds and the remaining Nix validation checks, the project uses Crane with a split dependency build:
# nix/rust.nix
mkCargoArtifacts = system:
craneLib.buildDepsOnly (mkCommonArgs system);
buildDepsOnly compiles all workspace dependencies into a cached Nix
derivation. Subsequent builds of workspace crates reuse these artifacts,
so only the project’s own code is recompiled. Since Nix derivations are
content-addressed, the dependency cache is automatically invalidated when
Cargo.lock changes.
UI Source-Hash Cache
The UI image path used by syndb stack prepare uses a source-hash stamp to skip
rebuilds when Rust UI source files, static assets, or the packaged QueryFabric
and Topoxide sources haven’t changed:
- SHA-256 of all files in
crates/services/ui-dioxus/src/,crates/services/ui-dioxus/public/,queryfabric/crates/queryfabric/src/,queryfabric/crates/queryfabric-catalog/src/,queryfabric/crates/queryfabric-dioxus/src/,queryfabric/crates/queryfabric-dialect-syql/src/, andvendor/topoxide/, plus the relevant workspace and crateCargo.tomlfiles andCargo.lock - Compared against
/tmp/.syndb-ui.srchash - If the hash matches and
syndb-ui:devexists in Docker, the build is skipped
The SyQL editor and ETL graph explorer are Rust/Dioxus components; no separate JavaScript assets participate in this cache.
Summary
| Layer | Scope | Mechanism | Invalidation |
|---|---|---|---|
| Cargo flags | Local dev | Reduced debug info | N/A (always active) |
| GitHub Actions cache | Nix-runtime Cargo CI | actions/cache@v4.3.0 | Cargo/Nix/toolchain/config hashes |
| Nix OCI cache | syndb stack prepare (API, ETL) | Nix store-path stamps | Content-addressed (any input change) |
| Crane deps | Nix validation, OCI images | buildDepsOnly derivation | Cargo.lock changes |
| UI source hash | syndb stack prepare (UI) | SHA-256 file stamp | Source file changes |