andk / cpanpm

CPAN.pm
87 stars 79 forks source link

Bug fix: Build.PL script_files may be non-ARRAY #95

Closed augensalat closed 5 years ago

augensalat commented 8 years ago

This bug was only triggered with enabled CPAN::Plugin::Specfile.

This happened with HTML-Tree's Build.PL, where 'script_files' is a SCALAR and not an array reference, as CPAN::Distribution expects:

Catching error: "Can't use string (\"bin\") as an ARRAY ref while \"strict refs\" in use at ... lib/perl5/5.10.1/CPAN/Distribution.pm line 3466 ...

andk commented 8 years ago

I have doubts that this is the best way to fix the bug. Would it not make more sense to generate the list right in that moment? That way we would canonicalize the content of the script_files as an anon array of script files. If we delay that task we just cause headache down to the next consumers. We usually try to avaoid that. I'm not sure it is doable, but we should try. What do you think?

augensalat commented 8 years ago

I don't agree. The Module::Build::API doc clearly states, that script_files can be an array ref, a hash ref or a string. Any consumer that is prepeared for an array reference only would therefore be broken.

andk commented 5 years ago

Thanks, better late than never, I just merged this into the master branch.