-
Notifications
You must be signed in to change notification settings - Fork 2
Design: Workflow
Stefan Seefeld edited this page Dec 2, 2018
·
1 revision
Consider this use-case:
A binary
artefact C
is defined, to generate a binary from source C.cc
. This is dependent on a configure check which may add a macro definition to the feature set.
The fabscript
contains the following instructions:
config = try_compile(source, if_=define('HAS_FEATURE'))
C = binary('C', 'C.cc', features=config.use)
which correspond to the following dependency graph:
Some processing can be done during initialization, i.e. while the fabscript is being processed:
- the
try_compile
step consists of creating an (intermediate) source file as we as a step to (try to) compile it. If that succeeds,HAS_FEATURE
will be defined. - the
C
binary artefact depends on anassembler
step that will determine the individual steps to build it fromC.cc
. (Note that which steps that exactly are isn't known yet, as the choice of available tools may depend on theuse
features contributed from theconfig
step...
Thus, when that stage is complete, the dependency graph is:
As mentioned earlier, the required steps to update C are generated in the process of updating the assembler
step. So here is how the dependency graph looks like once that is completed. (all completed artefacts are green):