RF{C,H}: dh-make-perl

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RF{C,H}: dh-make-perl

gregor herrmann-3
During SnowCamp and during our recent Sprint, I hacked a bit on
dh-make-perl. All the changes are in the post-buster branch, and I'd
like to upload a new release not long after the Buster release (i.e.
during DebCamp).

Some of the changes might profit from a review (of the code and/or
the result), and others are not finished / need help and
improvements, hence I'm giving a quick overview here:


0) Missing years in debian/copyright:

When dh-make-perl doesn't find upstream copyright years, write
| Copyright: <INSERT COPYRIGHT YEAR(S) HERE>, $author
i.e. add a placeholder instead of just writing nothing.

Rationale: this is one of the typical shortcomings I regularly see
when uploading packages.
   

1) debhelper:

Use "debhelper-compat (= 12)" in debian/control and no debian/compat
file anymore.


2) debian/watch:

Use version=4 and version/extension placeholders
(We've used version 3 mainly because of PET and PET is unfortunately
dead since the move from Alioth to Salsa.)

The generated d/watch files look like:

| version=4
| https://metacpan.org/release/Strange   .*/Strange-v?@ANY_VERSION@@ARCHIVE_EXT@$


3) Treat libmodule-build-using-pkgconfig-perl like libmodule-build-perl
   and libmodule-build-using-pkgconfig-perl

i.e. put it into Build-Depends


4) Versioned Provides
(Now it gets more complicated :))

Before we had versioned provides, we would write dependencies on
dual-lifed modules as
| perl (>= 5.x.y) | libfoo-bar-perl (>= x.y)
or
| libfoo-bar-perl (>= x.y) | perl (>= 5.x.y)

dh-make-perl was never very good at that (and typically wrote just
"perl (>= 5.x.y)") but since we have versioned Provides, we just want
"libfoo-bar-perl (>= x.y)" anyway.

This seems to work but has at least one side effect: It currently
also adds dependencies for modules which have been in perl core since
forever. [0] I seem to remember that we had this discussion already
somewhere (with Dom asking about it?) but I don't remember where. In
general I think is not a problem and can also be helpful for future
cases of modules removed from perl core. - But this topic warrants
further thoughts and probably also a code review of my commits.


5) <!nocheck> annotations for test dependencies

It might be nice (and we recently also got 2 bug reports) to annotate
build dependencies which are only used for tests with <!nocheck> (for
crossbuilding, bootstrapping, maybe also autopkgtest in the future).

This kinda works now (for well behaved META.{json,yml} files) but
- I'm not sure if my approach in the code is right/clean
- it doesn't work for "refresh", i.e. the <!nocheck> is not addedd to
  existing dependencies; I have an idea why ("satisfies" only checks
  name and version) but I stopped there before making even more
  disrupting changes to Debian::Dependency

So this clearly needs more eyeballs and probably changes …


6) Use Config::Model::Dpkg

Config::Model::Dpkg (if available) is used to reformat and fix
debian/control, both in make() and refresh().

(Thanks dod for helping me in getting this right.)


I hope that people have time to think about these changes, play with
the version in the post-buster branch, check/improve the code, and
maybe also spend some time in the future on one our most important
tools


Cheers,
gregor


[0] for a random package we now get unversioned (build) dependencies
on libscalar-list-utils-perl and libtest-simple-perl for example

--
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   NP: Arlo Guthrie: Gypsy Davy

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RF{C,H}: dh-make-perl

Alex Muntada-2
Hi gregor, good job!

> Some of the changes might profit from a review (of the code
> and/or the result), and others are not finished / need help
> and improvements, hence I'm giving a quick overview here:

I just did a quick code review: in general I find very small
changes (maybe in separate branches, then merged --no-ff) help
understand better how code evolves and therefore make code
reviews easier too. This was the case for the changes in 0..3
and 6.

> 0) Missing years in debian/copyright:
> 1) debhelper:
> 2) debian/watch:
> 3) Treat libmodule-build-using-pkgconfig-perl like
>    libmodule-build-perl and libmodule-build-using-pkgconfig-perl
> 6) Use Config::Model::Dpkg

These were small changes mostly and easy to review, LGTM.

> 4) Versioned Provides
> (Now it gets more complicated :))

