Skip to content

optimize build speed: sccache, CI profile, schemars feature gate#899

Merged
bug-ops merged 7 commits intomainfrom
epic/859-build-speed-optimization
Feb 25, 2026
Merged

optimize build speed: sccache, CI profile, schemars feature gate#899
bug-ops merged 7 commits intomainfrom
epic/859-build-speed-optimization

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 25, 2026

Summary

  • Add .cargo/config.toml with sccache rustc-wrapper for local build caching
  • Add [profile.ci] build profile with thin LTO and 16 codegen-units (~2-3x faster CI link time)
  • Gate schemars dependency behind schema feature flag (default-on) in zeph-llm

Details

sccache config (#877): Workspace .cargo/config.toml sets rustc-wrapper = "sccache". CI env var RUSTC_WRAPPER takes priority, so no conflict with existing workflows.

CI build profile (#878): [profile.ci] inherits release with lto = "thin" and codegen-units = 16. Production release binaries remain unchanged (fat LTO, 1 codegen unit).

schemars feature gate (#879): chat_typed, chat_typed_erased, Extractor, cached_schema, and supporting types gated with #[cfg(feature = "schema")]. zeph-llm compiles cleanly with --no-default-features. Note: ollama-rs still transitively depends on schemars — the gate benefits isolated zeph-llm consumers.

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace -- -D warnings passes
  • cargo nextest run --workspace --lib --bins — 2691 tests pass
  • cargo clippy -p zeph-llm --no-default-features -- -D warnings passes
  • cargo build --profile ci -p zeph builds successfully
  • cargo deny check clean

Closes #877, closes #878, closes #879
Epic: #859

@github-actions github-actions bot added documentation Improvements or additions to documentation llm LLM provider related rust dependencies size/M ci labels Feb 25, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 25, 2026 15:26
Add .cargo/config.toml with sccache rustc-wrapper for local build
caching. Add [profile.ci] inheriting release with thin LTO and 16
codegen-units for faster CI builds. Gate schemars dependency behind
"schema" feature in zeph-llm to allow compilation without JsonSchema
support.

Closes #877, closes #878, closes #879
Epic: #859
The workspace-level sccache rustc-wrapper breaks CI jobs that do not
install sccache (cargo deny, CodeQL). Move sccache configuration to
local developer setup via docs recommendation.
Workspace sccache config is the goal of #877. The cargo-deny job does
not compile code, so override RUSTC_WRAPPER="" to skip sccache lookup
during cargo metadata.
Trivy scans a debug binary which differs from production. Switch to
--profile ci (thin LTO, 16 codegen-units) for realistic security
scanning while remaining faster than full release builds.
Separate build-tests and test jobs so compilation happens once per
platform and test binaries run from pre-built archive. Move doc tests
to dedicated Linux-only job (platform-independent). Add dev profile
optimizations: disable debug info for dependencies, enable split
debuginfo for faster macOS linking.
@bug-ops bug-ops force-pushed the epic/859-build-speed-optimization branch from 5643e68 to 1186685 Compare February 25, 2026 15:44
@github-actions github-actions bot added size/L and removed size/M labels Feb 25, 2026
Without --lib --bins, nextest archive compiles all targets including
e2e tests with expectrl, which fails on Windows (is_alive returns
bool, not Result). Match the original test job filter.
@bug-ops bug-ops linked an issue Feb 25, 2026 that may be closed by this pull request
3 tasks
@bug-ops bug-ops merged commit cee6f75 into main Feb 25, 2026
27 checks passed
@bug-ops bug-ops deleted the epic/859-build-speed-optimization branch February 25, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci dependencies documentation Improvements or additions to documentation llm LLM provider related rust size/L

Projects

None yet

1 participant