Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-66746

Passing -isystem /usr/include to qdoc causes doc build errors on Linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.11
    • Documentation
    • None

    Description

      What did you do? Also known as: Steps to reproduce.

      1. Install libclang from Debian packages (apt install libclang-common-5.0-dev libclang-5.0-dev)
      2. Clone qt5 git repository
      3. export LLVM_INSTALL_DIR=/usr/lib/llvm-5.0
      4. ./configure -developer-build -confirm-license -opensource -no-xcb -nomake examples -nomake tests
      5. make -j12
      6. make prepare_docs
      7. cd qtxmlpatterns
      8. make html_docs &> doc_build.log
      9. grep '(qdoc)' doc_build.log | wc -l

      What did you expect to happen?

      I expected 26 warnings (based on the doc_snapshots warning count).

      What happened instead?

      I had about 330 warnings. Fixing warnings produced new (other) warnings, instead of removing them.

      Further information

      Example build log with broken includes and resulting mess is attached: doc_build.log

      Enable verbose error reporting from clang by setting on line 1438: 

      CXIndex index = clang_createIndex(1, 1);

      -----QTBUG-53367----- describes similar issues, and has two suggested fixes: remove /usr/include from qt5/.qmake.stash or pass QMAKE_CFLAGS_ISYSTEM= as argument to configure. Both did not work, as -isystem /usr/include was still passed to qdoc on invocation, as seen when surrounding the call to the parser at line 1231 in qt5/qttols/src/qdoc/clangcodeparser.cpp with this debugging code:

                     Generator::startDebugging(moduleHeader());
                      qCDebug(lcQdoc) << _FUNCTION_ << "clang_parseTranslationUnit2("
                          << tmpHeader <<  args_ << ") returns" << err;
                      Generator::stopDebugging(moduleHeader());

      The HEINOUS_SYSINC_HACK on line 734 of qttools/src/qdoc/main.cpp and the following for loop ends up inserting -isystem /usr/include. According to the FreeBSD bug tracker, this messes up the include path ordering: 

      Short answer: Don't use -isystem /usr/include.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              paulwicking Paul Wicking
              paulwicking Paul Wicking
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes