zls icon indicating copy to clipboard operation
zls copied to clipboard

"Zig Setup: Install Zig" fails for remote wsl2

Open phatchman opened this issue 7 months ago • 3 comments

Zig Version

0.14.0

ZLS Version

0.6.10

Client / Code Editor / Extensions

vscode with ziglang zls

Steps to Reproduce and Observed Behavior

There appears to be an issue when trying to install zig versions with VS Code remote wsl. If there is a .zigversion in the root folder, everything works. If it is missing, it pops up an error dialog.

  1. Open a remote WSL folder with vscode
  2. Ensure there is no .zigversion in that folder.
  3. Select Zig Setup: Install Zig from the command palette.
  4. A popup dialog is shown with the error "Command 'Zig Setup: Install Zig' resulted in an error command 'zig.install' not found"
  5. Put a valid .zigversion file in the folder.
  6. Close folder and re-open
  7. Select Zig Setup: Install Zig from the command palette again.
  8. Setup then works as expected.

Expected Behavior

The Select Zig Setup: Install Zig should not rely on the existence of a .zigversion.

Relevant log output


phatchman avatar Jun 16 '25 04:06 phatchman

the west has fallen

gustavojoaquin avatar Jul 20 '25 02:07 gustavojoaquin

I had this same issue again on a fresh vscode and wsl installation under Windows aarch64 this time.

Adding .zigversion was not enough this time. I had to manually extract a 0.14.1 install to ~/.vscode-server/data/User/globalStorage/ziglang.vscode-zig/zig/aarch64-linux-0.14.1

After doing this and saving build.zig.zon ZLS sucessfully downloaded zig 0.14.0 automatically as this was the version specified in build.zig.zon.

However, no versions appear in the version list for Setup Install Zig, except for the ones I have manually installed.

The work-around is to manually install any required zig versions in WSL 2.

phatchman avatar Jul 25 '25 04:07 phatchman

at this point, why didn't just install Linux on VM? It's much better. the west has truly fallen

gustavojoaquin avatar Jul 25 '25 14:07 gustavojoaquin