[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26271: 'guix system' does not support common build option '--root'

From: Chris Marusich
Subject: bug#26271: 'guix system' does not support common build option '--root'
Date: Thu, 06 Apr 2017 00:05:49 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

>> From ccf03e4bb5d5c2d3a47efdf64e36a7d903bfb2c5 Mon Sep 17 00:00:00 2001
>> From: Chris Marusich <address@hidden>
>> 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.

Thank you!

>> From e96c877459555f4cf868fb5fe4579183f6a773d5 Mon Sep 17 00:00:00 2001
>> From: Chris Marusich <address@hidden>
>> 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?

Thank you for reminding me that we can do it this way!  I've updated the
patch and verified that it still works.

> Also please make sure to mention ‘--root’ in ‘show-help’ and in
> guix.texi.

In the attached patch series, I've mentioned '--root' in 'show-help'.
However, since there is already a link in the '(guix) Invoking guix
system)' section to the section which describes the common build options
((guix) Common Build Options), I decided not to duplicate the
documentation for '--root' in that section.

If you still think we should mention '--root' in '(guix) Invoking guix
system)', let me know and I will submit another small patch to add it.

Now we can generate system images without fear of the reaper!  The
garbage reaper, that is :-)


Attachment: 0001-build-Add-and-export-procedure-register-root.patch
Description: Text Data

Attachment: 0002-system-Support-the-root-option-in-guix-system.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]