Boost logo

Boost-Build :

Subject: Re: [Boost-build] [python-port] how to port boost.jam?
From: Vladimir Prus (ghost_at_[hidden])
Date: 2011-11-24 15:46:26


On 24/11/11 22:43, Juraj Ivančić wrote:
> Hi all.
>
> The next thing on my personal wish list for python port is getting boost.jam module to work. I am
> unsure how to approach this.
>
> This module is intended for users, and fills users project with a bunch of targets. Should this
> module also be ported to python? Or is there a way to use it in its jam form?
>
> Currently if I try to use it I get an error that boost.py is missing. If porting to Python is the
> way - it is not apparent to me how to do it. More concretely - how do I do this:
>
>
> rule boost_std ( inc ? lib ? )
> {
> project boost
> : usage-requirements <include>$(inc) <define>BOOST_ALL_NO_LIB
> : requirements <tag>@tag_std <search>$(lib)
> ;
>
> alias headers ;
> lib date_time : : : :
> <link>shared:<define>BOOST_DATE_TIME_DYN_LINK ;
>
> ....
> }
>
> so that /boost//date_time is visible in my project after importing boost?

Hi Juraj,

arguments can be made both ways, but I feel that we should not keep any substantial functionality
as Jam code. After all, the point of Python port is to make codebase more maintainable and big
module in Jam will be contrary to that goal.

Making that code work in Python requires knowing how functions like 'project' or 'lib' work
in Python port. The project.py:ProjectRules class (which is a singleton) keeps track of all
functions that must be available in Jamfile. Most of its member functions are imported automatically
(including 'project') and it also keeps a list of additional functions.

So, I think it will be sufficient to (i) call ProjectRules.project with appropriate parameters,
and (ii) do roughly what ProjectRules.add_rule_for_type.xpto does (for definining 'lib' target)

I am somewhat scared about the use of project.initialize in boost.jam -- I don't think anybody
ever tried to do this in Python, but fundamentally, it should work.

> I'd appreciate any help as this is (I hope) the only thing stopping me from never using bjam without
> --python switch :)

That would be awesome; importantly, it will give us an idea of how fast Python port is in practice
and a direction for improving its performance.

- Volodya


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