-
Notifications
You must be signed in to change notification settings - Fork 464
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
cmake.copyCompileCommands fails if the destination already exists #4207
Labels
bug
a bug in the product
Comments
@k0zmo Thanks for the bug, we're happy to take a contribution if you want to make a PR! |
k0zmo
pushed a commit
to k0zmo/vscode-cmake-tools
that referenced
this issue
Dec 9, 2024
k0zmo
pushed a commit
to k0zmo/vscode-cmake-tools
that referenced
this issue
Dec 9, 2024
k0zmo
added a commit
to k0zmo/vscode-cmake-tools
that referenced
this issue
Dec 9, 2024
Sure. I just made the PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Brief Issue Summary
I set
cmake.copyCompileCommands
to be${workspaceFolder}/build/compile_commands.json
to have the compile_commands.json always inbuild
directory, even if the project/preset uses another subdirectory for build directory (likebuild/${presetName}
). This works fine for such scenarios but fails if the project uses justbuild
directory and compile_commands.json is saved in this directory, originally.vscode-cmake-tools
still tries to make a copy, effectively overwriting the source and ending up with the empty file - leading to an exception parsing this file.The problem stems from how the paths are compared (as strings) and how they are normalized before that. In
vscode-cmake-tools/src/cmakeProject.ts
Line 1544 in 8e257e0
lightNormalizePath
instead ofplatformNormalizePath
which would also normalize the case.this.binaryDir
that depends on${sourceDir}
always have a drive letter in uppercase:vscode-cmake-tools/src/util.ts
Lines 813 to 816 in 8e257e0
${workspaceFolder}
is always lowercase leading to source and destination copy target comparison to failDebug Log
Additional Information
No response
The text was updated successfully, but these errors were encountered: