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

Project explorer plugin cannot autodetect gcc (mingw) on windows due to bug in findCompilerCandidates

    XMLWordPrintable

Details

    • Windows
    • fa071d03cc (qt-creator/qt-creator/7.0) fa071d03cc (qt-creator/qt-creator/master) fa071d03cc (qt-creator/tqtc-qt-creator/7.0) fa071d03cc (qt-creator/tqtc-qt-creator/master) fa071d03cc (qt-creator/tqtc-qt-creator/qds-3.1)

    Description

      findCompilerCandidates modifies nameFilters and assigns result to same variable in a loop for each path in searchPaths

      nameFilters = transform(nameFilters, [](const QString &baseName) {
                  return HostOsInfo::withExecutableSuffix(baseName);
              });
      

      so for nth path namefilters become something like

      ("clang++.exe.exe.exe.exe.exe.exe.exe.exe", "clang++-[1-9]*.exe.exe.exe.exe.exe.exe.exe.exe", "*-clang++.exe.exe.exe.exe.exe.exe.exe.exe", "*-clang++-[1-9]*.exe.exe.exe.exe.exe.exe.exe.exe", "*-*-*-clang++.exe.exe.exe.exe.exe.exe.exe.exe", "*-*-*-clang++-[1-9]*.exe.exe.exe.exe.exe.exe.exe.exe", "*-*-*-*-clang++.exe.exe.exe.exe.exe.exe.exe.exe", "*-*-*-*-clang++-[1-9]*.exe.exe.exe.exe.exe.exe.exe.exe")
      

      as a sesult

      binDir.entryList(nameFilters, QDir::Files | QDir::Executable);
      

      returns empty list instead of detected compiler.
      This bug can be easily fixed by adding temporary variable or by moving transformation out of the loop. Patch in attachement.

      Attachments

        Activity

          People

            kandeler Christian Kandeler
            mugiseyebrows Stanislav Doronin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: