Search code examples
buildbuild-automationbjamboost-build

rule to get bjam's callstack or why am I registering 2 identic generators


Is there a rule that returns the current call in bjam ?

I know if you call "bjam.exe -d+10 ..." it will print you the callstack but your own ECHO's not.

What I intend to do is print the callstack in generators.register or any other rules from generators.jam to find out from where does this double-register.

Currently I am registering two identical generators and I have no way of findout out why. And this eventually leads to this:

Error: ambiguity found when searching for best transformation

...

Generators that succeeded:

  • xxx.link

  • xxx.link

...


Solution

  • It can be done using the built-in BACKTRACE rule of bjam. You can also consider using some convenient wrappers around it found in tools/build/v2/kernel/errors.jam if raw BACKTRACE does not give the call stack in a format best appropriate for your case.