FS#71154 - man pages are not reproducible

Attached to Project: Pacman
Opened by Allan McRae (Allan) - Monday, 07 June 2021, 08:58 GMT
Last edited by Allan McRae (Allan) - Thursday, 01 July 2021, 01:55 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Allan McRae (Allan)
Eli Schwartz (eschwartz)
Architecture All
Severity Low
Priority Normal
Reported Version 6.0.0
Due in Version 6.0.1
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

man pages have a date in them.
This task depends upon

Closed by  Allan McRae (Allan)
Thursday, 01 July 2021, 01:55 GMT
Reason for closing:  Fixed
Additional comments about closing:  git commit b4383b8d007e28aa76324f45ad19e7878975074a
Comment by Allan McRae (Allan) - Monday, 07 June 2021, 09:06 GMT
We used to distribute prebuild man pages, but they did not reflect configure options (always had conf files in /etc/). Going back to that approach is not ideal.
Comment by Jonas Witschel (diabonas) - Friday, 25 June 2021, 11:17 GMT
The issue is the use of the "date" command in doc/meson.build to calculate "pacman_date": https://gitlab.archlinux.org/pacman/pacman/-/blob/542910d684191eb7f25ddc5d3d8fe3060028a267/doc/meson.build#L28

"pacman_date" in turn gets embedded into the man page through doc/asciidoc.conf: https://gitlab.archlinux.org/pacman/pacman/-/blob/542910d684191eb7f25ddc5d3d8fe3060028a267/doc/asciidoc.conf#L53
Comment by Jonas Witschel (diabonas) - Friday, 25 June 2021, 11:29 GMT
If I understand correctly, fixing this should be as simple as removing "pacman_date" and replacing it by "localdate" in doc/asciidoc.conf, as that variable respects SOURCE_DATE_EPOCH (https://asciidoc.org/manpage.html#_environment_variables) and has the desired ISO 8601 format (https://docs.asciidoctor.org/asciidoc/latest/attributes/document-attributes-reference/).
Comment by Jonas Witschel (diabonas) - Friday, 25 June 2021, 12:04 GMT Comment by Allan McRae (Allan) - Friday, 25 June 2021, 12:07 GMT
Thanks for investigating. I can confirm those changes work:

Pacman 6.0.0-8-ga519 1970-01-01 PACMAN(8)
Comment by Eli Schwartz (eschwartz) - Friday, 25 June 2021, 13:19 GMT
https://git.archlinux.org/users/eschwartz/pacman.git/log/?h=build-always-stale-version

I've been working on getting more git metadata into the build. I was going to try to see if I can get the date specified via 'git log -1 --format=%cs' and stored in a file for 'git archive' or 'meson dist' and used for the asciidoc build as the logical next step.

The man pages would then do something a bit novel, and guarantee to refer to the date of the code they document, rather than the date that some potentially very old source code got unpacked and compiled. :D
Comment by Eli Schwartz (eschwartz) - Friday, 25 June 2021, 13:21 GMT
The autotools built man pages with potentially incorrect configure options did have the correct date by virtue of being built on the date that make dist was run... unless you tried to rebuild them, of course.

This is not atypical for man pages in projects everywhere. :(

Loading...