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

fix(#111): resolve windows executable paths #126

Merged
merged 1 commit into from
Jan 11, 2024
Merged

fix(#111): resolve windows executable paths #126

merged 1 commit into from
Jan 11, 2024

Conversation

barrett-ruth
Copy link
Contributor

resolves #111 - uv.spawn() fails to detect programs as executable on windows. Use exepath() to resolve paths before spawn.

@barrett-ruth
Copy link
Contributor Author

@UnderCooled check this out and make sure it works - thanks.

@UnderCooled
Copy link

@barrett-ruth It works, hope this won't cause problems on other OSes.

@xiaoshihou514
Copy link
Collaborator

Seems fine on my linux machine 👍

@barrett-ruth barrett-ruth merged commit 80f0994 into nvimdev:main Jan 11, 2024
@barrett-ruth barrett-ruth deleted the windows-exepath branch January 11, 2024 12:42
@UnderCooled
Copy link

UnderCooled commented Jan 12, 2024

Sorry, this fix does cause a problem...

If you have two linters, when the second one runs, it raises E5560: Vimscript function must not be called in a lua loop callback.

lint.lines = prev_lines
local data = spawn(lint)

      lint.cmd = vim.fn.exepath(lint.cmd)
      local data = spawn(lint)

After I add exepath there, no more E5560, but the second linter won't show diag messages. I've checked that with either one only, it worked.

@xiaoshihou514
Copy link
Collaborator

Maybe schedule it...? Would take a deeper look this weekend.

@barrett-ruth
Copy link
Contributor Author

@UnderCooled can you try his suggested approach. Also, if you could draft up a PR that would be great - I personally dont't have a windows device to test any changes on.

@xiaoshihou514
Copy link
Collaborator

xiaoshihou514 commented Jan 12, 2024

Yes, a pr would be great. Doesn't own a windows machine either :(
Also some tests for linters would be great 🤔 Just a thought

@UnderCooled
Copy link

The second linter not running is another issue, this Windows ".cmd" fix (exepath) could be moved to do_lint before uv.spawn call. I don't know how to write an unit test for this vim standard function, its behavior should be tested in Vim/Neovim already.

Maybe I should open another issue about the second linter? Will that be related to issue #113?

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

Successfully merging this pull request may close these issues.

Failed to spawn .cmd executables on windows
3 participants