eclipse-theia/theia

[search-in-workspace] Workspace search does not work in Electron with asar packaging

Open

#7,528 建立於 2020年4月8日

在 GitHub 查看
 (4 留言) (2 反應) (0 負責人)TypeScript (18,676 star) (2,478 fork)batch import
electronelectron-buildhelp wantedsearch in workspace

描述

Description

Workspace search does not work in Electron with asar packaging enabled because rg cannot be spawned. The following message is shown when launching the Electron executable via a console:

process ERROR Error: spawn C:\path\to\application\resources\app.asar\node_modules\vscode-ripgrep\bin\rg.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)

In the above path, app.asar should be replaced with app.asar.unpacked, as binaries cannot be in the asar file and have to be unpacked instead in order to be executable. However, the rg path (created here and used here) does not take this into account.

See also https://github.com/electron/electron/issues/6262 for a general discussion about this issue.

Reproduction Steps

  1. Enter anything in the workspace search box. No search results are shown.

OS and Theia version: Windows 10 1803, Theia 0.16.1.

Diagnostics: See above.

貢獻者指南

[search-in-workspace] Workspace search does not work in Electron with asar packaging · eclipse-theia/theia#7528 | Good First Issue