#1000837 krb5: differing build paths trigger different documentation

#1000837#5
Date:
2021-11-30 00:52:17 UTC
From:
To:
I have not observed this in the tests.reproducible-builds.org history,
although krb5 currently FTBFS, but when building krb5 locally using
reprotest, I am able to consistently produce a different build that is
triggered when the build path is different between two builds.

To reproduce, from the checked out krb5 debian packaging dir:

  reprotest  --min-cpus=1 --vary=-all,+build_path auto -- null

Which should keep everything essentially identical, except the build
path.


For some odd reason the different build path ends up in one build
consistently removing a space in a few places:

./usr/share/doc/krb5-doc/appdev/refs/api/krb5_get_init_creds_opt_set_pa.html

-<p>This function allows thecaller to supply options for...
+<p>This function allows the caller to supply options for...

"thecaller" vs. "the caller".

Full diffoscope output attached.

I have also attached a patch that works around this issue and builds
reproducibly, but it should not actually be used as it obviously leaves
cruft in the documentation that should not be there.

This is presumably actually a bug in sphinx or doxygen... though I'm not
sure I've observed this behavior in another package, so maybe there is
something specific in the krb5 documentation...


I try to avoid submitting bugs without patches, but this one is baffling
enough I hope to get more eyes on it!


live well,
  vagrant

#1000837#10
Date:
2022-04-20 22:05:33 UTC
From:
To:
And now that the FTBFS is fixed, it does appear on
tests.reproducible-builds.org for amd64, i386, arm64 and armhf
architectures for both unstable and experimental, where build paths are
varied:

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/krb5.html

The same source built in the current testing suite (bookworm) build
reproducibly, where build paths are not varied.
...

Still as perplexed as before!


live well,
  vagrant

#1000837#15
Date:
2022-04-20 23:37:54 UTC
From:
To:
Hi.
I've looked over your report and baffling patch.
This is really strange, and I don't have much to add.

It seems like it might be related to the pathsubst rules in
src/doc/Makefile.in.
But I don't see the build directory getting used there.

#1000837#20
Date:
2022-04-28 16:48:33 UTC
From:
To:
Hey folks,

Oh ho ho, this is fun! So, curiously, I can't reproduce this outside of
reprotest (with a build path variation).

Hm yes I don't immediately see how the pathsubst rules might be doing
this in practice either. Another interesting candidate might be the
doxy.py apparatus:

  103 # Use doxygen to generate API documentation, translate it into RST
  104 # format, and then create a composite of $(docsrc)'s RST and the
  105 # generated files in rst_composite.  Used by the html and substhtml targets.
  106 composite: Doxyfile $(docsrc)/version.py
  107         rm -rf doxy rst_apiref rst_composite
  108         $(DOXYGEN)
  109         (cwd=`pwd`; cd $(docsrc)/tools && \
  110                 $(PYTHON) doxy.py -i $$cwd/doxy/xml -o $$cwd/rst_apiref)

It is of course feasible that this parser (or one of its dependencies)
has a bug.

Two other drive-thru suggestions:

 * configgen.py has a bunch of global search-replaces that might be
   misfiring. There's also a potentially suspicious newline snarfing
   code that could conceivably be buggy as well:

    # replace \ by \\, replace " by \", and '  ' by a newline with end string
    # and start string at next line
    docC = []
    for line in split_doc:
      if (line.strip() != "<br/>"):
        docC.append(line.strip().replace('\\', '\\\\').
            replace('"', '\\"').replace("<br>", ""))

 * Memory corruption due to undefined behaviour somewhere in some
   parser. (Sam, we often call this a "docbook-to-man issue", not
   because the problem lies there, but due to the classic/notorious
   reproducible bug #842635 in that package.)


Regards,