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

Remove MinGW paths only when using a MinGW kit #3138

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## 1.15

Bug Fixes:
- When `cmake.buildTasks` is `true`, CMake tasks in `tasks.json` that do not specify `targets` will no longer cause the build to fail. [#3123] (https://github.com/microsoft/vscode-cmake-tools/issues/3123)
- When `cmake.buildTasks` is `true`, CMake tasks in `tasks.json` that do not specify `targets` will no longer cause the build to fail. [#3123](https://github.com/microsoft/vscode-cmake-tools/issues/3123)
- Paths containing `mingw` are no longer removed from the `PATH` environment variable when configuring a project without specifying a kit. [#3136](https://github.com/microsoft/vscode-cmake-tools/issues/3136)

## 1.14.30
Bug Fixes:
Expand Down
10 changes: 6 additions & 4 deletions src/kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -989,10 +989,12 @@ export async function effectiveKitEnvironment(kit: Kit, opts?: expand.ExpansionO
path_list.push(mingwPath);
}
if (env.hasOwnProperty('PATH')) {
// Remove other mingw from PATH as it will cause conflict
const current_path_list = (env['PATH']?.split(';') ?? []);
const current_path_list_without_mingw = current_path_list.filter(p => !isMingw(p));
path_list.unshift(current_path_list_without_mingw.join(';'));
let current_path_list = (env['PATH']?.split(';') ?? []);
if (mingwPath) {
// Remove other mingw from PATH as it will cause conflict
current_path_list = current_path_list.filter(p => !isMingw(p));
}
path_list.unshift(current_path_list.join(';'));
env['PATH'] = path_list.join(';');
}
}
Expand Down