async rule execution

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

async rule execution

Boost - Build mailing list
Hello,

browsing the bjam sources I ran into

                /* Call the callback, may call back to jam rule land. */
                (*cmdtab[ i ].func)( cmdtab[ i ].closure, rstat, &time_info,
                    cmdtab[ i ].buffer[ OUT ], cmdtab[ i ].buffer[ ERR ],
                    cmdtab[ i ].exit_reason );

(https://github.com/boostorg/build/blob/develop/src/engine/execunix.c#L558-L561)

which suggests it's possible to have a callback call into the b2 layer
(i.e., running some post-processing rule coded in Jam). Is that possible
? The only callback implementation I could find was the `make1c_closure`
which is used to collect status information, but which isn't passed
directly on into Jam, and thus can only be processed synchronously once
the call to `builtin_update_now` has completed.

Am I missing anything ?

Thanks,

        Stefan

--

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

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: async rule execution

Boost - Build mailing list
AMDG

On 05/10/2017 09:17 AM, Stefan Seefeld via Boost-build wrote:

>
> browsing the bjam sources I ran into
>
>                 /* Call the callback, may call back to jam rule land. */
>                 (*cmdtab[ i ].func)( cmdtab[ i ].closure, rstat, &time_info,
>                     cmdtab[ i ].buffer[ OUT ], cmdtab[ i ].buffer[ ERR ],
>                     cmdtab[ i ].exit_reason );
>
> (https://github.com/boostorg/build/blob/develop/src/engine/execunix.c#L558-L561)
>
> which suggests it's possible to have a callback call into the b2 layer
> (i.e., running some post-processing rule coded in Jam). Is that possible
> ? The only callback implementation I could find was the `make1c_closure`
> which is used to collect status information, but which isn't passed
> directly on into Jam, and thus can only be processed synchronously once
> the call to `builtin_update_now` has completed.
>
> Am I missing anything ?
>

http://www.boost.org/build/doc/html/jam/language.html#jam.language.variables.builtins.actionrule

It's called in make1c_closure here:
https://github.com/boostorg/build/blob/develop/src/engine/make1.c#L854

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: async rule execution

Boost - Build mailing list
On Wed, May 10, 2017 at 10:24 AM, Steven Watanabe via Boost-build <[hidden email]> wrote:
AMDG

On 05/10/2017 09:17 AM, Stefan Seefeld via Boost-build wrote:
>
> browsing the bjam sources I ran into
>
>                 /* Call the callback, may call back to jam rule land. */
>                 (*cmdtab[ i ].func)( cmdtab[ i ].closure, rstat, &time_info,
>                     cmdtab[ i ].buffer[ OUT ], cmdtab[ i ].buffer[ ERR ],
>                     cmdtab[ i ].exit_reason );
>
> (https://github.com/boostorg/build/blob/develop/src/engine/execunix.c#L558-L561)
>
> which suggests it's possible to have a callback call into the b2 layer
> (i.e., running some post-processing rule coded in Jam). Is that possible
> ? The only callback implementation I could find was the `make1c_closure`
> which is used to collect status information, but which isn't passed
> directly on into Jam, and thus can only be processed synchronously once
> the call to `builtin_update_now` has completed.
>
> Am I missing anything ?
>

http://www.boost.org/build/doc/html/jam/language.html#jam.language.variables.builtins.actionrule

It's called in make1c_closure here:
https://github.com/boostorg/build/blob/develop/src/engine/make1.c#L854

Of which nothing is async in the above. And further info.. The timing_rule is used in testing.jam <https://github.com/boostorg/build/blob/develop/src/tools/testing.jam#L800>.

--
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net
-- rrivera/acm.org (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: async rule execution

Boost - Build mailing list
Thanks Steven and Rene !

On 10.05.2017 11:29, Rene Rivera via Boost-build wrote:

> On Wed, May 10, 2017 at 10:24 AM, Steven Watanabe via Boost-build
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>
>     http://www.boost.org/build/doc/html/jam/language.html#jam.language.variables.builtins.actionrule
>     <http://www.boost.org/build/doc/html/jam/language.html#jam.language.variables.builtins.actionrule>
>
>     It's called in make1c_closure here:
>     https://github.com/boostorg/build/blob/develop/src/engine/make1.c#L854
>     <https://github.com/boostorg/build/blob/develop/src/engine/make1.c#L854>
>
>
> Of which nothing is async in the above. And further info.. The
> timing_rule is used in testing.jam
> <https://github.com/boostorg/build/blob/develop/src/tools/testing.jam#L800>.

I see. Yeah, this isn't async, but it's all I need. As you know, I'm
working on a Python frontend, where this callback mechanism will be very
useful. (Python's iterator concept provides a very elegant solution to
asynchrony, and I believe I can implement that with the above.)

Best,
        Stefan

--

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

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build