Skip to content

Optimize Rust CI builds with proper sccache configuration#15581

Merged
slin1237 merged 2 commits intomainfrom
rust-build
Dec 22, 2025
Merged

Optimize Rust CI builds with proper sccache configuration#15581
slin1237 merged 2 commits intomainfrom
rust-build

Conversation

@slin1237
Copy link
Collaborator

  • Add sccache to pr-test-pd-router.yml (was missing entirely)
  • Add RUSTC_WRAPPER and SCCACHE_GHA_ENABLED env vars
  • Replace old actions/cache with Swatinem/rust-cache + sccache
  • Standardize shared-key: "rust-cache" across all jobs for cache reuse
  • Add save-if: true to persist cache even on failure
  • Add rust-cache to maturin-build-test job
  • Add instructions for optional sccache setup
  • Note that project defaults to incremental for local dev

This should significantly speed up Rust builds by:

  1. Caching compiled crates across runs (rust-cache)
  2. Caching individual compilation units (sccache with GHA backend)
  3. Sharing cache between related jobs via shared-key

Checklist

- Add sccache to pr-test-pd-router.yml (was missing entirely)
- Add RUSTC_WRAPPER and SCCACHE_GHA_ENABLED env vars
- Replace old actions/cache with Swatinem/rust-cache + sccache
- Standardize shared-key: "rust-cache" across all jobs for cache reuse
- Add save-if: true to persist cache even on failure
- Add rust-cache to maturin-build-test job
- Add instructions for optional sccache setup
- Note that project defaults to incremental for local dev

This should significantly speed up Rust builds by:
1. Caching compiled crates across runs (rust-cache)
2. Caching individual compilation units (sccache with GHA backend)
3. Sharing cache between related jobs via shared-key
@github-actions github-actions bot added documentation Improvements or additions to documentation model-gateway labels Dec 21, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @slin1237, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the efficiency of Rust CI builds by implementing robust caching strategies. It introduces sccache and rust-cache to the CI workflows, aiming to drastically reduce build times by reusing compiled artifacts across runs and jobs. The changes also include updated documentation to guide developers on leveraging these caching mechanisms locally.

Highlights

  • CI Build Optimization: Integrated sccache into pr-test-pd-router.yml and the maturin-build-test job to significantly speed up Rust CI builds.
  • Caching Mechanism Update: Replaced the old actions/cache with Swatinem/rust-cache combined with sccache for more efficient caching of compiled crates and individual compilation units.
  • Standardized Cache Configuration: Standardized the shared-key: "rust-cache" across all relevant jobs to maximize cache reuse and added save-if: true to persist caches even on build failures.
  • Developer Documentation: Added a new 'Build Caching' section to sgl-model-gateway/README.md providing instructions for optional sccache setup for local development and clarifying its interaction with incremental compilation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/pr-benchmark-rust.yml
    • .github/workflows/pr-test-pd-router.yml
    • .github/workflows/pr-test-rust.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request optimizes Rust CI builds by integrating sccache and updates the documentation to guide developers on using it locally. The changes in the README are clear and provide valuable instructions for build caching. I have one suggestion to improve the user-friendliness of the installation instructions by recommending package managers for a faster sccache setup.

@slin1237 slin1237 merged commit 796969c into main Dec 22, 2025
53 of 59 checks passed
@slin1237 slin1237 deleted the rust-build branch December 22, 2025 01:32
jiaming1130 pushed a commit to zhuyijie88/sglang that referenced this pull request Dec 25, 2025
GuoYechang pushed a commit to GuoYechang/sglang that referenced this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation model-gateway run-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments