[Qbs] Module Dependencies

Christian Kandeler christian.kandeler at qt.io
Fri Jun 16 10:46:25 CEST 2017


On Fri, 16 Jun 2017 09:14:30 +0200
Christian Gudrian <christian.gudrian at aucos.de> wrote:

> We're using a Module to define a code generation rule. This module 
> however depends on a code generation tool which itself is part of the 
> project.
> 
> With Qbs 1.8.1 we're facing a race condition: Qbs executes the code 
> generation step before the generator has been built. Both the generator 
> product and the code generation module are already dependencies of the 
> products which need code generation.

Versions before 1.8 were building all artifacts of dependencies before any artifacts of the depending product. This was not intended and arguably a bug, because it inhibited parallelization. Now we strictly go by what the rules declare. 

> How can we defer code generation until the generator has been built?

Your code generation rule probably needs to look like this:

Rule {
    // ...
    inputsFromDependencies: ["application"]
    // ...
}

Note that you can then refer to the generator executable via inputs.application[0].filePath, rather than hardocding the location, as you are presumably doing now.


Christian



More information about the Qbs mailing list