Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Livven opened this issue Apr 8, 2020 · 1 comment
Labels
electron issues related to the electron target electron-build issues related to building electron help wanted issues meant to be picked up, require help search in workspace issues related to the search-in-workspace

Comments

@Livven
Copy link
Contributor

Livven commented Apr 8, 2020

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 electron/electron#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.

@Livven
Copy link
Contributor Author

Livven commented Apr 8, 2020

By the way I think a simple fix would be to unpack the full vscode-ripgrep folder, which should cause the correct path to be resolved. However that would require additional configuration from the user.

Considering that for example electron-builder can do smart detection of what needs to be unpacked it would be nicer if Theia would play along with that and handle this automatically as well.

@vince-fugnitto vince-fugnitto added electron issues related to the electron target electron-build issues related to building electron search in workspace issues related to the search-in-workspace labels Apr 8, 2020
@akosyakov akosyakov added the help wanted issues meant to be picked up, require help label Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electron issues related to the electron target electron-build issues related to building electron help wanted issues meant to be picked up, require help search in workspace issues related to the search-in-workspace
Projects
None yet
Development

No branches or pull requests

3 participants