Skip to content

fix(Makefile): use correct git shell path and add semicolons #1346

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

xudyang1
Copy link
Contributor

Problem:

PR #1343 did not use the correct git shell path as the space is not escaped.

Solution:

  1. Adding a backslash to escape the space does not fix the issue as SHELL still expands to sh.exe even after assignment. Instead of directly copying $(WIN_GIT_SHELL), use $(wildcard $(WIN_GIT_SHELL)) returned from the Makefile function to overwrite SHELL.

  2. Similar to PR feat(Makefile): enable auto detect compiler #1282 on $(shell %COMMAND%), semicolons are added after each command to make sure make can call CreateProcess correctly:

  • Without semicolon: calls CreateProcess(NULL,%COMMAND%,...)
  • With semicolon: calls CreateProcess(NULL,$(SHELL) $(.SHELLFLAGS) "%COMMAND%;",...)

@L3MON4D3
Copy link
Owner

Hi!
Would you add a comment which explains why (or mentions that) the CreateProcess fails with multiple lines? It might be forgotten when creating new build steps.

xudyang1 added 3 commits May 28, 2025 23:51
- Problem:

PR L3MON4D3#1343 did not use the correct git shell path as the space is not
escaped.

- Solution:

1. Adding a backslash to escape the space does not fix the issue as `SHELL`
still expands to `sh.exe` even after assignment. Instead of directly
copying `$(WIN_GIT_SHELL)`, use `$(wildcard $(WIN_GIT_SHELL))` returned
from the Makefile function to overwrite `SHELL`.

2. Similar to fixes on `$(shell %COMMAND%)`, semicolons are added after
each command to make sure `make` can call `CreateProcess` correctly:

- Without semicolon: calls `CreateProcess(NULL,%COMMAND%,...)`
- With semicolon: calls `CreateProcess(NULL,$(SHELL) $(.SHELLFLAGS)
  "%COMMAND%;",...)`
@xudyang1
Copy link
Contributor Author

@L3MON4D3 I would like to postpone merging this PR to master. Just need more time to fix the :checkhealth luasnip bug (#1341). Thank you for your consideration.

@L3MON4D3
Copy link
Owner

L3MON4D3 commented Jun 2, 2025

Of course :)

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.

2 participants