unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29654: Manual database index.db embeds timestamps
@ 2017-12-10 22:47 Ruud van Asseldonk
  2017-12-15 21:30 ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Ruud van Asseldonk @ 2017-12-10 22:47 UTC (permalink / raw)
  To: 29654

The manual database file index.db embeds mtimes of the files it refers
to, making it not reproducible. This is an issue for building
reproducible profiles (as produced by `guix pack` for example).

The number that are not reproducible can be seen with `accessdb
index.db`, which will output something like

$version$ -> "2.5.0"
acme-client -> "- 1 1 1512941854 498178709 B - - gz secure ACME client"

And when built again on a clean installation:

$version$ -> "2.5.0"
acme-client -> "- 1 1 1512942998 296814690 B - - gz secure ACME client"

I asked the man-db maintainer about this, who replied:

> Those are timestamps, seconds and nanoseconds respectively.  You should
> get reproducible output if you make sure the mtimes of manual pages are
> reproducible.  (man-db needs to keep track of mtimes so that it knows
> when a database is out of date.)  If the manual pages come straight from
> the source package, this should be straightforward; if they're
> generated, you'll need some strategy to ensure that they're generated
> with a reproducible mtime.

Now the strange thing is, when I check the profile directory, both the
man file symlinks, and the files they refer to, have the mtime set to
epoch. I suspected that the mtime would be reset after the manual
database had already been built, but inserting calls to utime after
`(symlink manpage dest-file)` in the `manual-database` procedure, did
not resolve the issue.

The mtime that ends up in index.db does correspond to a recent time, and
for larger databases the timestamps can differ among entries, but so far
I have only seen them differ in the nanoseconds. The seconds timestamp
looks like the timestamp at which the database was generated. So either
the mtime of the input files is not epoch when man-db runs, or man-db is
somehow setting the mtime of every entry to the current time as it adds
them.

I looked at the man-db source and I did not find anything that looked
like it was storing current times as mtimes in the database, although I
did not look very carefully. I suspect that the mtimes of the files to
scan are actually wrong. It should be possible to confirm this by
introducing a delay when creating the man files, and when making the
symlinks, and seeing if the delay shows up in the database.

Help with diagnosing this further, or ideas about what could be going on
and how to resolve it, would be appreciated. I am willing to work on a
fix, but I am not very familiar with Guix yet.

Kind regards,

Ruud van Asseldonk

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-12-17 21:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-10 22:47 bug#29654: Manual database index.db embeds timestamps Ruud van Asseldonk
2017-12-15 21:30 ` Ludovic Courtès
2017-12-15 21:54   ` Ludovic Courtès
2017-12-16  0:35   ` Ricardo Wurmus
2017-12-16 23:51     ` Ludovic Courtès
2017-12-17  0:04       ` Ludovic Courtès
2017-12-17  0:26         ` bug#29654: GDBM output is not deterministic Ludovic Courtès
2017-12-17  9:19           ` Sergey Poznyakoff
2017-12-17 16:27         ` bug#29654: Manual database index.db embeds timestamps Ludovic Courtès
2017-12-17 19:51           ` Ruud van Asseldonk
2017-12-17 21:32             ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).