-
Notifications
You must be signed in to change notification settings - Fork 379
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
CodeChecker not parsing correctly windows escaped paths in compile_commands.json #4277
Comments
also, I found these similar reports: |
I've validated the STR. I see no reason why one would not see the exact same error. |
N.b.: CodeChecker isn't officially supported on Windows, we don't have Windows users and Windows-based development infrastructure to develop or test. Is the tool/project using CodeChecker's logging mechanism to create the (faulty) build log, or is this the compilation database emitted by CMake? (If the former, what happens if you try to analyse using a CMake-provided compilation database?) |
The tool (ecosystem) is zephyr, which uses CMake. My zephyr project has it's own CMakeLists (that I own) , but also a zephyr layer of CMake configuration exists (somewhere) that must instruct CMake to output the compilation database (as i'm not required to stipulate such configuration). I don't believe Zephyr would create the db it's self (but I am not a zephyr developer). I did not pick up any cues that Windows was not officially supported, but are you saying unofficially it should work? It seems like Zephyr did not identify this either, as Zephyr is cross platform and makes no mention of CodeChecker being a non-windows option. Moving forward, I guess you are suggesting that you won't be adding support for windows paths in the CDB. Obviously it would be more robust if CodeChecker did manage this scenario, as apparently it can happen. |
The compilation database emitted from zephyr is CMake vanilla: # CodeChecker uses the compile_commands.json as input
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
All I am saying is that we do not have the necessary environment for developing on Windows, i.e., even if we did develop something, we would not be able to test it meaningfully. There might be kidney shots down the line with socket handling or environment-related stuff. But it also might not be a tremendous effort, but we don't know just yet. Likely it can be done easily for the paths part, because
But then why is CMake creating two different styles of path handling (POSIX-y @UmbraMalison Could you please post a full compilation database entry (one full |
@whisperity apologies for my delay. but i have more news. I see this in every CDB i've looked at (on my work laptop). So here is non-zephyr example, this is a CMake based STM32 project:
what is common between this occurance and the previous:
what is different:
|
by replacing the windows escaped paths for unix style, i was able to analyse the files.
Just FYI, even your own CDB has mixed paths in it. 🤷 |
@whisperity any further thoughts on your side? Could this make it's way into the backlog? (to support windows paths?) |
Unfortunately, that is not my decision to make. Although I do have a Windows computer currently (and unfortunately...), it is not a development-capable machine, i.e., I don't have admin rights, can't install Python, etc. I am only using it because they force it on me, but once Windows has booted, I immediately fullscreen a Linux VM. 🤣 I'll try to figure something out, perhaps we can request development machines with Windows, but it will require some forethought. Or someone from the team who does have installer rights on their Windows computers could do it. It won't be done in 6.24.1, as far as I can tell, we have a lot more critical bugs to fix (unfortunately from internal users who do not report on GitHub |
The Zephyr environment is quite big and a bit time-consuming to setup. If you have a lighter and faster example you should edit the issue description and switch to it (as long as everything can still be downloaded for free and from reputable places).
The CMD.EXE exception aside, forward slashes have been working on Windows since practically forever. If you don't care about CMD.EXE, the fastest and quickest way to victory is: forward slashes everywhere. |
I found the issue in |
Describe the bug
Rightly or wrongly, the compile_commands.json file is being created with both unix forward slash, and escaped windows backward slash.
if you tell me that the bug is further upchain so to speak, because the database should be consistent in this regard then I would need to unwrap Zephyr RTOS and CMake. To start my investigation, this seems like the logical place.
This is an extract from the database as created by Zephyr RTOS/CMake:
as you can see the directory is in unix format, but the command is in windows format, with the assumption of one layer of escaping.
It is only the directory that is in unix format, the rest of the contents is formatted like the command shown above. (i'm missing the rest because in poking around I have now broken my build env, but want to shoot this report off ASAP as it's a fundamental blocker for me right now).
I'm developing on windows with a mix of windows native tools and mingw tools. (Could that be a factor?)
My build logs (for the codechecker stage, the main build is successful)
CodeChecker version
To Reproduce
Steps to reproduce the behaviour:
(On Windows)
Expected behaviour
I expected it to parse the path to GCC correctly.
Desktop (please complete the following information)
Additional context
Mix of tooling. CMake was installed via Winget, make is coming from msys2, as is ninja.
This isn't as per the STR, which uses chocolatey, i'm in the process of verifying that aspect of the setup.
The text was updated successfully, but these errors were encountered: