New issue
Advanced search Search tips

Issue 844348 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Clang tool scripts on Windows have unstable parsing.

Project Member Reported by rhalavati@chromium.org, May 18 2018

Issue description

tools/clang/scripts/run_tool.py and tools/clang/pylib/clang/compile_db.py parse compile commands to generate arguments for running clang tools. On Windows, splitting the commands and processing double quotes and escape characters seems to be unstable between python versions.
Please see crrev.com/c/1059108.
 
From crrev.com/c/1059108, the following approaches seem suitable:

- Replacing \ with another character during arg splitting. Has the complexity of needing to make sure r'\ ' and r'\"' are correctly handled... and definitely hacky.
- Trying to use shell=True with subprocess.Popen so we don't need to split
- Reimplementing shlex.split ourselves was another option as well.
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 21 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d050260a870fa65c72a0262b1e954ec90015d2c4

commit d050260a870fa65c72a0262b1e954ec90015d2c4
Author: Ramin Halavati <rhalavati@chromium.org>
Date: Thu Jun 21 07:58:55 2018

Update compile_db.py clang script for Windows.

compile_db.py needs to split commands in non-posix mode on Windows.

Bug: 844348
Change-Id: I5fdcb84fb8ddca7765d5d96b66ee1c54236b9265
Reviewed-on: https://chromium-review.googlesource.com/1107812
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569183}
[modify] https://crrev.com/d050260a870fa65c72a0262b1e954ec90015d2c4/tools/clang/pylib/clang/compile_db.py

Status: Untriaged (was: Available)
Available, but no owner or component? Please find a component, as no one will ever find this without one.

Sign in to add a comment