Generator conflicts..

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

Generator conflicts..

Boost - Build mailing list
Here I was trying to add a common tool for asciidoctor, which can generate html and docbook at least, and ran into something I thought was resolved long ago.. Multiple generators conflicting when there are multiple transformations possible, of different lengths. Here's the quick repro jamroot.jam:

===
import type ;
import generators ;

type.register AAA : aaa ;
type.register BBB : bbb ;
type.register CCC : ccc ;

generators.register-standard $(__name__).aaa2ccc : AAA : CCC ;
generators.register-standard $(__name__).bbb2ccc : BBB : CCC ;
generators.register-standard $(__name__).aaa2bbb : AAA : BBB ;

actions aaa2ccc { aaa2ccc $(<) $(>) }
actions bbb2ccc { bbb2ccc $(<) $(>) }
actions aaa2bbb { aaa2bbb $(<) $(>) }

ccc test : test.aaa ;
===

With an empty test.aaa and running it as is one gets:

===
$ b2 -a -n
Error: ambiguity found when searching for best transformation
Trying to produce type 'CCC' from: 
 -  { test.aaa.AAA }
Generators that succeeded:
 -  Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.aaa2ccc
 -  Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.bbb2ccc
First generator produced: 
 -  { Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>%Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.aaa2ccc-test.ccc.CCC { test.aaa.AAA } }
Second generator produced: 
 -  { Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>%Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.bbb2ccc-test.ccc.CCC { Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>%Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.aaa2bbb-test.bbb.BBB { test.aaa.AAA } } }
===

Which is as might be expected. Except I though we had rigged the generator selection to pick the shortest such transformation. Am I wrong on that? If I am is there some way to adjust the generators to get around the issue? Note, this problem is going come up more and more as we add different tools that can generate common formats. 


--
-- 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
|  
Report Content as Inappropriate

Generator conflicts..

Boost - Build mailing list
Here I was trying to add a common tool for asciidoctor, which can generate html and docbook at least, and ran into something I thought was resolved long ago.. Multiple generators conflicting when there are multiple transformations possible, of different lengths. Here's the quick repro jamroot.jam:

===
import type ;
import generators ;

type.register AAA : aaa ;
type.register BBB : bbb ;
type.register CCC : ccc ;

generators.register-standard $(__name__).aaa2ccc : AAA : CCC ;
generators.register-standard $(__name__).bbb2ccc : BBB : CCC ;
generators.register-standard $(__name__).aaa2bbb : AAA : BBB ;

actions aaa2ccc { aaa2ccc $(<) $(>) }
actions bbb2ccc { bbb2ccc $(<) $(>) }
actions aaa2bbb { aaa2bbb $(<) $(>) }

ccc test : test.aaa ;
===

With an empty test.aaa and running it as is one gets:

===
$ b2 -a -n
Error: ambiguity found when searching for best transformation
Trying to produce type 'CCC' from: 
 -  { test.aaa.AAA }
Generators that succeeded:
 -  Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.aaa2ccc
 -  Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.bbb2ccc
First generator produced: 
 -  { Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>%Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.aaa2ccc-test.ccc.CCC { test.aaa.AAA } }
Second generator produced: 
 -  { Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>%Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.bbb2ccc-test.ccc.CCC { Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>%Jamfile</Users/grafik/devroots/Boost/build/example/generator-conflict>.aaa2bbb-test.bbb.BBB { test.aaa.AAA } } }
===

Which is as might be expected. Except I though we had rigged the generator selection to pick the shortest such transformation. Am I wrong on that? If I am is there some way to adjust the generators to get around the issue? Note, this problem is going come up more and more as we add different tools that can generate common formats. 


--
-- 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
|  
Report Content as Inappropriate

Re: Generator conflicts..

Boost - Build mailing list
Sorry about that duplicate.. Gmail tricked me.

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

Re: Generator conflicts..

Boost - Build mailing list
In reply to this post by Boost - Build mailing list
AMDG

On 08/01/2017 08:18 AM, Rene Rivera via Boost-build wrote:

> Here I was trying to add a common tool for asciidoctor, which can generate
> html and docbook at least, and ran into something I thought was resolved
> long ago.. Multiple generators conflicting when there are multiple
> transformations possible, of different lengths. Here's the quick repro
> jamroot.jam:
>
> ===
> <snip>
> ===
>
> With an empty test.aaa and running it as is one gets:
>
> ===
> $ b2 -a -n
> Error: ambiguity found when searching for best transformation
> <snip>
> ===
>
> Which is as might be expected. Except I though we had rigged the generator
> selection to pick the shortest such transformation. Am I wrong on that?

I don't remember any such rule.

> If
> I am is there some way to adjust the generators to get around the issue?

Isn't the usual solution to use generators.override?

> Note, this problem is going come up more and more as we add different tools
> that can generate common formats.
>

In Christ,
Steven Watanabe

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