Boost logo

Boost-Build :

Subject: [Boost-build] Python Port toolset.flags()
From: Boman, Aaron (Aaron.Boman_at_[hidden])
Date: 2014-10-13 17:52:17


toolset.flags() is not working correctly within the Python Port.

-----

Assume for the moment that arm.py exists and is able to be used using the `using` rule.

Calling toolset.flags('arm', 'CONFIG_COMMAND', ['<toolset>arm', '<toolset-arm:version>1.2'], ['/path/to/armcc.exe']) *does not* set the CONFIG_COMMAND variable on the arm module.

Inside toolset.flags(), there is:
```
caller = bjam.caller()
if not '.' in rule_or_module and caller and caller[:-1].startswith("Jamfile"):
        # Unqualified rule name, used inside Jamfile. Most likely used with
        # 'make' or 'notfile' rules. This prevents setting flags on the entire
        # Jamfile module (this will be considered as rule), but who cares?
        # Probably, 'flags' rule should be split into 'flags' and
        # 'flags-on-module'.
        rule_or_module = qualify_jam_action(rule_or_module, caller)
```

`caller` is always going to contain some "Jamfile" and toolset module names (such as 'arm' in this case) are never going to contain a '.', so qualify_jam_action() is always going to be called and the toolset module name is going to be mangled. In this case, `rule_or_module` becomes "Jamfile<path/to/my/Jamroot>%arm"

Later on when actualizing the targets, in toolset.__set_target_variables_aux(), __flags.get('arm', []) is always going to return the default list since 'arm' doesn't exist in __flags and "Jamfile<path/to/my/Jamroot>%arm" does. Therefore, arm's module variables are never going to be set.

Running the same thing using Jam, in toolset.flags, caller would be the calling module, (in this case, "arm") and would not be prefixed with "Jamfile<" so rule-or-module is not altered. As a result, all module variables are set.

-----

I don't understand the purpose of this check, so I don't know how to correct this problem. bjam.caller() acts independent of the Python stack so I'm not entirely sure if it's possible to implement something similar.

Any ideas on how to approach solving this problem would be greatly appreciated.

Thanks,
Aaron

________________________________

CONFIDENTIALITY NOTICE: This email and any attachments are for the sole use of the intended recipient(s) and contain information that may be confidential and/or legally privileged. If you have received this email in error, please notify the sender by reply email and delete the message. Any disclosure, copying, distribution or use of this communication (including attachments) by someone other than the intended recipient is prohibited. Thank you.


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