Re: [Qbs] Depending on binary from install-root
On 5/7/22 10:33, Jochen Becher wrote: Am Mittwoch, dem 22.09.2021 um 10:45 +0200 schrieb Christian Kandeler: On 9/9/21 1:25 PM, Jochen Becher wrote: thank you for the prompt answer. Adding explicit dependency on "installable" works. But adding the input dependency on application does not: The rule uses inputs: [ "alang"] to depend on the alang source code files. When I add additionally inputsFromDependencies: [ "application" ] it doesn't work. inputs["application"] is always undefined. There's almost surely something wrong in one of your rules/products then. You will probably find out what it is if you try to create a minimal example. Seems like inputs and inputsFromDependencies are mutual exclusive. Definitely not, as that's exactly what e.g. the rule creating applications has, where the inputs are object files and the inputs from dependencies are (import) libraries. Long time ago, but I ran again into this issue and now found out my problem with it: Of course, you are right, the properties inputs and inputsFromDependencies are not mutual exclusive. But: I used variable "input" at one place in my prepare code. With that, the inputs variable contains only the tags from "inputs" and not from "inputsFromDependencies". If I only access "inputs" in prepare code, it contains all tags. Very unexpected behaviour (and I believe undocumented as well). "input" is a convenience variable that should exist if and only if there is exactly one input artifact, in which case it saves you from writing inputs[tag][0]. The set of input artifacts considered for this decision should include all inputs, including inputsFromDependencies. If that's not the case, please file a bug report. Christian ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Depending on binary from install-root
Am Mittwoch, dem 22.09.2021 um 10:45 +0200 schrieb Christian Kandeler: > On 9/9/21 1:25 PM, Jochen Becher wrote: > > thank you for the prompt answer. Adding explicit dependency on > > "installable" works. But adding the input dependency on application > > does not: > > > > The rule uses > > > > inputs: [ "alang"] > > > > to depend on the alang source code files. When I add additionally > > > > inputsFromDependencies: [ "application" ] > > > > it doesn't work. inputs["application"] is always undefined. > > There's almost surely something wrong in one of your rules/products > then. You will probably find out what it is if you try to create a > minimal example. > > > Seems like inputs and inputsFromDependencies are mutual exclusive. > > Definitely not, as that's exactly what e.g. the rule creating > applications has, where the inputs are object files and the inputs > from > dependencies are (import) libraries. Long time ago, but I ran again into this issue and now found out my problem with it: Of course, you are right, the properties inputs and inputsFromDependencies are not mutual exclusive. But: I used variable "input" at one place in my prepare code. With that, the inputs variable contains only the tags from "inputs" and not from "inputsFromDependencies". If I only access "inputs" in prepare code, it contains all tags. Very unexpected behaviour (and I believe undocumented as well). Regards, Jochen > > > Christian > > ___ > Qbs mailing list > Qbs@qt-project.org > https://lists.qt-project.org/listinfo/qbs ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Depending on binary from install-root
On 9/9/21 1:25 PM, Jochen Becher wrote: thank you for the prompt answer. Adding explicit dependency on "installable" works. But adding the input dependency on application does not: The rule uses inputs: [ "alang"] to depend on the alang source code files. When I add additionally inputsFromDependencies: [ "application" ] it doesn't work. inputs["application"] is always undefined. There's almost surely something wrong in one of your rules/products then. You will probably find out what it is if you try to create a minimal example. Seems like inputs and inputsFromDependencies are mutual exclusive. Definitely not, as that's exactly what e.g. the rule creating applications has, where the inputs are object files and the inputs from dependencies are (import) libraries. Christian ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Depending on binary from install-root
Hi Richard, thank you for the prompt answer. Adding explicit dependency on "installable" works. But adding the input dependency on application does not: The rule uses inputs: [ "alang"] to depend on the alang source code files. When I add additionally inputsFromDependencies: [ "application" ] it doesn't work. inputs["application"] is always undefined. If I remove the inputs setting it finds the application but then the transpiler gets no input source code. Seems like inputs and inputsFromDependencies are mutual exclusive. I couldn't find a way to depend on both at the same time. Regards, Jochen Am Mittwoch, dem 08.09.2021 um 23:09 +0200 schrieb Richard Weickelt: > > Any idea how I can force the rule to depend on the binary in > > install- > > root/bin? > > I think it's cleaner to follow > https://code.qt.io/cgit/qbs/qbs.git/tree/examples/code-generator and > use the > transpiler binary in the build directory. That is what your rule > really > depends on (explicitlyDependsOnFromDependencies). > > If you still need to deploy the transpiler first, then try to add > "installable" to your explicitlyDependsOn. All installed files get > that tag > assigned and so your transpiler rule should wait until installation > of all > dependency products has completed. > > Richard > ___ > Qbs mailing list > Qbs@qt-project.org > https://lists.qt-project.org/listinfo/qbs ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Depending on binary from install-root
> Any idea how I can force the rule to depend on the binary in install- > root/bin? I think it's cleaner to follow https://code.qt.io/cgit/qbs/qbs.git/tree/examples/code-generator and use the transpiler binary in the build directory. That is what your rule really depends on (explicitlyDependsOnFromDependencies). If you still need to deploy the transpiler first, then try to add "installable" to your explicitlyDependsOn. All installed files get that tag assigned and so your transpiler rule should wait until installation of all dependency products has completed. Richard ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
[Qbs] Depending on binary from install-root
Hi, I develop a transpiler for some language into C. The qbs project contains products to build the compiler, the runtime and unit tests that are executed with every build. To compile the unit test source code with the new compiler I use the following rule. Unfortunately, when I change something in the compiler, this rule still uses the old binary. Depending on "compiler" seems not be enough to wait for the finalization of the link process and deployment of the compiler. Any idea how I can force the rule to depend on the binary in install- root/bin? Regards, Jochen -- snip here FileTagger { patterns: "*.a" fileTags: [ "alang" ] } Rule { inputs: [ "alang" ] explicitlyDependsOnFromDependencies: [ "compiler", "runtime" ] Artifact { filePath: input.fileName + ".c" fileTags: [ "c" ] } prepare: { var cmd = new Command() cmd.description = "compiling " + input.fileName cmd.highlight = "codegen" cmd.program = project.buildDirectory + "/install- root/bin/compiler" cmd.arguments = [ "-o", output.filePath, input.filePath ] return [ cmd ] } } ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs