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

Sanitize cmake.copyCompileCommands #4149

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Bug Fixes:

- Fix our setting of `isUserPreset` for presets, only set it to `true` if it's defined in a user presets file. [#4059](https://github.com/microsoft/vscode-cmake-tools/issues/4059)
- Fix issue where duplicate presets are being listed in dropdown. [#4104](https://github.com/microsoft/vscode-cmake-tools/issues/4104)
- Ensure that we're sanitizing paths for `cmake.copyCompileCommands`. [#3874](https://github.com/microsoft/vscode-cmake-tools/issues/3874)

## 1.19.52

Expand Down
6 changes: 3 additions & 3 deletions src/cmakeProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1541,13 +1541,13 @@ export class CMakeProject {
}
} else {
// single file with known path
const compdbPath = path.join(await this.binaryDir, 'compile_commands.json');
const compdbPath = util.lightNormalizePath(path.join(await this.binaryDir, 'compile_commands.json'));
if (await fs.exists(compdbPath)) {
compdbPaths.push(compdbPath);
if (this.workspaceContext.config.copyCompileCommands) {
// Now try to copy the compdb to the user-requested path
const copyDest = this.workspaceContext.config.copyCompileCommands;
const expandedDest = await expandString(copyDest, opts);
const copyDest = util.lightNormalizePath(this.workspaceContext.config.copyCompileCommands);
const expandedDest = util.lightNormalizePath(await expandString(copyDest, opts));
if (compdbPath !== expandedDest) {
const parentDir = path.dirname(expandedDest);
try {
Expand Down