Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-867

Fail to build if Clang headers are in /usr/lib64

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.0
    • 5.11.2
    • Shiboken
    • None
    • 39e551d3d6d18abdf993d1936e7ae9a55584c86f (pyside/pyside-setup/5.12)

    Description

      cd /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2/QtCore && /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_install/py3.7-qt5.12.0-64bit-release/bin/shiboken2 --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore_global.h --include-paths=/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2:/usr/include/qt5/ --typesystem-paths=/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2:/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2:/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2/QtCore --output-directory=/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore --license-file=/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2/QtCore/../licensecomment.txt /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore/typesystem_core.xml --api-version=5.12 --drop-type-entries=
      qt.shiboken: (core) Unknown attribute for 'add-function': 'allow-thread'
      qt.shiboken: (core) Unable to locate Clang's built-in include directory (neither by checking the environment variables LLVM_INSTALL_DIR, CLANG_INSTALL_DIR  nor running llvm-config). This may lead to parse errors.
      (core) clang_parseTranslationUnit2(0x0, cmd[6]=-fPIC -Wno-constant-logical-operand -std=c++14 -I/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2 -I/usr/include/qt5/ /tmp/QtCore_global_gayFJi.hpp)
      /usr/include/c++/cstddef:50:10: fatal error: 'stddef.h' file not found
      (core) Errors in /tmp/QtCore_global_gayFJi.hpp:
      /usr/include/c++/cstddef:50:10: fatal: 'stddef.h' file not found
         /tmp/QtCore_global_gayFJi.hpp:1:10: note: in file included from /tmp/QtCore_global_gayFJi.hpp:1:
         /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore_global.h:41:10: note: in file included from /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore_global.h:41:
         /usr/include/qt5/QtCore/qnamespace.h:43:10: note: in file included from /usr/include/qt5/QtCore/qnamespace.h:43:
         /usr/include/qt5/QtCore/qglobal.h:46:12: note: in file included from /usr/include/qt5/QtCore/qglobal.h:46:
      
      
      (core) Clang: 1 diagnostic messages:
        /usr/include/c++/cstddef:50:10: fatal: 'stddef.h' file not found
         /tmp/QtCore_global_gayFJi.hpp:1:10: note: in file included from /tmp/QtCore_global_gayFJi.hpp:1:
         /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore_global.h:41:10: note: in file included from /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore_global.h:41:
         /usr/include/qt5/QtCore/qnamespace.h:43:10: note: in file included from /usr/include/qt5/QtCore/qnamespace.h:43:
         /usr/include/qt5/QtCore/qglobal.h:46:12: note: in file included from /usr/include/qt5/QtCore/qglobal.h:46:
      
      
      Keeping temporary file: /tmp/QtCore_global_gayFJi.hpp
      shiboken: Error running ApiExtractor.
      Command line: --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore_global.h --include-paths=/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2:/usr/include/qt5/ --typesystem-paths=/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2:/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2:/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2/QtCore --output-directory=/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore --license-file=/builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/sources/pyside2/PySide2/QtCore/../licensecomment.txt /builddir/build/BUILD/pyside-setup-everywhere-src-5.11.2/pyside3_build/py3.7-qt5.12.0-64bit-release/pyside2/PySide2/QtCore/typesystem_core.xml --api-version=5.12 --drop-type-entries=
      

      Looking at the sources, we see:

      static QString findClangBuiltInIncludesDir()
      {
          // Find the include directory of the highest version.
          const QString clangPath = findClang();
          if (!clangPath.isEmpty()) {
              QString candidate;
              QVersionNumber lastVersionNumber(1, 0, 0);
              QDir clangDir(clangPath + QLatin1String("/lib/clang"));
              const QFileInfoList versionDirs =
                  clangDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
              for (const QFileInfo &fi : versionDirs) {
                  const QString fileName = fi.fileName();
                  if (fileName.at(0).isDigit()) {
                      const QVersionNumber versionNumber = QVersionNumber::fromString(fileName.at(0));
                      if (!versionNumber.isNull() && versionNumber > lastVersionNumber) {
                          candidate = fi.absoluteFilePath();
                          lastVersionNumber = versionNumber;
                      }
                  }
              }
              if (!candidate.isEmpty())
                  return candidate + QStringLiteral("/include");
          }
          return QString();
      }
      

      That's never going to find /usr/lib64/clang/7.0.0/include.

      Attachments

        For Gerrit Dashboard: PYSIDE-867
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            thiago Thiago Macieira
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes