Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

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 settings
    • windowsPathToPosix() - Converts Windows paths to POSIX format
  • src/make.ts: Update doBuildTarget() to convert paths when using Cygwin/MSYS bash

    • Make command path
    • Working directory
    • Path arguments (e.g., -f makefile path)
  • src/test/fakeSuite/extension.test.ts: Add unit tests for windowsPathToPosix()

Example

Before:

bash: C:\cygwin64\bin\make.exe: command not found

After (paths converted automatically):

/cygdrive/c/cygwin64/bin/make.exe debug -f /cygdrive/c/Users/path/to/Makefile

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
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • 40vvsblobprodwus2135.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • 8wdvsblobprodwus2137.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • b15vsblobprodwus2164.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • b53vsblobprodwus2154.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • dyrvsblobprodwus2173.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • g3xvsblobprodwus2151.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • isovsblobprodwus211.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • k4pvsblobprodwus2140.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • lusvsblobprodwus2166.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • ox9vsblobprodwus2149.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • pkwvsblobprodwus2126.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • tn2vsblobprodwus2124.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • v41vsblobprodwus2175.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • vd2vsblobprodwus2150.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • vipvsblobprodwus2139.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • vjmvsblobprodwus2182.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • vm9vsblobprodwus2190.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • wlnvsblobprodwus2188.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • wztvsblobprodwus2155.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • xofvsblobprodwus2114.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/npm install (dns block)
  • y1rvsblobprodwus2136.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /usr/local/bin/yarn install (dns block)
    • Triggering command: /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.exe path 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 makePath setting (make) does not populate the build targets choices. In other words, the only build target option is all - there should all options such as debug, release, install, etc. based on the targets provided in the makefile.

If you configure makePath to point to the Cygwin64 make program (e.g. C:\cygwin64\bin\make.exe), the build target options are populated after the 'dry-run' or 'configure' step. However, the build button then fails to build. The error is:

*  Executing task: 'C:\cygwin64\bin\make.exe' 'debug' '-f' 'c:\Users\path\to\Makefile' '-j4' 

bash: C:\cygwin64\bin\make.exe: command not found

 *  The terminal process "C:\cygwin64\bin\bash.exe '--login', '-i', '-c', ''C:\cygwin64\bin\make.exe' 'debug' '-f' 'c:\Users\path\to\Makefile' '-j4''" terminated with exit code: 127. 
 *  Terminal will be reused by tasks, press any key to close it. 

This seems to be an issue caused by selecting Cygwin's Bash as the default terminal:

"terminal.integrated.defaultProfile.windows": "Cygwin64",
"terminal.integrated.profiles.windows": {
        "Cygwin64": {
            "path": "C:\\cygwin64\\bin\\bash.exe", 
            "args": [ "--login", "-i" ],
            "env": {"CHERE_INVOKING": "1" },
        }, ... 
}

Attempting to set makePath to /usr/bin/make (the Linux-like path to make) yields a similar error:

*  Executing task: '\usr\bin\make' 'debug' '-f' 'c:\Users\e438179\git\star\Makefile' '-j4' 

bash: \usr\bin\make: command not found

*  The terminal process "C:\cygwin64\bin\bash.exe '--login', '-i', '-c', ''\usr\bin\make' 'debug' '-f' 'c:\Users\path\to\Makefile' '-j4''" terminated with exit code: 127. 
*  Terminal will be reused by tasks, press any key to close it. 

Note the direction of the slashes! Either the extension or VSCode changes /usr/bin/make to \usr\bin\make.

The relevant settings.json config:

"makefile.configurations": [
        {
            "makeArgs": [
                "-j4"
            ],
            "name": "parallel make",
            "makefile.makePath": "/usr/bin/make",  // slashes are reversed 
            // "makePath": "/cygdrive/c/cygwin64/bin/make.exe", // also fails due to slashes
            // "makePath": "C:\\cygwin64\\bin\\make.exe", // works for configure; not build.
            // "makePath": "make" // works for build; not configure
        }

After setting makePath with the C:\\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. The makePath setting must be changed back to make (no path given) before the build will run successfully. This would be a valid workaround, but the build-target option resets after VSCode is restarted.

It seems that the Cygwin environment/terminal config is not being activated before the configure stage in the same way it is activated for the build stage.

Maybe there should be a settings.json override for buildTarget.

Debug Log

targets.log output (excerpt): 

C:\cygwin64\bin\make.exe all -f c:\Users\user\git\star\Makefile -j4 --print-data-base --no-builtin-variables --no-builtin-rules --question
./mkversion.sh: line 21: perl: command not found

make: env: No such file or directory

make: uname: No such file or directory

/bin/sh: line 1: cut: command not found

/bin/sh: line 1: pkg-config: command not found

# GNU Make 4.4.1
# Built for x86_64-pc-cygwin
# Copyright (C) 1988-2023 Free Software Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.

# Make data base, printed on Tue Jun 24 10:40:59 2025

# Variables

# environment
FPS_BROWSER_APP_PROFILE_STRING = Internet Explorer
# environment
SYSTEMDRIVE = C:
# environment
JAVA_HOME = C:\Program Files\Java\jre8\
# environment
LC_ALL = C
# environment
USERPROFILE = C:\Users\user
...
[end targets.log]

dryrun.log output (excerpt): 

C:\cygwin64\bin\make.exe debug -f c:\Users\path\to\project\Makefile -j4 --dry-run --keep-going --print-directory
make: Entering directory '/cygdrive/c/Users/path/to/project'
 
./mkversion.sh: line 21: perl: command not found

....

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes microsoft/vscode-makefile-tools#741

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/vscode-makefile-tools/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 29, 2026 20:19
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix make.exe path configuration issue with Cygwin Fix make.exe path handling with Cygwin/MSYS bash terminal Jan 29, 2026
Copilot AI requested a review from snehara99 January 29, 2026 20:44
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