From: ludo@gnu.org (Ludovic Courtès)
To: Chris Marusich <cmmarusich@gmail.com>
Cc: 26271@debbugs.gnu.org
Subject: bug#26271: 'guix system' does not support common build option '--root'
Date: Tue, 04 Apr 2017 23:34:31 +0200 [thread overview]
Message-ID: <87zifvn9g8.fsf@gnu.org> (raw)
In-Reply-To: <87zifwaafz.fsf@garuda.i-did-not-set--mail-host-address--so-tickle-me> (Chris Marusich's message of "Tue, 04 Apr 2017 00:39:12 -0700")
Hi Chris,
Chris Marusich <cmmarusich@gmail.com> skribis:
> I've attached a small patch series which adds support. Please let me
> know what you think. (If you prefer that I send the patches to you via
> some other email list or something, please let me know.) I've verified
> manually that the patches fix the issue. For example:
>
> $ GUIX_BUILD_OPTIONS='--root=my-indirect-root' ./pre-inst-env guix system disk-image ~/guix/gnu/system/install.scm
> /gnu/store/qr83vk7lifm63jscrv1gfqzj80zwkmca-disk-image
> $ ls -l | grep indir
> lrwxrwxrwx 1 marusich users 54 Apr 3 23:44 my-indirect-root -> /gnu/store/qr83vk7lifm63jscrv1gfqzj80zwkmca-disk-image
> $ ls -l /var/guix/gcroots/auto/ | grep indir
> lrwxrwxrwx 1 root root 36 Apr 3 23:44 wk6bx8f7xjq8ab7dz683n64ly21dyw8x -> /home/marusich/guix/my-indirect-root
>
> It works the same when I pass the option directly on the command line as
> '--root=foo' or '-r foo', too.
Nice.
> From ccf03e4bb5d5c2d3a47efdf64e36a7d903bfb2c5 Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich@gmail.com>
> Date: Mon, 3 Apr 2017 23:47:22 -0700
> Subject: [PATCH 1/2] build: Export register-root procedure.
>
> * guix/scripts/build.scm: Export register-root procedure.
Applied.
> From e96c877459555f4cf868fb5fe4579183f6a773d5 Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich@gmail.com>
> Date: Mon, 3 Apr 2017 23:49:22 -0700
> Subject: [PATCH 2/2] system: Support the --root option in 'guix system'.
>
> Fixes <https://bugs.gnu.org/26271>.
>
> * guix/scripts/system.scm (perform-action): Add parameters 'store' and
> 'gc-root'. Update docstring.
> (perform-action) [gc-root]: Add an indirect GC root using store.
> (%options): Add 'root'.
> (process-action): Pass 'store' and 'root' to perform-action.
[...]
> -(define* (perform-action action os
> +(define* (perform-action store action os
> #:key grub? dry-run? derivations-only?
> use-substitutes? device target
> image-size full-boot?
> - (mappings '()))
[...]
> ;; All we had to do was to build SYS.
> - (return (derivation->output-path sys))))))))
> + (return (let ((output-path (derivation->output-path sys)))
> + (if gc-root
> + (register-root store (list output-path) gc-root)
> + output-path)))))))))
‘perform-action’ is a monadic procedure; IOW, the ‘store’ parameter is
already threaded into it. Thus, instead of adding an explicit ‘store’
parameter, which must “lift” ‘register-root’ in the store monad:
(define register-root*
(store-lift register-root))
and then use it like a normal monadic procedure:
(let ((output (derivation->output-path sys)))
(mbegin %store-monad
(mwhen gc-root
(register-root* (list output) gc-root))
(return output)))
Could you change this patch along these lines?
Also please make sure to mention ‘--root’ in ‘show-help’ and in
guix.texi.
Thank you!
Ludo’.
next prev parent reply other threads:[~2017-04-04 21:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-27 4:54 bug#26271: 'guix system' does not support common build option '--root' Chris Marusich
2017-03-27 8:58 ` Ludovic Courtès
2017-03-27 14:12 ` Chris Marusich
2017-04-04 7:39 ` Chris Marusich
2017-04-04 21:34 ` Ludovic Courtès [this message]
2017-04-06 7:05 ` Chris Marusich
2017-04-06 8:23 ` 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
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=87zifvn9g8.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=26271@debbugs.gnu.org \
--cc=cmmarusich@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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).