unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: David Craven <david@craven.ch>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] system: Remove spec->file-system.
Date: Sun, 04 Dec 2016 16:48:21 +0100	[thread overview]
Message-ID: <87oa0r7l16.fsf@gnu.org> (raw)
In-Reply-To: <20161202183716.25174-1-david@craven.ch> (David Craven's message of "Fri, 2 Dec 2016 19:37:16 +0100")

David Craven <david@craven.ch> skribis:

> * gnu/system/file-systems.scm (spec->file-system): Remove variable.
> * gnu/system/linux-container.scm (container-script): Refactor.

[...]

> --- a/gnu/system/linux-container.scm
> +++ b/gnu/system/linux-container.scm
> @@ -81,8 +81,7 @@ MAPPINGS is a list of <file-system> objects that specify the files/directories
>  that will be shared with the host system."
>    (let* ((os           (containerized-operating-system os mappings))
>           (file-systems (filter file-system-needed-for-boot?
> -                               (operating-system-file-systems os)))
> -         (specs        (map file-system->spec file-systems)))
> +                               (operating-system-file-systems os))))
>  
>      (mlet* %store-monad ((os-drv (operating-system-derivation
>                                    os
> @@ -94,10 +93,9 @@ that will be shared with the host system."
>                                    (gnu build linux-container)))
>            #~(begin
>                (use-modules (gnu build linux-container)
> -                           (gnu system file-systems) ;spec->file-system
>                             (guix build utils))
>  
> -              (call-with-container (map spec->file-system '#$specs)
> +              (call-with-container #$file-systems

AFAICS that doesn’t work because <file-system> and records in general
are not automatically marshalled/unmarshalled when staging code.  Thus,
the above would leave to an invalid on-disk s-expression like this:

  (begin
    (use-modules …)
    (call-with-container (#<<file-system> …> #<<file-system> …>)
      …))

Manually calling ‘file-system->spec’ on the host side, and then
‘spec->file-system’ on the build side is a way to explicitly
marshall/unmarshall the record (I mentioned it as a current limitation
of gexps in my Scheme Workshop talk).

Makes sense?

Thanks,
Ludo’.

  parent reply	other threads:[~2016-12-04 15:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 18:37 [PATCH] system: Remove spec->file-system David Craven
2016-12-02 23:23 ` David Craven
2016-12-04 15:48 ` Ludovic Courtès [this message]
2016-12-04 16:19   ` David Craven
2016-12-05 20:58     ` 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=87oa0r7l16.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=david@craven.ch \
    --cc=guix-devel@gnu.org \
    /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).