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

Set up (read-only) kits for Profile items in Qbs Projects

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 4.12.0
    • None

    Description

      Qbs projects may contain Profile items at the top level. In such a case it is very unlikely that a user wants to build the project with one of Qt Creator's kits. Since profiles are equivalent to kits in Qt Creator, it would be nice if QtCreator would setup one read-only kit per enabled Profile item. This could be limited to Profile items in the top-level project.

      I guess that Qbs would need 2 resolve passes in that case: One for determining available profiles and one for resolving the project using a selected kit/profile.

      Such a solution would be a huge efficiency boost for teams that use a package manager like Conan for dependency management. Especially in embedded/automotive it is very important that all team members work with the exact same toolchain version. Thus, requiring team members to update their toolchains manually and registering them in their IDE is an inconvenient and error-prone process.

      The gain of this solution would be:

      • no more manual toolchain/kit setup required in Qt Creator. It would be implicitly done implicitly when opening the project
      • efficiently leveraging dependency managent tools like Conan and what not

      An example project could look like this:

      import qbs.Probes
      
      Project {
          Probes.ConanfileProbe {
              id: conan
              conanfilePath: project.sourceDirectory + "/conanfile.py"
          }
          Profile {
              name: "arm-gcc"
      
              // Might be used if multiple profiles exist and the user wants to avoid
              // resolving ConanfileProbes for other profiles. This assumes that
              // only one profile is active per project.
              condition: project.profile === "arm-gcc" 
      
              cpp.toolchainInstallPath: conan.dependencies["arm-none-eabi-gcc"].rootpath + "/bin"
              cpp.toolchainPrefix: "arm-linux-gnueabi-"
              qbs.toolchainType: "gcc"
              // More properties might be required by Qt creator, like 
              // cpp.cxxCompilerName.
              // As a first step we could require that all necessary parameters
              // have to appear here. Later, we could set up a fake product 
              // context and try to load all modules appearing here so that
              // deduction of some properties could happen in the module.
          }
      }
      

      Since fully resolving the Profile items may involve expensive probes (the Conanfile probe is a very heavy one) and the user may not want to enable all of them, it would be great if Qt Creator could do during project opening:

      • first query the top-level project for available profile names. This step must not execute probes.
      • present the user a page where he can mark which profiles he wants to configure. We might need a description property in the Profile item.
      • resolve the project for all selected profiles and set up a kit for each that is only visible for this particular project. This step will execute probes and may be very expensive because the probes may download dependencies.
      • let the user switch between one of the pre-configured or project-specific kits.

      This feature would even be a true differentiator for the tandem Qbs/Qt Creator because nobody else can do it that easy.

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-23985
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes