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

Incorrect Dependency Link Order from Conan2 QbsDeps Generator Breaks Linking

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • 3.0.1
    • API: JavaScript
    • None
    • All
    • 5a970250d (master)

    Description

      While testing a new Conan2 provider for Qbs, I found that the generated dependency list from the QbsDeps generator produces an incorrect order of libraries for the package sentry-crashpad/0.6.5, which results in linker errors due to unresolved symbols.

      Expected Behavior (Conan1):
      With Conan1 and the original Qbs generator, the correct link order is preserved:

      "libs": [
          "crashpad_handler_lib",
          "crashpad_minidump",
          "crashpad_snapshot",
          "crashpad_client",
          "crashpad_util",
          "mini_chromium",
          "crashpad_compat",
          "crashpad_tools"
      ] 

      Actual Behavior (Conan2 with QbsDeps):
      The new generator in Conan2 outputs the dependencies in a reversed or incorrect order:

      "dependencies": [
          { "name": "crashpad_mini_chromium", "version": "0.6.5" },
          { "name": "crashpad_compat", "version": "0.6.5" },
          { "name": "crashpad_tools", "version": "0.6.5" },
          { "name": "crashpad_util", "version": "0.6.5" },
          { "name": "crashpad_client", "version": "0.6.5" },
          { "name": "crashpad_snapshot", "version": "0.6.5" },
          { "name": "crashpad_minidump", "version": "0.6.5" },
          { "name": "crashpad_handler", "version": "0.6.5" }
      ] 

      This order is reflected directly in the generated Qbs module and results in incorrect linker behavior (e.g., undefined symbols, wrong resolution order).

      Impact:
      Incorrect linking of C++ binaries depending on sentry-crashpad. Could apply to any project where the link order is critical.

      Suggested Fix:
      Preserve the correct dependency resolution and link order as done in Conan1. Ideally, the generator should traverse the dependency graph respecting the link order required for correct symbol resolution. Practically, the conan provider can add dependencies in reverse order. 

      Attachments

        For Gerrit Dashboard: QBS-1848
        # Subject Branch Project Status CR V

        Activity

          People

            kandeler Christian Kandeler
            dismine Roman Telezhynskyi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes