void-linux / void-linux/void-packages

ripgrep patch in vscode package breaks some extensions depending on @vscode/ripgrep

Open
#52,958 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-testing
Dominant language
Shell
Stars
3.4k
Forks
2.8k
Avg merge
2d 5h
Merged PRs (30d)
299

Description

Is this a new report?

Yes

System Info

Void 6.11.6_1 x86_64 GenuineIntel uptodate rrFFFF

Package(s) Affected

vscode-1.91.1_1

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No response

Expected behaviour

Extensions such as Todo Tree import @vscode/ripgrep to perform searches across files. The tool should be able to locate ripgrep through the @vscode/ripgrep import.

Actual behaviour

Error

This error occurs because the vscode template patches out @vscode/ripgrep and points vscode to the locally installed ripgrep. This works for vscode itself, but not for extensions that make use of @vscode/ripgrep. The template cannot remove @vscode/ripgrep from installed extensions, so an alternative must be found.

Steps to reproduce
  1. Install latest version of vscode
  2. Install Todo Tree
  3. Observe as the extensions fails to locate @vscode/ripgrep

You can duct-tape fix this behavior by going in Todo Tree's settings and manually pointing the extention to /usr/bin/rg. However, this should not happen, breaks any extension depending on vscode's built-in ripgrep, and has only occurred on Void Linux and no other distribution in my experience (working fine on Gentoo, Arch, Fedora, and Linux Mint). Other distributions that apply a similar patch to Void's (or sandboxes vscode) could also face this problem, but Void Linux in this case introduces a breaking change that prevents some extensions from working properly.

Suggested action

Several module aliasing libraries exist on npm. If acceptable and possible (and reasonably doable from the package), one of those should be pulled and used to alias @vscode/ripgrep to Void's own module across the entirety of vscode at runtime, not only in the files of its codebase. If not realistic, alternative ways should be investigated to fix this problem, including alterations of the patch or perhaps a shim for the @vscode/ripgrep module.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the vscode package template at srcpkgs/vscode/template#L39 and reproduce the failure using the Todo Tree extension and @vscode/ripgrep. Compare the patched module resolution with the extension's expectation and investigate whether a package-level alias, an adjusted patch, or a shim is feasible. Done means extensions can locate ripgrep without manually setting /usr/bin/rg.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, shell
Domain
devtools, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.