fix(core): add /nix/store to trusted system paths for Nix package manager - #28256
fix(core): add /nix/store to trusted system paths for Nix package manager#28256Dakshx07 wants to merge 1 commit into
Conversation
…ager Binaries managed by Nix (NixOS, nix-darwin, devenv) are installed under /nix/store which was missing from the isTrustedSystemPath allowlist. This caused gemini-cli to reject the resolved rg binary and fall back to GrepTool (standard grep), which does not respect .gitignore rules. On large projects (Rust target/ dirs, node_modules/) this caused the agent to hang indefinitely while crawling gigabytes of untracked binary files. Fix: add '/nix/store' to the trustedPrefixes array in the Unix branch of isTrustedSystemPath(), matching how Homebrew (/opt/homebrew) is already handled. Adds unit tests covering NixOS (linux) and nix-darwin (darwin) paths. Fixes google-gemini#28251
Summary of ChangesHello, 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 addresses an issue where binaries managed by the Nix package manager were not recognized as trusted system paths. By updating the allowlist in the core utilities, the system can now correctly identify and utilize these binaries, preventing performance degradation caused by falling back to less efficient tools. Highlights
Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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
|
|
📊 PR Size: size/S
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds /nix/store to the list of trusted system paths on macOS and Linux in packages/core/src/utils/paths.ts, and introduces corresponding unit tests in packages/core/src/utils/paths.test.ts. There are no review comments, and I have no feedback to provide.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
|
This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Problem
On systems using the Nix package manager (NixOS, nix-darwin, devenv), binaries like
rg(Ripgrep) are resolved to paths under/nix/store/.... However,isTrustedSystemPath()uses a hardcoded allowlist that does not include/nix/store.This caused:
rgto be rejected as untrustedGrepTool(standardgrep)grepignoring.gitignore, causing indefinite hangs on large projects withtarget/,node_modules/, etc.Fixes #28251
Changes
packages/core/src/utils/paths.ts: Added/nix/storetotrustedPrefixesinisTrustedSystemPath(), consistent with how Homebrew (/opt/homebrew,/usr/local/Cellar) is already handled.packages/core/src/utils/paths.test.ts: Added tests verifying/nix/store/...paths are trusted on bothlinux(NixOS) anddarwin(nix-darwin).Testing
All 118 existing tests pass + 3 new Nix-specific test cases added.