saem / vscode-nim

Other
180 stars 23 forks source link

Binary named 'nim' not found in PATH environment variable, even when nim exists in PATH #136

Open MKuranowski opened 7 months ago

MKuranowski commented 7 months ago

None of the extension's features work. When executing Nim: Check nim project an error message Binary named 'nim' not found in PATH environment variable pops up.

It makes no sense; I have nim downloaded into Documents and symlinked to from $HOME/.local/share/bin, which exists in PATH.

$ echo "$PATH"
/home/mikolaj/.local/share/bin:/home/mikolaj/.local/bin:/home/mikolaj/.local/share/go/bin:/home/mikolaj/.local/share/cargo/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
$ which nim
/home/mikolaj/.local/share/bin/nim
$ stat "$(which nim)"
  File: /home/mikolaj/.local/share/bin/nim -> /home/mikolaj/Documents/External-Software/nim/bin/nim
  Size: 53              Blocks: 8          IO Block: 4096   symbolic link
...
MKuranowski commented 7 months ago

Even if PATH literally points to the binary (not just a symlink) this issue persists

$ echo "$PATH"
/home/mikolaj/.local/share/bin:/home/mikolaj/.local/bin:/home/mikolaj/.local/share/go/bin:/home/mikolaj/.local/share/cargo/bin:/home/mikolaj/Documents/External-Software/nim/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
$ which nim
/home/mikolaj/Documents/External-Software/nim/bin/nim
$ stat "$(which nim)"
  File: /home/mikolaj/Documents/External-Software/nim/bin/nim
  Size: 9114160         Blocks: 17808      IO Block: 4096   regular file
...
MKuranowski commented 7 months ago

Note that /home/mikolaj/.local/share/bin/ or /home/mikolaj/Documents/External-Software/nim/bin/ are added to the path in $HOME/.zshrc; which would normally not be visible to programs launched from a DE.

However, VS Code sources .zshrc so this should not be a problem.

MKuranowski commented 7 months ago

Launching VS Code from terminal (with changed PATH) makes the extension work.

This should mean that the extension does not properly inherit/query VS Code environment.