LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 33440 - run-clang-tidy should run tidy under the build directory (or fix relative paths)
Summary: run-clang-tidy should run tidy under the build directory (or fix relative paths)
Status: NEW
Alias: None
Product: clang-tools-extra
Classification: Unclassified
Component: clang-tidy (show other bugs)
Version: unspecified
Hardware: PC Linux
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-13 13:12 PDT by Marc-André Lureau
Modified: 2019-10-03 08:12 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments
A fix (2.71 KB, patch)
2017-06-13 13:13 PDT, Marc-André Lureau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Lureau 2017-06-13 13:12:00 PDT
Hi,

I built a compile_commands.json over qemu code base, with help of bear.

When I use run-clang-tidy.py over it, I get several skipping warnings:

Error reading configuration from /home/elmarco/src/qemu/clang/../../hw/xen: directory doesn't exist.
Error reading configuration from /home/elmarco/src/qemu/clang/../../hw: directory doesn't exist.
Skipping /home/elmarco/src/qemu/clang/../../hw/xen/xen_pt_graphics.c. Compile command not found.

The files are not found because the base directory isn't correct.

[
    {
        "arguments": [
...
        ],
        "directory": "/home/elmarco/src/qemu/clang/x86_64-softmmu",
        "file": "../../hw/xen/xen_pt_graphics.c"
    },

(qemu has a recursive make build system for the various targets)
Comment 1 Marc-André Lureau 2017-06-13 13:13:53 PDT
Created attachment 18631 [details]
A fix

See attached patch for a possible solution
Comment 2 Marc-André Lureau 2017-06-13 13:37:43 PDT
please consider also bug 33441 when fixing this, as it may be related.
Comment 3 Alexander Kornienko 2017-06-23 03:52:59 PDT
From a cursory look the patch seems fine. Please send it for review as described in http://llvm.org/docs/Phabricator.html.