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

1.14.29/30 removes entries containing "mingw" from PATH on Windows host #3136

Closed
jmacheta opened this issue Apr 25, 2023 · 3 comments · Fixed by #3138
Closed

1.14.29/30 removes entries containing "mingw" from PATH on Windows host #3136

jmacheta opened this issue Apr 25, 2023 · 3 comments · Fixed by #3138
Assignees
Labels
bug a bug in the product Feature: kits
Milestone

Comments

@jmacheta
Copy link

Brief Issue Summary

We are using MinGW-w64 - winlibs toolchain (gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2)
with gcc.exe located at
D:\devel\toolchains\winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2\mingw64\bin
The entry above is added to system PATH.

Since vscode-cmake-tools version 1.14.29 when using "Unspecified" kit, or toolchain file using relative paths (CMAKE_C_COMPILER: gcc, CMAKE_CXX_COMPILER: g++, etc.), we are unable to configure cmake project as the compiler cannot be detected.

Brief debugging (see example below), lead me to the discovery that PATH entries containing "mingw" keyword are missing from cmake's ENV{PATH} when invoked using vscode-cmake-tools extension.

We are still able to configure and build applications from powershell, and VSCode terminal using cmake -B build -G Ninja.

When "scan for kits" is performed, the toolchain is detected correctly. Also when its kit is selected, the entry reappears in ENV{PATH} and we are able to configure and build the project

Minimal reproducible example (on windows host):

  1. add following entries to system Path:
  • C:\mingw
  • C:\test\mingw\suffix
  1. run this CMakeLists.txt

Expected: mingw string found in path on every plugin version.
Observed: mingw string found in path on 1.13.45, and mingw string not found in path on 1.14.29/30

Log from 1.13.45 build: log_1_13_45.txt
Log from 1.14.30 build: log 1_14_30.txt

Thanks!

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.77.3",
  "cmtVersion": "1.14.30",
  "configurations": [
    {
      "folder": "c:\\Users\\jmach\\Desktop",
      "cmakeVersion": "3.25.0",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

Debug Log

No response

Additional Information

No response

@benmcmorran
Copy link
Member

Thanks for the report and great repro steps! I tracked this down to a change in #3056 that strips MinGW paths from PATH even if a MinGW compiler wasn't detected earlier (by selecting a MinGW kit). #3138 should have a fix.

@benmcmorran
Copy link
Member

The fix from #3138 is now publicly available in pre-release channel extension version 1.15.3. Let us know if you're still seeing this issue in the pre-release version.

@jmacheta
Copy link
Author

I can confirm that the issue is now fixed in 1.15.3.
Thanks a lot! 😄

@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug a bug in the product Feature: kits
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants