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

Module is evaluated in wrong context

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 1.16.0
    • 1.13.1
    • Dependency Tracking
    • None
    • 8ff1dd0044a32b6658cf05a923946d75baf33a66 (qbs/qbs/master)

    Description

      Consider the following project:

      Project {
          qbsSearchPaths: [ path ]
          CppApplication {
              name: "myapp"
              Depends { name: "mylib" }
          }
      
          StaticLibrary {
              name: "mylib"
              Depends { name: "mymodule" }
              Export {
                  Depends { name: "mymodule" }
              }
          }
      }
      

      And the following module:

      Module {
          Depends { name: "cpp" }
          cpp.optimization: {
              console.warn("I am evaluated in " + product.name)
          }
      }
      

      The resolver outputs:

      I am evaluated in mylib
      I am evaluated in mylib
      I am evaluated in __shadow__mylib
      

      I would expect the exported instance of mylib to be evaluated in the scope of myapp. I am not sure whether this is actually a bug, but it looks like one.

      Please find the testcase attached.

      Attachments

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

        Activity

          People

            rweickelt Richard Weickelt
            rweickelt Richard Weickelt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes