[C++-sig] Pyste: serious bug with --multiple.
Nicodemus
nicodemus at globalite.com.br
Mon Jul 7 21:09:32 CEST 2003
Prabhu Ramachandran wrote:
>Hi,
>
>Found a serious bug with Pyste's --multiple option. It would not mix
>up the declarations and put them in wrong files. I've attached a
>patch that fixes this problem.
>
Applied, thanks again!
>Generating only one file per --multiple is nice but still has the old
>problem where if I change one interface file I need to wait several
>minutes for pyste (gccxml actually) to regenerate the files.
>Nicodemus suggested that a --xml-cache option would be useful.
>However even with that option you'd generate many xml files and will
>need to keep track of those files etc.
>
Yes, the idea was that Pyste would generate a xml file for each header
parsed. Keeping them updated would be the build's system job: when a
header is modified, it should delete the corresponding xml file, so that
Pyste would rebuild it.
> Instead I have a much simpler
>approach that will solve much of our problems.
>
> 1. Add a --only-wrap option that will process any number of interface
> files and will generate the necessary wrapper code and *will not*
> generate a _main.cpp file. Further, it will add an extra function
> to each _interface_name.cpp file that reads something like this:
>
> void _interface_name_module_init()
> {
> Export_SomeClass();
> Export_SomeHeader_H();
> // ...
> }
>
> 2. The --multiple option with the --only-main option will simply
> create a _main.cpp with something like this:
>
> void _interface_name_module_init();
> BOOST_PYTHON_MODULE(module_name)
> {
> _interface_name_module();
> // ...
> }
>
> Note that the above does not need to use gccxml at all since it
> only needs the interface file names. This should make it possible
> to selectively compile individual interfaces via --multiple
> --only-wrap and then generate a _main.cpp separately using all the
> interfaces very quickly.
>
>
If that solves your problem, that's fine then. 8)
But I don't see a need for the _interface_name_module_init() function,
since BOOST_PYTHON_MODULE can call them, and the fact that Base classes
must be exported first, would make things complicated.
>There are other issues not related to the above also but I won't go
>into them here.
>
>I'm going to go ahead and implement --only-main and --only-wrap on my
>copy of the code here and will submit it to the list if it works
>nicely. I'll let you folks decide if it goes into CVS or not.
>
>
Sure thing, I don't see why not. 8)
Let's implement this then, if that solves the problem.
>cheers,
>prabhu
>
Thanks a lot Prabhu. Your efforts in improving Pyste are greatly
appreciated!
Regards,
Nicodemus.
More information about the Cplusplus-sig
mailing list