From: Chris Marusich <cmmarusich@gmail.com>
To: zimoun <zimon.toutoune@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: persistent reproducibility ?
Date: Thu, 23 Mar 2017 22:39:52 -0700 [thread overview]
Message-ID: <87d1d7cjx3.fsf@gmail.com> (raw)
In-Reply-To: <CAJ3okZ2erRX_oPveaFR7RDNGCrm10BPSDQjB-iKSSPCDd2esbA@mail.gmail.com> (zimoun's message of "Wed, 22 Mar 2017 18:39:58 +0100")
zimoun <zimon.toutoune@gmail.com> writes:
> Maybe `archive' or `pack' already do the job ? Something able to pack
> at the source level all the necessary materials to reproduce from
> scratch a bit-identical environment.
What about using 'guix archive' in combination with the 'guix build
--sources=transitive' command? The manual explains ((guix) Additional
Build Options), the "--sources=transitive" option means:
"Build the source derivations of all packages, as well of all transitive
inputs to the packages. This can be used e.g. to prefetch package
source for later offline building."
Here's an example for the GNU Hello package:
--8<---------------cut here---------------start------------->8---
$ guix build --sources=transitive hello
/gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz
/gnu/store/cz1b1hn763zppafmlxsrlj7fnxa8zcna-tar-1.29.tar.xz
/gnu/store/f63c6mjqqai6xwypx5qslvqc2d302yn5-gzip-1.8.tar.xz
/gnu/store/bjpalrv9f49d2k40p7ga0y6dwdys9w5j-bzip2-1.0.6.tar.gz
/gnu/store/1pcksb758j9v7srain0k3fqp57h9gwmj-xz-5.2.2.tar.gz
/gnu/store/r56rrdk6h0zwb1d2y28q3bk71n73z84m-file-5.28.tar.gz
/gnu/store/rbaa5s5jpy91npas89q3p8yasrc6mr1h-diffutils-3.5.tar.xz
/gnu/store/iaigwb3k7fg0v8zrwlb4yhrdsgin6ir7-patch-2.7.5.tar.xz
/gnu/store/g0mffc9c0nxbwf0a6j0akh0dvkd2sn6w-sed-4.2.2.tar.xz
/gnu/store/76q5cqkqrx7paxhq27m3izag07n1vjs4-findutils-4.6.0.tar.xz
/gnu/store/vgs8flhpxbkgx0hx54hnihpai7lma72j-gawk-4.1.4.tar.xz
/gnu/store/5q4yicgzxrv13gq4rai6h07s7xp75ws6-grep-2.25.tar.xz
/gnu/store/8dqf59312llnmln89ccas1saq0z4qwi7-coreutils-8.25.tar.xz
/gnu/store/2g7nf5h6hnsz1sharnqxfjz9m6k7224z-make-4.2.1.tar.xz
/gnu/store/xwanyg9972rpznx89ja38v01c8483392-bash-4.4.tar.gz
/gnu/store/iv2nz8r001lpric4kr2xq3459zwl8051-binutils-2.27.tar.xz
/gnu/store/z2s847iq14psryslylm1x4k71b0vx4ng-gcc-4.9.4.tar.xz
/gnu/store/m9jym12mhczjrslpycwi6ipw57v849pa-gmp-6.0.0a.tar.xz
/gnu/store/xg7ir7g2yvxj9ixmgy2kfds690h3f6gg-mpfr-3.1.4.tar.xz
/gnu/store/y9akh452n3p4w2v631nj0injx7y0d68x-mpc-1.0.3.tar.gz
/gnu/store/z8mm3izh1hgllm6mlqzycsrx5nfkvhxi-glibc-2.24.tar.xz
/gnu/store/51f2f2ck80migsfr2hwy4ds30966lifi-linux-libre-4.4.18-gnu.tar.xz
--8<---------------cut here---------------end--------------->8---
You could archive those sources for later importation into the store on
another system. For example:
guix archive --export \
$(guix build --sources=transitive hello) > hello-transitive-source.nar
If you import that archive (with 'guix archive --import') and build it
using the same version of the package definitions, theoretically it
should build even if the sources are no longer available for download
from their specified origin locations.
You could even do more. By using 'guix gc', you could also include all
of the store items which are required to run GNU Hello:
--8<---------------cut here---------------start------------->8---
$ guix gc --requisites $(guix build hello)
/gnu/store/rvgmixpmsq5lqr9qflhkm70kg7a4rys2-bash-static-4.4.0
/gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24
/gnu/store/cdi08kw7r6r684w8mk0xq0dkgpjhfpmd-gcc-4.9.4-lib
/gnu/store/rvs42awwwby7pq3j0znglmz3vyznvbh1-hello-2.10
--8<---------------cut here---------------end--------------->8---
Combine those two commands, and you should be able to export an archive
which contains all the files necessary to run GNU Hello, in addition to
all the sources necessary to build GNU Hello reproducibly (provided that
GNU Hello builds reproducibly, and provided that you build it using the
same version of the package definitions):
guix archive --export \
$(guix gc --requisites $(guix build hello)) \
$(guix build --sources=transitive hello) > hello-requisites-and-sources.nar
You would also have to trust the key that was used to sign the archive
in order to import it (see 'guix archive --authorize').
By the way, in case you were wondering, one reason why we don't put the
sources for every package into the Guix source tree is because that
would make the Guix source tree prohibitively large. The transitive
closure of sources for GNU Hello alone weighs in at 1750 MiB (wow!) when
uncompressed. And that's only for those specific versions of the source
files.
--
Chris
next prev parent reply other threads:[~2017-03-24 5:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-21 11:15 persistent reproducibility ? zimoun
2017-03-21 14:49 ` Alex Sassmannshausen
2017-03-21 16:19 ` Ludovic Courtès
2017-03-22 17:39 ` zimoun
2017-03-23 8:44 ` Alex Sassmannshausen
2017-03-23 15:33 ` zimoun
2017-03-23 12:32 ` Ricardo Wurmus
2017-03-23 16:46 ` zimoun
2017-03-24 15:45 ` Ludovic Courtès
2017-03-25 13:07 ` zimoun
2017-03-24 5:39 ` Chris Marusich [this message]
2017-03-24 12:05 ` Quiliro
2017-03-26 9:39 ` Chris Marusich
2017-03-26 15:03 ` Quiliro
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=87d1d7cjx3.fsf@gmail.com \
--to=cmmarusich@gmail.com \
--cc=help-guix@gnu.org \
--cc=zimon.toutoune@gmail.com \
/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).