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

Using existing zig install does not work #147

Open
zwn opened this issue Oct 25, 2023 · 6 comments
Open

Using existing zig install does not work #147

zwn opened this issue Oct 25, 2023 · 6 comments

Comments

@zwn
Copy link

zwn commented Oct 25, 2023

I am using VSCodium on Windows 11. I've installed zig and now this extension v0.5.1. I get a pop up asking to either install zig, set path, find zig in path or cancel. When set the path to existing zig.exe, it does not work. In Runtime Status of the extension I see spawnSync /C:/Users/Zbynek/bin/zig.exe ENOENT

image

It seems the forward slash at the beginning might be the problem but I am not sure how to verify. However, the path never gets set to the property zig.path. When I do set the property by hand to the proper path, I get the same exception. After install, the property gets set to

"zig.path": "c:\\Users\\Zbynek\\AppData\\Roaming\\VSCodium\\User\\globalStorage\\ziglang.vscode-zig\\zig_install\\zig.exe",

When set to

"zig.path": "c:\\Users\\Zbynek\\bin\\zig.exe",

I get the exception.

@metroidchild
Copy link

Just to confirm, the path on your computer actually ends with \\bin\\zig.exe, and not something like \\bin\\zig-windows-<version>\\zig.exe?

This default unzipping behavior of windows caught myself off guard after using linux for an extended period of time.

@zwn
Copy link
Author

zwn commented Oct 28, 2023

It does. It is installed with zigup. It is some kind of forwarding exe to the real thing that lives in the same directory in subdirectory zig\\0.11.0\\files\\zig.exe. I can use it from cmd prompt:

C:\Users\Zbynek\bin>where zig
C:\Users\Zbynek\bin\zig.exe

C:\Users\Zbynek\bin>zig version
0.11.0

But that has given me an idea - when I set the path to c:\Users\Zbynek\bin\zig\0.11.0\files\zig.exe which is the real executable to which the zigup-provided zig.exe forwards, it works. When I replace the forwarding executable with a soft link, it also works ok.

C:\Users\Zbynek\bin>dir zig.exe
 Volume in drive C is Windows
 Volume Serial Number is 4624-DE45

 Directory of C:\Users\Zbynek\bin

28/10/2023  17:31    <SYMLINK>      zig.exe [c:\Users\Zbynek\bin\zig\0.11.0\files\zig.exe]
...

So the issue actually seems to be that the extension does not like what zigup is doing wrt the forwarding exe.

@Vexu
Copy link
Member

Vexu commented Oct 28, 2023

Note that zigup is redundant with this extension installed.

@Zylann
Copy link

Zylann commented Mar 28, 2024

I installed the Zig extension after having downloaded Zig on my D: drive. I didn't add it to my PATH, but I manually set the path to zig.exe in extension settings. Despite that I still get the popup asking me to set Zig's path on each startup:
image

Though I can cancel and stuff works (ZLS works and can compile with Build Workspace)

@Vexu
Copy link
Member

Vexu commented Mar 28, 2024

Is you vscode config file read only? The extension should be setting zig.initialSetupDone: true after you have selected one of those options once (other than cancel).

@Zylann
Copy link

Zylann commented Mar 28, 2024

It is not read-only. Also I see zig.initialSetupDone is false. I never actually picked any of the options on that dialog, I setup Zig's path after installing the extension by going into the settings myself.

When the popup showed up later, this time I selected "Specify path" and selected again where my zig executable is.
But even after I do that, I notice "initial setup" is still false:
image
And the popup still shows up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants