GNOME Bugzilla – Bug 794069
gtk-doc output does not build reproducibly
Last modified: 2018-03-27 21:43:52 UTC
Originally filed at https://bugzilla.opensuse.org/show_bug.cgi?id=1048207 We noticed that there were random small variations in gtk-doc output for the gstreamer-plugins-bad package. These can be fixed with this trivial patch: --- gst-plugins-bad-1.12.4.orig/common/gtk-doc-plugins.mak +++ gst-plugins-bad-1.12.4/common/gtk-doc-plugins.mak @@ -311 +311 @@ endif -inspect_files = $(shell find $(srcdir)/$(INSPECT_DIR) -name '*.xml') +inspect_files = $(sort $(shell find $(srcdir)/$(INSPECT_DIR) -name '*.xml')) For background-information, see also https://github.com/bmwiedemann/theunreproduciblepackage/tree/master/readdir
Thanks for the bug report, the analysis and the patch! I understand why "sort" makes sense for reproducible builds, but what I don't entirely understand is what exactly caused the flip-flopping of the output. The order in inspect_files should not really affect the output in principle. It looks to me like the real underlying problem is that some plugins got renamed and there are some stale files in docs/plugin/inspect/, e.g. we have both docs/plugin/inspect/plugin-gstgtk.xml (outdated) docs/plugin/inspect/plugin-gtk.xml (current) and sort just makes it stable, but it might still pick up the wrong/outdated version of the file in this case. Same for the "rawparse" plugin which got moved to -base and renamed to "legacyrawparse". I think the real fix is to delete the stale files. I have pushed this to the 1.12 branch which will be in 1.12.5: commit a5db934b88a520f414783fdc9d064a6382d691dc Author: Tim-Philipp Müller <tim@centricular.com> Date: Tue Mar 27 19:49:17 2018 +0100 docs: plugins: remove stale inspect xml files gtk plugin was renamed (gstgtk -> gtk) and rawparse was moved to -base, with legacyrawparse remaining. https://bugzilla.gnome.org/show_bug.cgi?id=794069 and similar things to 1.14 and git master (gtk plugin has moved to good), so it should hopefully be fixed in the 1.14.1 release and onwards. There's nothing wrong with your patch of course, but it really shouldn't be needed, so I'm leaving it for now. Please re-open if it's still a problem, thanks!
The advantage of the sort patch would be that it provides deterministic output also in case of future name conflicts. So either output is always correct or always wrong and this kind of issue is a lot easier to work with than 'it works on my machine but not on yours'
Understood, but you can still have these issues, for example because 'sort' is locale dependent. I'll reconsider if it comes up in future, but for now I'd rather not add that extra wheel.
Looking at gtk-doc-plugins.mak again, I've changed my mind, since the order is actually relevant to creating another file which is then used as input file for another processing step, so pushed this to master. Will be picked up at the next common update. Thanks. commit 3a4a1d08e0d4df520dcb41ff1f7db5f0bd401d62 Author: Bernhard Wiedemann <gnomebmw@lsmod.de> Date: Tue Mar 27 22:41:18 2018 +0100 gtk-doc-plugins.mak: sort xml inspect files Filesystem listing doesn't guarantee a stable order. https://bugzilla.gnome.org/show_bug.cgi?id=794069