On Mon Mar 06 09:12:52 2017, KES wrote:
Show quoted text> $cat Build.PL
> use strict;
> use warnings;
>
> use Module::Build::Pluggable
> ReadmeMarkdownFromPod => # { clean => 1 },
> Repository =>
> GithubMeta =>
> CPANfile =>
> XSUtil => {
> cc_warnings => 1,
> ppport => "ppport.h",
> },
> ;
>
> my $builder = Module::Build::Pluggable->new(
> module_name => 'XS::Utils',
> dist_author => 'Eugen Konkov <kes-kes@yandex.ru>',
> license => 'perl',
> create_makefile_pl => 'traditional',
> create_readme => 1,
> create_license => 1,
> meta_merge => { resources => { ### This will be replaced by
> ::Repostirory
> bugtracker => 'url',
> x_IRC => "irc://irc.perl.org/#channel",
> repository => 'url',
> }}
> );
>
> $builder->create_build_script;
>
>
>
> Both modules: Repository and GithubMeta setup "resources". Last one
> have precendence.
>
> As result we have only hash which setup 'GithubMeta'. Repository and
> one from Module::Build are replaced
>
>
> /Module/Build/Base.pm:851: my %new = (%{ $prop }, @_);
> This will look like:
>
> %new = resources => { ### This will be replaced by ::Repostirory
> bugtracker => 'url',
> x_IRC => "irc://irc.perl.org/#channel",
> repository => 'url',
> }, resources => { \%HASH FROM Repository }, resources => { \%HASH FROM
> GithubMeta })
>
> You probably should:
>
> use Hash::Merge::Simple qw/ clone_merge /;
> %new = clone_merge
> resources => { ### This will be replaced by ::Repostirory
> bugtracker => 'url',
> x_IRC => "irc://irc.perl.org/#channel",
> repository => 'url',
> }
> ,resources => { \%HASH FROM Repository }
> ,resources => { \%HASH FROM GithubMeta }
This is not a bug in Module::Build, but in Module::Build::Pluggable. It's using the meta_merge accessor as if it is a non-accessor method (when you call it, you replace the current meta_merge value).
Leon