Opened 8 years ago

Last modified 8 years ago

#11224 new Bugs

Pre-processing / Pre-generating MPL-containers stopped working

Reported by: Deniz Bahadir <deniz.bahadir@…> Owned by: Aleksey Gurtovoy
Milestone: To Be Determined Component: mpl
Version: Boost 1.56.0 Severity: Regression
Keywords: Cc:

Description

Background

Boost.MPL allows to pre-process / pre-generate headers for MPL-containers (vector, list, set, map). In particular, headers for containers in variadic and numbered form can be pre-generated. For that, Boost.MPL comes with some python-scripts, located in subdirectory "libs/mpl/preprocessed/" of the Boost-source directory. (As a side-note: Documentation for these python-scripts is missing.)

By default, Boost comes with pre-generated headers for MPL-containers that are able to hold up to 50 elements. Using the mentioned python-files it is possible to generate MPL-containers that can hold even more elements.

Problem

Since release of Boost 1.56.0 the pre-generation of headers for MPL-containers does not work anymore.

Explanation

One of the python-scripts used for pre-generation ("pp.py") requires certain information to be found in the header-comments of input-headers. In particular, it required the field $Id$ in the header-comment to contain the filename (followed by some additional non-whitespace characters), which it no longer does in release 1.56.0 and newer Boost releases.

$Id$ is a Subversion substitution-keyword. (See: [http]://svnbook.red-bean.com/en/1.7/svn-book.html#svn.advanced.props.special.keywords)

I assume, Boost switched from Subversion to Git before releasing Boost 1.56.0. That would explain why the keyword-substition did no longer work.

Solution

To make the python-scripts work again, the best solution would be to also make the keyword-substitution work together with Git. However, as this is neither simple nor recommended (see: [https]://git.wiki.kernel.org/index.php/Git_FAQ#Does_Git_have_keyword_expansion.3F) one should probably add the missing information into the header-comments directly before pre-generation.

The attached python-script "fix_boost_mpl_preprocess.py" is able to do that. The attached python-script "boost_mpl_preprocess.py" can then be used as a comfortable helper-script for pre-generating.

Additional Information

Explanation for both scripts on Stackoverflow:
[http]://stackoverflow.com/a/29627158/3115457

Discussion regarding this problem on the boost-users mailing-list:
[http]://thread.gmane.org/gmane.comp.lib.boost.user/83794

Attachments (3)

fix_boost_mpl_preprocess.py (4.9 KB ) - added by Deniz Bahadir <deniz.bahadir@…> 8 years ago.
Python-script which fixes the header-comments.
boost_mpl_preprocess.py (10.3 KB ) - added by Deniz Bahadir <deniz.bahadir@…> 8 years ago.
Python helper-script that simplifies pre-generation of MPL-containers.
boost_mpl_preprocess.2.py (10.3 KB ) - added by Deniz Bahadir <deniz.bahadir@…> 8 years ago.
Fixed version of script "boost_mpl_preprocess.py".

Download all attachments as: .zip

Change History (5)

by Deniz Bahadir <deniz.bahadir@…>, 8 years ago

Attachment: fix_boost_mpl_preprocess.py added

Python-script which fixes the header-comments.

by Deniz Bahadir <deniz.bahadir@…>, 8 years ago

Attachment: boost_mpl_preprocess.py added

Python helper-script that simplifies pre-generation of MPL-containers.

by Deniz Bahadir <deniz.bahadir@…>, 8 years ago

Attachment: boost_mpl_preprocess.2.py added

Fixed version of script "boost_mpl_preprocess.py".

comment:1 by Deniz Bahadir <deniz.bahadir@…>, 8 years ago

Please note:

The first attached version of script "boost_mpl_preprocess.py" had a small error in some of its regex-patterns.
I fixed that problem and attached it again. It got the name "boost_mpl_preprocess.2.py".

comment:2 by Deniz Bahadir <deniz.bahadir@…>, 8 years ago

I added a pull-request with the required changes, that already incorporates the two scripts.

[https]://github.com/boostorg/mpl/pull/20

Note: See TracTickets for help on using tickets.