Skip to content

feat: bundle ripgrep binaries into SEA for offline support#25342

Merged
scidomino merged 2 commits intomainfrom
tomm_ripgrep
Apr 15, 2026
Merged

feat: bundle ripgrep binaries into SEA for offline support#25342
scidomino merged 2 commits intomainfrom
tomm_ripgrep

Conversation

@scidomino
Copy link
Copy Markdown
Collaborator

@scidomino scidomino commented Apr 13, 2026

Summary

This PR bundles ripgrep native binaries directly into the Gemini CLI's Single Executable Application (SEA).

Details

  • Binary Bundling: Pre-built ripgrep binaries for the 5 major architectures (Linux x64/arm64, macOS x64/arm64, Windows x64) are now checked into packages/core/vendor/ripgrep.
  • Asset Management: Updated scripts/copy_bundle_assets.js to ensure the vendor directory is included in the bundle/ folder during the SEA build process.
  • Path Resolution: Refactored packages/core/src/tools/ripGrep.ts to asynchronously check multiple potential paths for the rg executable, supporting both local development and the flattened SEA runtime environment.
  • Maintainer Tooling: Added scripts/download-ripgrep-binaries.js with proper Apache license headers and documentation to allow maintainers to easily update the checked-in binaries.

Related Issues

Replaces and fixes #25332

How to Validate

  1. Delete the binaries in packages/core/vendor/ripgrep and then run node scripts/download-ripgrep-binaries.js to verify the maintainer script correctly fetches all 5 architectures.
  2. Run node scripts/build_binary.js to generate a native SEA executable.
  3. Run gemini and verify that it does not log Ripgrep is not available. Falling back to GrepTool.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
    • Linux
      • Docker

@scidomino scidomino requested review from a team as code owners April 13, 2026 22:10
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 enables offline support for the Gemini CLI by bundling native ripgrep binaries directly into the Single Executable Application (SEA). This change removes the runtime dependency on downloading ripgrep, ensuring the CLI remains functional in air-gapped or restricted network environments.

Highlights

  • Binary Bundling: Bundled pre-built ripgrep binaries for major architectures directly into the repository to support offline environments.
  • Path Resolution: Refactored ripgrep path resolution to support both local development and the flattened SEA runtime environment.
  • Maintainer Tooling: Added a new script to automate the downloading and updating of ripgrep binaries.
  • Build Process: Updated the asset copying script to include the vendor directory in the final SEA bundle.
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.

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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

Size Change: -538 kB (-1.58%)

Total Size: 33.6 MB

Filename Size Change
./bundle/chunk-33XVPHVZ.js 0 B -3.55 MB (removed) 🏆
./bundle/chunk-QM5IP3NK.js 0 B -1.97 MB (removed) 🏆
./bundle/chunk-QOWMTZW3.js 0 B -14.9 MB (removed) 🏆
./bundle/chunk-YYECF7D6.js 0 B -3.8 kB (removed) 🏆
./bundle/core-OPEN57E4.js 0 B -46.5 kB (removed) 🏆
./bundle/devtoolsService-LEYFXUFW.js 0 B -28.4 kB (removed) 🏆
./bundle/gemini-GWVZJTXL.js 0 B -553 kB (removed) 🏆
./bundle/interactiveCli-PQQLD6S6.js 0 B -1.29 MB (removed) 🏆
./bundle/oauth2-provider-I3PX7IQM.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-CSADQYAZ.js 14.5 MB +14.5 MB (new file) 🆕
./bundle/chunk-KTBVXA7I.js 3.42 MB +3.42 MB (new file) 🆕
./bundle/chunk-PC3Y4R7E.js 1.97 MB +1.97 MB (new file) 🆕
./bundle/chunk-ZDBWA3IF.js 3.8 kB +3.8 kB (new file) 🆕
./bundle/core-3OLJY4PY.js 46.6 kB +46.6 kB (new file) 🆕
./bundle/devtoolsService-Y7ZEGVU4.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/gemini-F6FKD5B4.js 553 kB +553 kB (new file) 🆕
./bundle/interactiveCli-XPNEJLDW.js 1.29 MB +1.29 MB (new file) 🆕
./bundle/oauth2-provider-Z3ATPKNI.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-RJTRUG2J.js 39.8 kB 0 B
./bundle/cleanup-LT3ON4VR.js 0 B -932 B (removed) 🏆
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-T73EYRDX.js 356 B 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/gemini.js 4.97 kB 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/memoryDiscovery-MYQ3ZWKM.js 0 B -980 B (removed) 🏆
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/cleanup-DSVUJDCQ.js 932 B +932 B (new file) 🆕
./bundle/memoryDiscovery-R4AKKXHF.js 980 B +980 B (new file) 🆕

compressed-size-action

Comment thread scripts/download-ripgrep-binaries.js Fixed
Comment thread scripts/download-ripgrep-binaries.js Fixed
Copy link
Copy Markdown
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 replaces the runtime downloading of ripgrep with bundled, pre-built binaries for supported platforms and architectures. It removes the @joshua.litt/get-ripgrep dependency, adds a script to manage vendor binaries, and updates the RipGrepTool and build configuration to utilize these local assets. I have no feedback to provide.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

59 tests passed successfully on gemini-3-flash-preview.

🧠 Model Steering Guidance

This PR modifies files that affect the model's behavior (prompts, tools, or instructions).

  • ⚠️ Consider adding Evals: No behavioral evaluations (evals/*.eval.ts) were added or updated in this PR. Consider adding a test case to verify the new behavior and prevent regressions.
  • 🚀 Maintainer Reminder: Please ensure that these changes do not regress results on benchmark evals before merging.

This is an automated guidance message triggered by steering logic signatures.

@@ -0,0 +1,138 @@
/**
* @license
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: maybe convert this to typescript for easier maintainability going forward.

Copy link
Copy Markdown
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Contributor

@Samee24 Samee24 left a comment

Choose a reason for hiding this comment

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

LGTM

@scidomino scidomino added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 5562023 Apr 15, 2026
29 checks passed
@scidomino scidomino deleted the tomm_ripgrep branch April 15, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants