googleads / googleads-perl-lib

AdWords API Perl Client Library
Apache License 2.0
5 stars 19 forks source link

Fails to build on Raspbian / newer Perl versions (push on scalar now forbidden) #25

Closed myannikos closed 6 years ago

myannikos commented 6 years ago

Building fails with Perl 5.24.1:

#   Failed test 'require 'ReportQueryBuilder.pm';'
#   at t/001_require.t line 41.
#     Tried to require ''ReportQueryBuilder.pm''.
#     Error:  Experimental push on scalar is now forbidden at /root/.cpanm/work/1519897203.588/Google-Ads-AdWords-Client-5.2.0/blib/lib/Google/Ads/AdWords/Utilities/QueryBuilder.pm line 49, near "})"
# Experimental push on scalar is now forbidden at /root/.cpanm/work/1519897203.588/Google-Ads-AdWords-Client-5.2.0/blib/lib/Google/Ads/AdWords/Utilities/QueryBuilder.pm line 72, near "$where_builder)"
# BEGIN not safe after errors--compilation aborted at /root/.cpanm/work/1519897203.588/Google-Ads-AdWords-Client-5.2.0/blib/lib/Google/Ads/AdWords/Utilities/QueryBuilder.pm line 92.
# Compilation failed in require at /usr/share/perl/5.24/base.pm line 136.
#       ...propagated at /usr/share/perl/5.24/base.pm line 158.
# BEGIN failed--compilation aborted at ReportQueryBuilder.pm line 23.
# Compilation failed in require at (eval 2836) line 2.

Code:

  if ($self->get_query_builder()) {
    push(
      $self->get_where_builders(),
      @{$self->get_query_builder()->get_where_builders()});
  }

https://perldoc.perl.org/functions/push.html

Starting with Perl 5.14, an experimental feature allowed push to take a scalar expression. This experiment has been deemed unsuccessful, and was removed as of Perl 5.24.

# perl -v

This is perl 5, version 24, subversion 1 (v5.24.1) built for arm-linux-gnueabihf-thread-multi-64int
(with 75 registered patches, see perl -V for more detail)
sundquist commented 6 years ago

Hello,

Thanks for posting this. I'll set up my environment to look similar to this one so I can reproduce and fix it. If I experience any issues while doing that, I'll get back to you.

Best, Nadine Sundquist, AdWords API Team

myannikos commented 6 years ago

This should just be a matter of wrapping the first argument of push in @{ } IMHO.

sundquist commented 6 years ago

Hi,

Thanks for pointing that out. I'll try to get that squared away in the next push of the library that I do.

Regards, Nadine, AdWords API Team

sundquist commented 6 years ago

Hello,

This has been fixed for the report utility in the newest release 5.3.0.

Cheers, Nadine, AdWords API Team