Boost logo

Boost-Build :

Subject: [Boost-build] question(s) about bjam code III
From: Stefan Seefeld (stefan_at_[hidden])
Date: 2017-10-25 14:08:34


Hi Steven,

my next question concerns bjam's execution of functions. The usual data
flow consists of actions to be compiled into (sets of) commands, which
are then executed to update a target.

Baseline bjam has some mechanism grafted into it to run Python
functions, which are run at the place where "normally" commands are
compiled from actions
(https://github.com/boostorg/build/blob/develop/src/engine/make1.c#L470
calls
https://github.com/boostorg/build/blob/develop/src/engine/function.c#L3830
which may invoke
https://github.com/boostorg/build/blob/develop/src/engine/function.c#L5233).

I have been (ab-)using this mechanism in faber to allow Python functions
to be executed instead of system commands. While this has worked very
well, I now wonder how to handle errors. How does
`function_run_actions()` communicate errors back to the caller ? The
only callsite I can see is in the `cmd_new()` function, and I don't see
anything akin to handling errors that the called functions (which in
bjam are typically jam functions, I gather) may encounter.

While I can certainly set up some global variables to capture error
states, I'd rather use existing channels to communicate status and error
states back to the call site.

Thanks,

Stefan

-- 
      ...ich hab' noch einen Koffer in Berlin...
    



signature.png

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk