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

fixing malparsed windows paths #4374

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

fixing malparsed windows paths #4374

wants to merge 1 commit into from

Conversation

tuix
Copy link

@tuix tuix commented Oct 23, 2024

Fixes #4277

@@ -1163,7 +1163,7 @@ def extend_compilation_database_entries(compilation_database):
source_files = []
source_dir = entry['directory']

options = shlex.split(entry['command'])
options = shlex.split(entry['command'], posix=(os.name=='posix'))
Copy link

@marc-h38 marc-h38 Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The posix= parameter is designed to manage nuances between different Unix shells, so it's very mysterious how this helps with Windows and why?!

I realize this is still just a draft, but some... draft comments and a commit message draft would not hurt.

Generally speaking, shlex is NOT meant to help prepare Windows commands ("outputs"). According to its documentation, it's meant as a convenience to help parsing inputs to the program, like a simple configuration file or some parameters.
https://docs.python.org/3/library/shlex.html

Longer example of shlex abuse and Windows compatibility story in zephyrproject-rtos/west@94f8a04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CodeChecker not parsing correctly windows escaped paths in compile_commands.json
2 participants