#965349 regression in dh_installchangelogs or dh_missing causes fatal error when installing upstream changelog from debian/tmp

#965349#5
Date:
2020-07-19 23:54:21 UTC
From:
To:
Steps to reproduce:

    override_dh_installchangelogs:
        mkdir -p debian/tmp
        generate-or-convert-changelog-here >> debian/tmp/changelog
        dh_installchangelogs debian/tmp/changelog

Result:

    dh_missing: warning: changelog exists in debian/tmp but is not installed to anywhere
    dh_missing: error: missing files, aborting

Meanwhile the upstream changelog has been correction installed to each
of the debian/bin-pkg/u/s/doc/changelog.gz locations.  Debhelper 12
was definitely good, and I'm not sure if the regression was introduced
in 13, 13.1, or 13.2.

f3ce4ba3a5e2f9515b0ebe1940aed81ce9a92c49 looks like a possible culprit,
but that's just a guess.

Falling back to debhelper-compat 12 avoids triggering this bug.  I
hope noting this fact makes it easier to track down, because it means
that the bug is in a branch specific to ≥ debhelper-compat 13.

Regards,
Nicholas

#965349#10
Date:
2020-07-20 07:23:41 UTC
From:
To:
Nicholas D Steeves:

Hi Nicholas,

Thanks for filing the bug.  I suspect that the reason that falling back
to compat 12 works is because it downgrades the issue to a warning
(compat 12 defaulting to --list-missing vs. compat 13 defaulting to
--fail-missing).

Can you confirm that finding?  Because then it is probably just the new
default and not a regression.

Obviously, that still leaves finding a solution to the problem, but for
starters lets confirm whether or not this is a regression.

Thanks,
~Niels

#965349#15
Date:
2020-07-20 16:56:33 UTC
From:
To:
Hi Niels,

Thank you for the quick reply!

Niels Thykier <niels@thykier.net> writes:

You're right :-)

Confirmed, the new default exposes what may be an old bug.

dh_missing: warning: changelog exists in debian/tmp but is not installed to anywhere
        The following debhelper tools have reported what they installed (with files per package)
         * dh_elpa: elpa-counsel (2), elpa-ivy (4), elpa-ivy-hydra (1), elpa-swiper (1)
         * dh_installdocs: elpa-counsel (0), elpa-ivy (1), elpa-ivy-hydra (0), elpa-swiper (0)
        If the missing files are installed by another tool, please file a bug against it.
        When filing the report, if the tool is not part of debhelper itself, please reference the
        "Logging helpers and dh_missing" section from the "PROGRAMMING" guide for debhelper (10.6.3+).
          (in the debhelper package: /usr/share/doc/debhelper/PROGRAMMING.gz)
        Be sure to test with dpkg-buildpackage -A/-B as the results may vary when only a subset is built
        If the omission is intentional or no other helper can take care of this consider adding the
        paths to debian/not-installed.

I am explicitly installing it in rules with 'dh_installchangelogs
debian/tmp/changelog' and have confirmed the file exists in each of the
binary packages for both debhelper-compat 12 and 13.

Please let me know if there's anything else I can do to help.  I'm sorry
to say I never learned Perl.

Best,
Nicholas

#965349#20
Date:
2021-02-02 20:22:32 UTC
From:
To:
Control: affects 965349 + src:faketime
 […]
faketime.

The source for faketime contains ./NEWS, but the "install" make target
also places the NEWS file into debian/tmp/usr/share/doc/faketime/NEWS

dh_installchangelogs installs the NEWS file as expected (in
/usr/share/doc/faketime/changelog.gz), but then dh_missing complains
that debian/tmp/usr/share/doc/faketime/NEWS isn't installed anywhere.

If i go ahead and add usr/share/doc/faketime/NEWS to
debian/libfaketime.docs to satisfy dh_missing, then i get a *different*
lintian warning:

W: libfaketime: duplicate-changelog-files usr/share/doc/libfaketime/NEWS.gz usr/share/doc/libfaketime/changelog.gz

i could add usr/share/doc/faketime/NEWS to debian/not-installed, but
that seems bogus too -- it *is* installed, but it's installed by
dh_installchangelogs.  (this is likely to be my near-term workaround,
ugly as it is)

Seems like dh_missing could:

 - observe the cryptographic digest of the file installed by
   dh_installchangelogs (maybe both as installed and decompressed)

 - for each potentially "missing" file:

   - digest it (possibly decompressing it first?) and compare it against
     the changelog digest(s).  if they match, skip it.

hope this is useful.  thanks a lot for all the work on dh and on
lintian.  they're both super helpful toolchains for kicking the
ecosystem into doing the Right Thing.