Re: [Module::Build] [RFC] [PATCH] Action plugins
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <Ra...@Th...> - 2003-12-06 15:36:42
|
Resending: this never made it to the list. (originally sent 12/4/2003 9:06 PM) On 12/3/2003 11:01 PM, Ken Williams wrote: > Also, have you had a chance to take a look at ExtUtils::CBuilder? How > do you see it fitting in with a plugin scheme? My goal with it was to > make something that would be generically useful, not just as a plugin > for Module::Build. I've /briefly/ looked at EU::CBuilder (btw, there is a product, a compiler with that name <http://www.borland.com/cbuilderx/>). Lifting that code out of M::B should make things much easier to manage. It is going to need to change a good bit... mostly just parameterizing on whether creating a static or dynamic library (or executable?) and on whether or not to include all the perl defines, etc. The reason for the latter is modules like Compress::Zlib that includes the source for and build zlib and links to it. zlib would not need to see any of the perl specific stuff. As far as fitting in with the plugin scheme, I haven't tried to look far enough to be able to nail down an interface between the two. I'm mostly looking from the top-down. I'm imagining that there will be some action builders that make it easy to construct actions to accomplish certain goals. The relevant builder here would be the library builder which would be given a list of source files, and it would then create all the neccessary actions and dependencies. my $lib = Module::Build::Action::Builder->new_library( output => 'mylib', sources => [ qw(file1.c file2.c file3.c) ], use_perl => 1, # include perl specific stuff ); Under the hood it would create an action named 'mylib', generate depenecies on the object files, create actions for each of the object files with a dependency on its respective source file, etc. Then you would say Module::Build::Action::by_name('code')->add_dependency($lib); to add it as a dependency of the code action. This design resulted in my decision to implement the prototype the way I did. Specifically scanning for plugins at startup to generate a list of action which can then be modified at runtime. Scanning at startup initially had me concered because of a delayed startup, but testing on an old 466 Mhz pentium has nearly convinced me that it won't be a problem. As far as how the above will interface with EU::CBuilder, I'm not entirely sure yet. I'm hoping it will be obvious when we get there. =) Randy. He He, this interesting(?) article just showed up on <http://news.google.com/>: <http://www.telegraph.co.uk/news/main.jhtml?xml=/news/2003/12/05/nfossil05.xml&sSheet=/portal/2003/12/05/ixportal.html> |