Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-27760

clangd can't find includes if clang is build with nonstandard CLANG_RESOURCE_DIR

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: Qt Creator 8.0.0-beta1
    • Fix Version/s: Qt Creator 8.0.0-rc1
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      Operating System: Gentoo Linux 2.8
      Qt Version: 5.15.5
      Kernel Version: 5.18.5-gentoo (64-bit)
    • Commits:
      88956d1e9b (qt-creator/qt-creator/8.0) 88956d1e9b (qt-creator/tqtc-qt-creator/8.0)

      Description

      In Gentoo, the clang buildĀ passes -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}" and installs clang's system headers to /usr/lib/llvm/14/bin/../../../../lib/clang/${clang_version}/include/ (i.e., /usr/lib/clang/${clang_version}/include/). But ClangdClient::ClangdClient calls clangdIncludePath which seems to implicitly assume that the headers are where they would otherwise be if CLANG_RESOURCE_DIR defaulted to "". Presumably, this appears to be why the correct header path doesn't show up in the "Header Paths" section of the "C++ Code Model Inspector" and is not being found by clangd.

      Shouldn't clang -print-resource-dir be employed to help find the correct include path at runtime?

        Attachments

        For Gerrit Dashboard: QTCREATORBUG-27760
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            kandeler Christian Kandeler
            Reporter:
            hodorgasm Peter Levine
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes