[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Proper use of `guix build X --rounds=2`
From: |
Skyler Ferris |
Subject: |
Proper use of `guix build X --rounds=2` |
Date: |
Sun, 18 Feb 2024 19:06:43 +0000 |
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
- Proper use of `guix build X --rounds=2`,
Skyler Ferris <=