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

jom only expands wildcards in dependencies with relative paths

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • Qt Creator 7.0.2
    • Jom
    • None
    • 4635d90158 (qt-labs/jom/master)

    Description

      This works in nmake but not in jom:

      test: C:\some\path\*.txt
        echo "$**"
      
      # Shows empty quotes "" in jom. Doesn't depend on any of those targets either.
      

      These work fine:

      test: .\some\path\*.txt
        echo "$**"
      
      test: C:\some\path\ExactFilename.txt
        echo "$**"
      

      The problem is in src/jomlib/parser.cpp. expandWildcards() assumes that all paths are relative and appends current dir to the left indiscriminately:

      dependents = expandWildcards(m_makefile->dirPath(), dependents);
      
      static QStringList expandWildcards(const QString &dirPath, const QStringList &lst) {
        ...
        QString path = dirPath;
        int idx = str.lastIndexOf(QLatin1Char('/'));
        if (idx != -1) {
          path += QLatin1Char('/') + str.left(idx);
          str.remove(0, idx + 1);
        }
        ....
      }
      

      It should check for isAbsolutePath() or call QDir(dirPath)::makeAbsolute(str.left(idx)).

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            himselfv Vladimir 123
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes