Support system ripgrep on Android (Termux)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- android, javascript, node.js
- Domain
- build-system, tooling
Research direction
Start in lib/postinstall.js, especially main() and getTarget(), and review how the existing postinstall download path handles platforms. Test npm install in Android Termux with system ripgrep installed and absent. Done means Android avoids the unknown-platform failure, links the available rg binary, and preserves the fallback behavior when it is unavailable.
Written by the indexing model from the issue text.
Description
Problem
On Android (Termux), the postinstall script fails when trying to download prebuilt ripgrep binaries due to:
- Platform compatibility issues with prebuilt binaries
- The
getTarget()function throws "Unknown platform: android" - Network restrictions and architecture support limitations in Android environments
Current Behavior
When running npm install on Android, the postinstall script fails with:
Error: Unknown platform: android
at getTarget (/path/to/lib/postinstall.js:49:24)
Proposed Solution
Add Android platform detection to use system-installed ripgrep via symlink before falling back to downloads. This leverages the well-maintained ripgrep package available in Termux.
Code Implementation
Add this logic to the main() function in lib/postinstall.js:
// Handle Android specially - try to use system ripgrep if available
if (os.platform() === 'android') {
console.log('Android detected, checking for system ripgrep...');
try {
const result = await exec('which rg');
const systemRgPath = result.stdout.trim();
if (systemRgPath) {
console.log(`Found system ripgrep at ${systemRgPath}`);
const targetRgPath = path.join(BIN_PATH, 'rg');
// Remove existing symlink/file if it exists
try {
await util.promisify(fs.unlink)(targetRgPath);
} catch (err) {
// Ignore error if file doesn't exist
}
// Create symlink to system ripgrep
await util.promisify(fs.symlink)(systemRgPath, targetRgPath);
console.log(`Created symlink from ${targetRgPath} to ${systemRgPath}`);
return;
}
} catch (err) {
console.log('System ripgrep not found, falling back to download...');
}
}
Benefits of This Approach
- Reliability: Uses Termux's well-tested ripgrep package that works across Android devices
- Performance: Native builds optimized for the specific Android environment
- Compatibility: Avoids architecture and library compatibility issues with prebuilt binaries
- Maintenance: Leverages Termux package management for updates and security patches
- Graceful fallback: Still attempts download if system ripgrep unavailable
Testing
Tested on Android (Termux) with system ripgrep available:
- ✅ Detects Android platform correctly
- ✅ Finds system ripgrep at
/data/data/com.termux/files/usr/bin/rg - ✅ Creates symlink successfully
- ✅ Symlinked ripgrep works correctly (
rg --versionshows expected output) - ✅ Handles existing symlinks by removing them first
Installation Instructions for Users
On Android/Termux, users should install ripgrep first:
pkg install ripgrep
Then install vscode-ripgrep normally:
npm install vscode-ripgrep
The postinstall script will automatically detect and use the system ripgrep.
- Dominant language
- JavaScript
- Stars
- 203
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-ripgrep
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/vscode-ripgrep#88 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/vscode-ripgrep#87 · 1 comment · 3 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
microsoft/vscode-ripgrep#81 · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
microsoft/vscode-ripgrep#80 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/vscode-ripgrep#68 ·
All issues in microsoft/vscode-ripgrep
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100