[build2] Optional parameter for build scripts

Boris Kolpackov boris at codesynthesis.com
Tue Dec 12 06:12:21 UTC 2017


Moldmann Max (DC-MH/ENG52-NA) <Max.Moldmann at boschrexroth-us.com> writes:

> What do you think about adding an optional parameter that modifies
> the Exit code behavior, so that in case of "dir is up to date" build2
> ends with a special Exit code. This way scripts that call build2 could
> know whether post-build-processing is necessary or not.

I see the need but using exit status for this feels wrong: target up to
date is a "success" result but we will be returning a status indicating
failure.

How about we instead print the target state to STDOUT? More specifically,
if you specify --print-target-state option then instead of printing to
STDERR user-friendly messages like "dir{./} is already up to date",
build2 will print to STDOUT structured state in the form:

<state> <meta-operation> <operation> <target>

For example:

unchanged perform update dir{./}

Will this work for you?



More information about the users mailing list