-
Notifications
You must be signed in to change notification settings - Fork 65
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
Installation Failure on Windows - "Cannot connect to c: resolve failed" #382
Comments
in the vscode extension, versionManager.ts is picking the wrong tar to use: C:\Users\arthu>where tar it should be using C:\Windows\System32\tar.exe The path is probably different in the vscode environment where I installed the extension |
changing this setting from "Git Bash" to "Command Prompt" fixed the extension installation failure issue: "terminal.integrated.defaultProfile.windows": "Command Prompt", |
I tried to reproduce this issue and here is what I observed: Visual Studio Code About:
I tried playing around with the following changes:
I modified the Zig extension to instead log out the $PATH and try to find import which from "which";
import path from "path";
export async function activate(context: vscode.ExtensionContext) {
const output = vscode.window.createOutputChannel("zig", { log: true });
output.info("Shell: ", vscode.env.shell);
output.info("which tar (all): ", which.sync("tar", { all: true }));
output.info("which tar: ", await which("tar", { nothrow: true }));
output.info("PATH: ", process.env.PATH?.split(path.delimiter), "\n");
vscode.env.onDidChangeShell(async (newShell) => {
output.info("new Shell: ", newShell);
output.info("Shell: ", vscode.env.shell);
output.info("which tar (all): ", which.sync("tar", { all: true }));
output.info("which tar: ", await which("tar", { nothrow: true }));
output.info("PATH: ", process.env.PATH?.split(path.delimiter), "\n");
}, context.subscriptions);
} Integrated Terminal shell: bash.exe (Git Bash) and then switched to cmd.exe (Command Prompt) Result
Integrated Terminal shell: bash.exe (Git Bash) and then switched to cmd.exe (Command Prompt) Result
The only way I could reproduce this issue was by using Git Bash to start VS Code. The other options like the integrated terminal did not matter. This is also what I would have expected since the tar command is not being ran from the integrated terminal. The path environment variable comes from the shell that ran VS Code and not from the integrated terminal. The only way I got To support running from Git Bash, it may make sense to look for
Footnotes |
C:\Users\arthu>echo %PATH%
It varies, sometimes click on icon on task bar, sometimes start menu, sometimes type code at the terminal and the terminal that i launch it from could be inside or outside of vscode.
yes, first launch from cmd.exe, then launch code again from within code at git bash prompt which i do frequently. you should be able to reproduce with this sequence: reproduce with: C:\Users\arthu> launch code from cmd.exe arthu@anakin MINGW64 ~/tmp launch code again from git bash prompt install zig language extension. ctrl+shift+p select "zig setup: install zig"
no but i probably picked the bottom option to use unix tools from command prompt
no, because i don't think it will because of the scenario i outlined above. thanks for taking the time to look into this |
I'm not starting vscode from within git-bash. I intentionally put git utilities on the path as I like to have unix-like utilities available in my cmd shell. So my PATH includes So if this extension is relying on the windows tar (and its params), then why wouldn't it be just using the |
I'm having trouble installing the Zig Language extension (ziglang.vscode-zig) in VS Code on my Windows machine. The extension won't install correctly.
When I try to install the Zig Language extension, I get the following error message:
It seems like the extension is trying to use the tar command from Git for Windows, and there's some kind of path issue.
The text was updated successfully, but these errors were encountered: