all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Proper use of `guix build X --rounds=2`
@ 2024-02-18 19:06 Skyler Ferris
  2024-02-18 23:23 ` Carlo Zancanaro
  0 siblings, 1 reply; 3+ messages in thread
From: Skyler Ferris @ 2024-02-18 19:06 UTC (permalink / raw)
  To: help-guix

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



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

end of thread, other threads:[~2024-02-19 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-18 19:06 Proper use of `guix build X --rounds=2` Skyler Ferris
2024-02-18 23:23 ` Carlo Zancanaro
2024-02-19 18:48   ` Skyler Ferris

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.