This was harder: I'm not sure I understood every bit because
the changes were significantly larger and my knowledge of
dh-make-perl code is poor. Nevertheless, I think they're OK.

> This seems to work but has at least one side effect: It
> currently also adds dependencies for modules which have been
> in perl core since forever. [...] In general I think is not a
> problem and can also be helpful for future cases of modules
> removed from perl core.

Agreed.

> 5) <!nocheck> annotations for test dependencies
>
> This kinda works now (for well behaved META.{json,yml} files) but
> - I'm not sure if my approach in the code is right/clean

This wasn't as hard as 4) and I think it's also OK.

Cheers!
Alex

--
  ⢀⣴⠾⠻⢶⣦⠀
  ⣾⠁⢠⠒⠀⣿⡁   Alex Muntada <[hidden email]>
  ⢿⡄⠘⠷⠚⠋   Debian Developer 🍥 log.alexm.org
  ⠈⠳⣄⠀⠀⠀⠀


signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RF{C,H}: dh-make-perl

gregor herrmann-3
On Thu, 04 Jul 2019 09:24:03 +0200, Alex Muntada wrote:

> Hi gregor, good job!

Thanks!

And thank you very much for reviewing this stuff!

I wanted to wait for DebCamp until coming back to dh-make-perl, and
well, here we are :)
 
> > Some of the changes might profit from a review (of the code
> > and/or the result), and others are not finished / need help
> > and improvements, hence I'm giving a quick overview here:
> I just did a quick code review: in general I find very small
> changes (maybe in separate branches, then merged --no-ff) help
> understand better how code evolves and therefore make code
> reviews easier too. This was the case for the changes in 0..3
> and 6.

True, will try to do better in the future.
(I hoped that this branch would just be some small commits …).
 
> > 0) Missing years in debian/copyright:
> > 1) debhelper:
> > 2) debian/watch:
> > 3) Treat libmodule-build-using-pkgconfig-perl like
> >    libmodule-build-perl and libmodule-build-using-pkgconfig-perl
> > 6) Use Config::Model::Dpkg
> These were small changes mostly and easy to review, LGTM.

Cool.
 
> > 4) Versioned Provides
> > (Now it gets more complicated :))
> This was harder: I'm not sure I understood every bit because
> the changes were significantly larger and my knowledge of
> dh-make-perl code is poor. Nevertheless, I think they're OK.

Great, thanks.
I'm also not 100% sure but from my tests since then the results
looked reasonable to me.
 
> > 5) <!nocheck> annotations for test dependencies
> > This kinda works now (for well behaved META.{json,yml} files) but
> > - I'm not sure if my approach in the code is right/clean
> This wasn't as hard as 4) and I think it's also OK.

As this is not yet doing what it does, I'll try and improve it in the
next days.


So I've now (with a little consultation with my friends)
- cherry-picked all but the <!nocheck> (and the salsa-ci) commits
  into master and updated the changelog. So this should be ready for
  upload. (Maybe David can test it with the dh_elpa stuff but I think
  the changes shouldn't affect it)
- rebased post-buster onto master (fixed merge conflicts and then
  removed them in an interactice rebase), so now post-buster is
  basically <!nocheck>, with a history of master plus the few commits
  on top. Will force-push after a review here on the table … And done
  now.
- and then I learned some git tricks from David - obrigado :)


Cheers,
gregor

--
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-  

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RF{C,H}: dh-make-perl

gregor herrmann-3
On Wed, 17 Jul 2019 17:35:55 -0300, gregor herrmann wrote:

> So I've now (with a little consultation with my friends)
> - cherry-picked all but the <!nocheck> (and the salsa-ci) commits
>   into master and updated the changelog. So this should be ready for
>   upload. (Maybe David can test it with the dh_elpa stuff but I think
>   the changes shouldn't affect it)

And uploaded earlier today.

> - rebased post-buster onto master (fixed merge conflicts and then
>   removed them in an interactice rebase), so now post-buster is
>   basically <!nocheck>, with a history of master plus the few commits
>   on top. Will force-push after a review here on the table … And done
>   now.

And post-buster rebased and force-pushed again.


Cheers,
gregor

--
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-  

signature.asc (981 bytes) Download Attachment