unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Skyler Ferris <skyvine@protonmail.com>
To: help-guix@gnu.org
Subject: Proper use of `guix build X --rounds=2`
Date: Sun, 18 Feb 2024 19:06:43 +0000	[thread overview]
Message-ID: <2d797b5b-5bc7-4f68-8287-be148ba6bacd@protonmail.com> (raw)

Hello,

Checking a package for reproducibility is one important part of patch 
review. Based on the documentation for the `--rounds=N`, I expect that a 
line such as `guix build foo --rounds=2` will build the package at least 
once and at most twice (assuming that, if the output is already present 
in the store, it will only build it once and compare it to the 
previously existing store entry; but if it does not do this optimization 
then the question in this email remains valid). However, this seems not 
to be the case. I tested using this simple package definition:

test.scm
```
(use-modules (guix build-system trivial) (guix gexp) (guix packages))
(package
   (build-system trivial-build-system)
   (arguments (list
     #:builder
     #~(begin
         (mkdir #$output)
         (sleep 60))))

   (name "test")
   (version "0.0")
   (source #f)
   (description #f)
   (synopsis #f)
   (home-page #f)
   (license #f))
```

If I first build using `time guix build -f test.scm`, then it takes more 
than a minute to run as expected. If I run the same command again then 
it takes about a second to run, which is also as expected because guix 
sees that the output has already been built. But if I then run `time 
guix build -f test.scm --rounds=2`, it still takes about a second to run 
which means that it's not building the package a second time.

Interestingly, if I change the package (for example, by changing the 
version number to "0.1") and then run `time guix build -f test.scm 
--rounds=2` (WITHOUT building normally first, so there is no 
pre-existing store entry) then it takes just over 2 minutes to run, 
implying that it built the package twice serially.

Am I using the `--rounds` flag wrong, do I misunderstand this tool, or 
is this actually a bug?

Regards,
Skyler



             reply	other threads:[~2024-02-18 19:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-18 19:06 Skyler Ferris [this message]
2024-02-18 23:23 ` Proper use of `guix build X --rounds=2` Carlo Zancanaro
2024-02-19 18:48   ` Skyler Ferris

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=2d797b5b-5bc7-4f68-8287-be148ba6bacd@protonmail.com \
    --to=skyvine@protonmail.com \
    --cc=help-guix@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.
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).