Boost logo

Boost-Build :

Subject: Re: [Boost-build] Question about calling rules from within a generator
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2019-04-01 21:39:08


AMDG

On 4/1/19 3:11 PM, Tom Brown via Boost-build wrote:
> On 4/1/19 4:44 PM, Steven Watanabe via Boost-build wrote:
>>
>> On 4/1/19 2:31 PM, Thomas Brown via Boost-build wrote:
>>> I was trying to use the assert module to check various assumptions
>>> within my custom generator class when I found it is not possible to
>>> call those rules.  This is also true of other user-defined rules
>>> within the same file as the generator.  Is this expected?
>>>
>>
>>    You need to import them inside the class.
>> Rules from the outer module are not automatically
>> visible within the class.  A class is an independent
>> module that has no semantic relationship to the
>> context in which it is defined.
>
> Thanks for your help!  This worked for `errors` in my example, but not
> for `assert`.

I don't see `errors` anywhere in the code you posted?

>  It looks like `errors` only imports `sequence` within a
> single rule,

How is that relevant?

> while `assert` actually imports `errors` and does a lot of
> funky-looking stuff.  Might `assert` actually not work in this case?
>

You're not using assert correctly in g.jam.
It takes a rule to call, not just a list.

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