Boost logo

Boost-Build :

Subject: Re: [Boost-build] prototyping alternative Boost.Build syntax
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2016-10-28 13:14:06


AMDG

On 10/28/2016 10:44 AM, Stefan Seefeld wrote:
> On 28.10.2016 12:21, Steven Watanabe wrote:
>> AMDG
>>
>> On 10/28/2016 09:31 AM, Stefan Seefeld wrote:
>>> On 28.10.2016 11:10, Vladimir Prus wrote:
>>>>
>>>> Therefore b2:
>>>>
>>>> - Starts Python code
>>>> - Provides a very small interface to declare low-level targets and
>>>> actions
>>>> - Does know know anything else about what Python code does.
>>> Cool ! So what I'm after is that "small interface to declare low-level
>>> targets and actions". Is that defined / documented somewhere ? What is
>>> the code I need to read to understand that ?
>>>
>> A target is just represented as a string in Jam and
>> Python. The internal structures used by the back end
>> are created on demand.
>
> That doesn't help me much. If I want to define a new target I surely
> need to invoke some `bjam` function (from the bjam module Vladimir just
> mentioned) to declare that.
>

  You don't need to specifically create a target.
If you use a string as an argument to an action
or set target variables on it or pass it to DEPENDS
or anything else that requires a target, then
it will just work.

>> The code for handling actions in Python, is in two places.
>> In kernel/bootstrap.jam, there are a few Jam rules that are
>> designed to be called from python, in particular,
>> set-update-action(action, targets, sources, properties).
>> There's also a bjam.define_action(name, body, bindlist, flags)
>> implemented in builtins.c.
>
> What is the Python interface for that ?
>

  bjam.define_action is directly visible
from Python. After a bit more poking
around, it looks like the interface that
you want is the Engine class in build/engine.py

In Christ,
Steven Watanabe


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