optimize build speed: sccache, CI profile, schemars feature gate#899
Merged
optimize build speed: sccache, CI profile, schemars feature gate#899
Conversation
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.
5643e68 to
1186685
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.cargo/config.tomlwith sccacherustc-wrapperfor local build caching[profile.ci]build profile with thin LTO and 16 codegen-units (~2-3x faster CI link time)schemarsdependency behindschemafeature flag (default-on) in zeph-llmDetails
sccache config (#877): Workspace
.cargo/config.tomlsetsrustc-wrapper = "sccache". CI env varRUSTC_WRAPPERtakes priority, so no conflict with existing workflows.CI build profile (#878):
[profile.ci]inherits release withlto = "thin"andcodegen-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-rsstill transitively depends on schemars — the gate benefits isolated zeph-llm consumers.Test plan
cargo +nightly fmt --checkpassescargo clippy --workspace -- -D warningspassescargo nextest run --workspace --lib --bins— 2691 tests passcargo clippy -p zeph-llm --no-default-features -- -D warningspassescargo build --profile ci -p zephbuilds successfullycargo deny checkcleanCloses #877, closes #878, closes #879
Epic: #859