Skip Menu |

This queue is for tickets about the Google-Ads-AdWords-Client CPAN distribution.

Report information
The Basics
Id: 118631
Status: new
Priority: 0/
Queue: Google-Ads-AdWords-Client

Owner: Nobody in particular
Requestors: KENTNL [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: Dynamic Version assignment in modules is unreliable for static analysis

This line of code can't work for static analysis, as there will be no Google::Ads::AdWords::Constants in @INC

Worse, if there *is* a Google::Ads::AdWords::Constants in @INC, it will return *its* version, which may be *different* from the version under static analysis.

Its generally recommended to just hard-code these versions everywhere and then have a tool that synchronizes them as your release process.

However, presently, pointing Toolchain code (Module::Metadata) at your code simple does this:


Error evaling version line ' my $dummy = q#  Hide from _packages_inside()
    #; package Module::Metadata::_version::p3;
    use version;
    sub {
      local $VERSION;
      use Google::Ads::AdWords::Constants; our $VERSION = ${Google::Ads::AdWords::Constants::VERSION};;
      return $VERSION if defined $VERSION;
      return $Module::Metadata::_version::p3::VERSION;
  ' in /usr/lib64/perl5/vendor_perl/5.24.1/Google/Ads/AdWords/ Can't locate Google/Ads/AdWords/ in @INC (you may need to install the Google::Ads::AdWords::Constants module) (@INC contains: /home/kent/perl5/perlbrew/perls/5.25.6-nossp-sdbm-nopmc/lib/site_perl/5.25.6/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.6-nossp-sdbm-nopmc/lib/site_perl/5.25.6 /home/kent/perl5/perlbrew/perls/5.25.6-nossp-sdbm-nopmc/lib/5.25.6/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.6-nossp-sdbm-nopmc/lib/5.25.6 .) at (eval 7) line 6, <$handle> line 26.
BEGIN failed--compilation aborted at (eval 7) line 6, <$handle> line 26.

Given this is how Module::Build populates the "provides" record:

I'm kinda surprised you haven't already hit problems here with this approach.

If anything, I think you got lucky that this code is here that will help you in the "developer of the dist" scenario :

But that is unlikely to work for anyone else.


This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to