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

ARTIFACT %1 [%2] already has a child artifact %3 as different object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 1.10.0
    • 1.11.0
    • General
    • None
    • 9c1aa4ece11a8481772b340123a232b70d16858d

    Description

      Consider the following:

      import qbs
      import qbs.FileInfo
      import qbs.TextFile
      
      Project {
          Product {
              name: "test"
              multiplexByQbsProperties: ["architectures"]
              destinationDirectory: FileInfo.joinPaths(project.buildDirectory, qbs.architecture)
              Group {
                  files: ["test.h"]
                  qbs.install: true
                  qbs.installDir: "include"
              }
              qbs.installPrefix: qbs.architecture
          }
          Product {
              name: "other"
              type: ["dummy"]
              Depends { name: "test" }
              Rule {
                  multiplex: true
                  inputsFromDependencies: ["installable"]
                  Artifact {
                      filePath: "dummy"
                      fileTags: ["dummy"]
                  }
                  prepare: {
                      var cmd = new JavaScriptCommand();
                      cmd.silent = true;
                      cmd.sourceCode = function() {
                          var tf;
                          try {
                              tf = new TextFile(output.filePath, TextFile.WriteOnly);
                          } finally {
                              if (tf)
                                  tf.close();
                          }
                      }
                      return [cmd];
                  }
              }
              qbs.installPrefix: qbs.architecture
          }
      }

      Build with modules.qbs.architectures:x86,x86_64 and the error from the title appears. Note that I've also gotten this to appear when the 'other' product's multiplexByQbsProperties is ALSO set to "architectures" but I was not able to create a reproducible test case for that.

      It seems that this connect() check in buildgraph.cpp might be broken for multiplexing cases and/or it should be checking the installed artifact path instead of the source.

      Also, this is not exactly a user-facing error. Could it be rephrased or instead made into an assert?

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            jakepetroules Jake Petroules (DO NOT ASSIGN ISSUES)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes