Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-83

Relative paths resolved incorrectly inside Module qbs files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 0.2
    • 0.2
    • None
    • qbs from git 22c8d5b4298762ba6d9890a859259fa08eff7d85, using msvc2010 toolchain

    Description

      For a project setup like this:

      ---./relativepaths.qbp---
          Application {
              ...
              Depends { name: "submod" }
              files: ["relativepaths.cpp"]
          }
      
      ---./submod/submod.qbs---
      import qbs.base 1.0
      
      Module {
          Depends { name: "cpp" }
          cpp.includePaths: [ "../submod" ] // Ie, this directory
      }
      

      The cpp.includePaths added to relativepaths.qbp are resolved incorrectly relative to the .qbp file, rather than relative to submod.qbs which is how I thought it should work if we're to avoid the whole $$PWD mess all over again In other words the "/ID:\workitems\submod" should actually say "/ID:\workitems\qbs-bugs\submod" in order for importantheader.h to be located.

      d:\workitems\qbs-bugs>qbs -f relativePaths.qbp
      Found project file D:\workitems\qbs-bugs\relativePaths.qbp
      ...
      Scanning for file dependencies...
      compiling relativepaths.cpp
      C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe /nologo /c /Zm200 /Zc:wchar_t- /EHsc /Zi /MDd /ID:\workitems\submod /DUNICODE /DWIN32 /FoD:\workitems\qbs-bugs\build\debug\.obj\relativepaths\relativepaths.obj D:\workitems\qbs-bugs\relativepaths.cpp
      D:\workitems\qbs-bugs\relativepaths.cpp(1) : fatal error C1083: Cannot open include file: 'importantheader.h': No such file or directory
      
      ERROR: Process failed with exit code 2.
      ERROR: The following products could not be built: relativepaths.
      Build failed.
      

      Build files are attached.

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            tomsci Tom Sutcliffe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes