[Module::Build] problem with programmatic control of multiple builds
Status: Beta
Brought to you by:
kwilliams
|
From: Ray Z. <rz...@co...> - 2006-06-02 13:56:41
|
I have an automated build, test and install process for a collection
of in-house Perl packages* using a straightforward procedure which is
basically ...
foreach my $dist ( @dist_list ) {
my $dir = File::Spec->join('my_build_dir', $dist);
chdir $dir or die "could not change to $dir";
$p = { <some build options> };
my $b = Module::Build->new_from_context( %$p );
$b->dispatch('build');
$b->dispatch('test');
$b->dispatch('install');
}
I ran into a problem when attempting to convert everything from using
a slightly modified version of M::B 0.2608 to M::B 0.2801. The
problem I am encountering has to do with the fact that $b-
>build_elements appears to be cumulative in the above loop, even
though $b is being recreated. That is, if one of the Build.PL files
has ...
$b->add_build_element('foo');
... then all subsequent $dist's in the above loop will attempt to
build foo elements even though the corresponding Build.PL does not
mention foo anywhere.
I believe the %valid_properties closure in
Module::Build::Base::ACTION_config_data is the culprit. Is this a
bug? Shouldn't the list of build_elements (all config data, in fact)
be an object property as opposed to class data?
Any suggestions for a workaround to start over with a completely
fresh, clean M::B at the beginning of each loop?
Thanks,
- Ray
* Consisting of a base package A and add-on packages B, as described
in yesterday's post "M::B subclass .pm file locations".
|