Bug#900700: dh-make-perl: Will emit warnings due to semantic change in Dpkg::Version

Guillem Jover guillem at debian.org
Sun Jun 3 18:05:09 BST 2018


Source: dh-make-perl
Source-Version: 0.100
Severity: normal

Hi!

Due to #895004, the semantics of Dpkg::Version in bool context will get
unbroken back to their original behavior. This was at the time and
it is now again an API break, but any other solution was deemed worse.
To avoid silent breakage the module now emits a perl warning so that
users can check and fix the broken code or quiesce the warning.

Running dh-make-perl, got me these warnings (BTW I'll improve them to
mention Dpkg::Version, otherwise it is non-obvious):

  bool overload behavior has changed to be an is_valid() alias at /usr/share/perl5/Debian/Dependency.pm line 159.
  bool overload behavior has changed to be an is_valid() alias at /usr/share/perl5/Debian/Control/FromCPAN.pm line 379.
  bool overload behavior has changed to be an is_valid() alias at /usr/share/perl5/Debian/Control/FromCPAN.pm line 386.
  bool overload behavior has changed to be an is_valid() alias at /usr/share/perl5/Debian/Control/FromCPAN.pm line 398.
  bool overload behavior has changed to be an is_valid() alias at /usr/share/perl5/Debian/Control/FromCPAN.pm line 519.

After a cursory review, I think all these uses are correct with the new
semantics, so the warning would just need to be quiesced. But a second
check would be appreciated, in case other code paths have not been hit.

If the new behavior is indeed fine (bool evaluation will be an alias to
is_valid()), then please add the following to both file until dpkg 1.20.x:

  # Temporarily disable the warning until dpkg 1.20.x, as our usage is correct.
  no if $Dpkg::Version::VERSION ge '1.02',
     warnings => qw(Dpkg::Version::semantic_change::overload::bool);

otherwise, please change that to match the previous behavior of
as_string() if is_valid().

Thanks,
Guillem



More information about the pkg-perl-maintainers mailing list