Boost logo

Boost-Build :

Subject: [Boost-build] Generator conflicts..
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2017-08-01 14:16:25


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


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