Fix make.exe path handling with Cygwin/MSYS bash terminal #772
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Build commands fail when Cygwin/MSYS bash is configured as the default terminal because Windows paths (
C:\cygwin64\bin\make.exe) are passed directly to bash, which doesn't understand backslash-separated paths.Changes
src/util.ts: Add path conversion utilities
isWindowsTerminalUsingCygwinOrMsysBash()- Detects Cygwin/MSYS bash from terminal profile settingswindowsPathToPosix()- Converts Windows paths to POSIX formatsrc/make.ts: Update
doBuildTarget()to convert paths when using Cygwin/MSYS bash-fmakefile path)src/test/fakeSuite/extension.test.ts: Add unit tests for
windowsPathToPosix()Example
Before:
After (paths converted automatically):
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
0psvsblobprodwus2145.vsblob.vsassets.io/usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/yarn install(dns block)40vvsblobprodwus2135.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)8wdvsblobprodwus2137.vsblob.vsassets.io/usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/npm install(dns block)b15vsblobprodwus2164.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)b53vsblobprodwus2154.vsblob.vsassets.io/usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/yarn install(dns block)dyrvsblobprodwus2173.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)g3xvsblobprodwus2151.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)isovsblobprodwus211.vsblob.vsassets.io/usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/yarn install(dns block)k4pvsblobprodwus2140.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)lusvsblobprodwus2166.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)ox9vsblobprodwus2149.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)pkwvsblobprodwus2126.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)tn2vsblobprodwus2124.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)v41vsblobprodwus2175.vsblob.vsassets.io/usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/yarn install(dns block)vd2vsblobprodwus2150.vsblob.vsassets.io/usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/yarn install(dns block)vipvsblobprodwus2139.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)vjmvsblobprodwus2182.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)vm9vsblobprodwus2190.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)wlnvsblobprodwus2188.vsblob.vsassets.io/usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/npm install(dns block)wztvsblobprodwus2155.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)xofvsblobprodwus2114.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)y1rvsblobprodwus2136.vsblob.vsassets.io/usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/yarn install(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>[Bug]
make.exepath with Cygwin</issue_title><issue_description>### Brief Issue Summary
This issue is closely related to #263 (or may be identical). That issue was closed prematurely - there are still problems building with vscode-makefile under Cygwin.
ms-vscode.makefile-tools version: 0.12.17
VSCode version: 1.101.0 (2025-06-11)
Goals: build a C/C++ project under Cygwin using the makefile-tools extension, and have correct choices for the build-configuration option.
Description:
Upon first start of makefile-tools, the default
makePathsetting (make) does not populate thebuild targetschoices. In other words, the onlybuild targetoption isall- there should all options such asdebug,release,install, etc. based on the targets provided in the makefile.If you configure
makePathto point to the Cygwin64 make program (e.g.C:\cygwin64\bin\make.exe), thebuild targetoptions are populated after the 'dry-run' or 'configure' step. However, thebuildbutton then fails to build. The error is:This seems to be an issue caused by selecting Cygwin's Bash as the default terminal:
Attempting to set
makePathto/usr/bin/make(the Linux-like path tomake) yields a similar error:Note the direction of the slashes! Either the extension or VSCode changes
/usr/bin/maketo\usr\bin\make.The relevant
settings.jsonconfig:After setting
makePathwith theC:\\cygwin...version, the build targets will populate and can be selected at will. However, the build will not complete due to the above-mentioned error. ThemakePathsetting must be changed back tomake(no path given) before the build will run successfully. This would be a valid workaround, but thebuild-targetoption resets after VSCode is restarted.It seems that the Cygwin environment/terminal config is not being activated before the
configurestage in the same way it is activated for thebuildstage.Maybe there should be a
settings.jsonoverride forbuildTarget.Debug Log