• dh_clean fails with diagnostics involving cp, checksums, and a "bucket"

    From G. Branden Robinson@21:1/5 to All on Thu Oct 28 05:00:01 2021
    Hi folks,

    It's been a while since I've done any packaging. I was baffled when
    presented with the following.

    dh_clean
    cp: cannot stat 'debian/.debhelper/bucket/files/19c12bb2ca19e68724c2854ed0512469518df19b0710cc2011a5ca540810979c': No such file or directory
    dh_clean: error: cp -an --reflink=auto debian/.debhelper/bucket/files/19c12bb2ca19e68724c2854ed0512469518df19b0710cc2011a5ca540810979c debian/.debhelper/bucket/files/19c12bb2ca19e68724c2854ed0512469518df19b0710cc2011a5ca540810979c.tmp returned exit code 1
    make: *** [debian/rules:3: clean] Error 25

    1. What is the debhelper "bucket"? A web search turns up no
    documentation of this architectural feature, one evidently important
    enough that its identification is permitted to leak into diagnostic
    messages.
    2. Why is dh_clean trying to copy files around at all? Nothing about
    this is disclosed in dh_clean(1).
    3. Why is dh_clean's own diagnostic message pretty much a
    recapitulation of the one before? First, dh_clean should know why
    it is calling cp, and be able to emit an informative diagnostic
    about the context of the failure. Second, why is there no handler
    for this failure mode? It looks like the diagnostic was generated
    by a generic wrapper around execve() (or Perl's system(), maybe):
    it reports the attempted command line verbatim and its exit status.
    This sort of interaction, even with sophisticated users, is suitable
    more for tracing or debugging output.
    4. The exit status "25" is fairly unusual, suggesting that it has
    significant semantics. Yet I find no documentation of such
    significance in dh_clean's own man page nor in debhelper(7). Why?
    "Exit status" is a common and well-known section heading.

    Can someone shed some light on these matters?

    Please CC me on replies--many years ago I kept up obsessively with
    debian-devel traffic, but not any more, I'm sorry to say.

    Thank you in advance.

    Regards,
    Branden

    ...so help me, a _bucket_...
    https://www.hactrn.net/sra/vaxen.html

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmF6EQwACgkQ0Z6cfXEm bc4OKRAAjiJoMzCiTVLPBs0HDHwiiVAE476/8PrgGQKZRWtinR49yd16GlO9D83e BP14k5weoKAKrYOSb2iBPddb2g6vHAeYLdhbQEkVyv+NqXoaU0MzmwNLrQ4O9mqs 9SNk3FGsEamC/DIFsCQsoOP96HE1yi+Q0a1LeWzemWoEwd5aBg/L0Mi/1Q2Fk4k6 9jWU6XfVBRILlWNascCFGBuJ1/dUBlIhpJpPKe9yudqeAVmf4gIA51pF+7KvS0OF B+cPbi3Mh4BBsvKz60ZRta41Y/KwUG+j4TrWvoSvoUrcC4N5eLWwcj2CH8uUmwel +mgBvgBgLxhWMFEEgLv+HHO7VMkr6AmthCyoftgsgBFLK9NspaZErZ8mutvPz9ay m9LoZm/FdJCs/P6ZdtJlYbbpXYM4ZqcKjc2Rz4JEfsmEtRU79MlfEoKqIaTB9TM/ tJpLTkYvFCIchUfxifsHurumjzSM0NphL5Bdm9GrowsG/qtmhoCzmXOqHWVt0rz2 KsFUGfUSvD7wShwuX85NO7nQ3F/oPZPsKRV1IM0w7gHPjzcJKYqzm1SJX4Lp7mtv YvC4cB/mcdNaUm1yX6BMiYtvLj7hX4mXeim+lZTJiG9Vva6uZxpkVNjDaR0LF9Ny XMcDrQ/dPXj7DYahH1S1Dyk5m7KAhTAhwXz5LuA4F7W9PPuADsc=
    =Pw4O
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Niels Thykier@21:1/5 to All on Thu Oct 28 08:20:01 2021
    G. Branden Robinson:
    Hi folks,

    It's been a while since I've done any packaging. I was baffled when presented with the following.

    dh_clean
    cp: cannot stat 'debian/.debhelper/bucket/files/19c12bb2ca19e68724c2854ed0512469518df19b0710cc2011a5ca540810979c': No such file or directory
    dh_clean: error: cp -an --reflink=auto debian/.debhelper/bucket/files/19c12bb2ca19e68724c2854ed0512469518df19b0710cc2011a5ca540810979c debian/.debhelper/bucket/files/19c12bb2ca19e68724c2854ed0512469518df19b0710cc2011a5ca540810979c.tmp returned exit
    code 1
    make: *** [debian/rules:3: clean] Error 25

    1. What is the debhelper "bucket"? A web search turns up no
    documentation of this architectural feature, one evidently important
    enough that its identification is permitted to leak into diagnostic
    messages.

    The "bucket" is an implementation detail of debhelper used by the
    feature explained below.

    2. Why is dh_clean trying to copy files around at all? Nothing about
    this is disclosed in dh_clean(1).

    1-2 debhelper tools mark certain files as "restore on clean" and then
    replace them (such files are saved in the "bucket"). The most notorious example is dh_update_autotools_config which does this for config.sub and config.guess files.

    What you are seeing here is dh_clean failing to restore those files on
    clean. This case looks like something improperly messed around in
    debhelper's implementation details and left it in an invalid state.
    When dh_clean handles this removal, it does so in a way that ensures
    that error cannot occur even if dh_clean is interrupted half-way through.

    You can remove debian/.debhelper/bucket (and everything inside it) and
    that will reset debhelper's own state to avoid that error. It will not
    restore the affected files - but then, they can be restored from git or
    the orig source as needed. You can see the list of files in debian/.debhelper/bucket/index (mind the order of operations here). The
    index file also contains a SHA256 checksum of the file, so you can
    ensure you have found the original.

    3. Why is dh_clean's own diagnostic message pretty much a
    recapitulation of the one before? [...]

    That is standard for debhelper error messages that involves external
    programs. Except for a few places inside dh_auto_*, which have been
    enriched to dump related log files from upstream build systems), then
    this is what you get from debhelper.

    4. The exit status "25" is fairly unusual, suggesting that it has
    significant semantics. Yet I find no documentation of such
    significance in dh_clean's own man page nor in debhelper(7). Why?
    "Exit status" is a common and well-known section heading.


    That is probably caused by the very "fun" feature in perl . The exit
    code from perl will be set to errno if there is a non-zero errno value
    and the program did not explicit set an exit value due to an uncaught exception. That errno can be completely unrelated to the actual problem
    (perl does not know when errno was set when perl pulls this stunt).

    Can someone shed some light on these matters?

    Please CC me on replies--many years ago I kept up obsessively with debian-devel traffic, but not any more, I'm sorry to say.

    Thank you in advance.

    Regards,
    Branden

    [...]


    Done and done.

    In summary:

    * Ensure you do not have anything messing around with debhelper's
    internals inside debian/.debhelper. You can break plenty of
    features by deleting or changing random files inside that
    directory.

    * Restore affected fines manually
    (read debian/.debhelper/bucket/index for a list of files)

    * Run 'rm -fr debian/.debhelper/bucket' to get dh_clean "unstuck".

    * Complete a clean of the package.

    * Continue what you were doing.

    Thanks,
    ~Niels

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)