Re: [Module::Build] problem with programmatic control of multiple builds
Status: Beta
Brought to you by:
kwilliams
From: Randy W. S. <ml...@th...> - 2006-06-06 02:19:13
|
Ray Zimmerman wrote: > 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? This is an unfortunate artifact of the current implementation. There are plans to fix this in the next iteration by moving properties into their own object. > Any suggestions for a workaround to start over with a completely > fresh, clean M::B at the beginning of each loop? Maybe fork a child process for each build... Randy. |