all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Ruud van Asseldonk <dev+guix@veniogames.com>, 29654@debbugs.gnu.org
Subject: bug#29654: Manual database index.db embeds timestamps
Date: Sat, 16 Dec 2017 01:35:12 +0100	[thread overview]
Message-ID: <87po7fo6gv.fsf@elephly.net> (raw)
In-Reply-To: <87mv2jfzmi.fsf@gnu.org>


Hi Ludo,

> I was already motivated to create the database directly from Scheme
> (‘man-db’ is quite slow), so that gave me an additional excuse.  ;-)
>
> The attached patch does that.  The timestamps are always set to zero.

That’s great!

> Unfortunately, this is not fully deterministic: when running --check
> several times in a row, I occasionally get different results.  I suspect
> GDBM’s output is not fully deterministic.

Hmm, I dumped the contents of the generated databases with gdbm_dump and
couldn’t find any difference aside from the header (which is produced by
gdbm_dump itself).  Diffoscope shows a lot of differences, though.

I thought that maybe the difference comes from the fact that upon adding
new entries gdbm grows the hash table.  After setting the initial size
to a multiple of the number of entries I haven’t been able to generate a
non-reproducible database.

My only change is in “write-mandb-database”:

  (gdbm-open file GDBM_WRCREAT #:block-size (* 512 (length entries)))

I tried this:

    ./pre-inst-env guix package -p foo -i coreutils guile
    for i in `seq 30`; do ./pre-inst-env guix build --check -K /gnu/store/pg3684khpj69py40v7p76b90r9q4j2lv-manual-database.drv; done

Seems fine.  Coincidence or did I get lucky?

> +(define (entry->string entry)
> +  "Return the wire format for ENTRY as a string."
> +  (match entry
> +    (($ <mandb-entry> file name section synopsis)
> +     (string-append (abbreviate-file-name file) "\t"
> +                    (number->string section) "\t"
> +                    (number->string section)
> +
> +                    ;; Timestamps, that we always set to the epoch.
> +                    "\t0\t0"
> +
> +                    ;; XXX: Weird things.
> +                    "\tB\t-\t-\tgz\t"

What’s that?

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

  parent reply	other threads:[~2017-12-16  0:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87po7fo6gv.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=29654@debbugs.gnu.org \
    --cc=dev+guix@veniogames.com \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.