all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludovic.courtes@inria.fr>
To: Konrad Hinsen <konrad.hinsen@fastmail.net>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Towards reproducibly Jupyter notebooks with Guix-Jupyter
Date: Thu, 24 Oct 2019 12:26:25 +0200	[thread overview]
Message-ID: <87ftjih226.fsf@inria.fr> (raw)
In-Reply-To: <m1zhhtt4nk.fsf@fastmail.net> (Konrad Hinsen's message of "Tue, 22 Oct 2019 13:12:47 +0200")

Hi Konrad,

Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

>> Depending on the use case, another option is to not use inferiors at all
>> and simply do:
>>
>>   guix pull --commit=XYZ -p ./my-old-guix
>>   ./my-old-guix/bin/guix environment --ad-hoc whatevern
>>
>> But maybe I’m missing something, let me know.  :-)
>
> That was my starting point. It's OK for manual execution, but if I want
> an Org-Mode file to this automatically, I need to generate a temporary
> file in place of ./my-old-guix with all the associated hassles: check
> that it doesn't exist before, and clean up in the end even in the case
> of errors. Maybe I'd even have to worry about two processes accessing
> the same temporary file and do some locking.

I see.  In a way one could argue that it’s not Guix’ problem, but OTOH
it’s clearly a problem that Guix doesn’t make it more convenient.

> I ended up finding an approach that does work, though it relies on
> undocumented properties:
>
>    (use-modules (guix channels)
>                 (guix inferior))
>
>    (define channels
>      (list (channel
>             (name 'guix)
>             (url "https://git.savannah.gnu.org/git/guix.git")
>             (commit
>              "44881cad93801de9462d469500d582af79b99959"))))
>
>    (define inferior
>      (inferior-for-channels channels))
>
>    (define inferior-executable
>      (inferior-eval
>       '(car (program-arguments))
>       inferior))
>
>    (define inferior-command-line
>      (cons inferior-executable (cdr (program-arguments))))
>
>    (apply system* inferior-command-line)
>
> This script uses the inferior mechanism for creating and caching an
> older guix, but then calls its executable directly.
>
> Of course this idea could be implemented in a better way, by factoring
> out the caching mechanism from inferior-for-channels and providing a
> command-line interface. Something like
>
>    guix time-machine channels.scm command args ...
>
> Does this sound reasonable? I volunteer for implementing this, but I'd
> like to have an expert opinion first.

That sounds reasonable to me: it’s a simple and easily-understood UI
(easier than the ‘guix pull -p’ dance!), and the implementation should
be easy (thus the maintenance cost is very low).

Looking forward to a patch!  :-)

Thank you,
Ludo’.

  reply	other threads:[~2019-10-24 10:26 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  8:21 Towards reproducibly Jupyter notebooks with Guix-Jupyter Ludovic Courtès
2019-10-10  8:59 ` zimoun
2019-10-10 10:07   ` Ludovic Courtès
2019-10-10 11:02   ` Konrad Hinsen
2019-10-10 14:52     ` Ludovic Courtès
2019-10-14  6:35       ` Konrad Hinsen
2019-10-14  7:21         ` Ludovic Courtès
2019-10-14 11:45           ` Konrad Hinsen
2019-10-14 13:25             ` Ludovic Courtès
2019-10-21 12:50               ` Konrad Hinsen
2019-10-22 10:16                 ` Ludovic Courtès
2019-10-22 11:12                   ` Konrad Hinsen
2019-10-24 10:26                     ` Ludovic Courtès [this message]
2019-10-25  9:21                       ` Konrad Hinsen
2019-10-29 14:16                         ` Konrad Hinsen
2019-10-29 15:00                           ` Pierre Neidhardt
2020-02-27 14:25                             ` Pjotr Prins
2020-02-27 14:36                               ` zimoun
2020-02-27 18:11                                 ` Pjotr Prins
2020-02-27 18:20                                   ` zimoun
2020-02-27 18:43                                     ` Vincent Legoll
2020-02-27 18:49                                       ` zimoun
2020-02-27 19:38                                         ` Ricardo Wurmus
2020-02-27 19:48                                           ` zimoun
2019-10-23  9:53                   ` Konrad Hinsen
2019-10-23 10:32                     ` zimoun
2019-10-23 12:15                       ` Konrad Hinsen
2019-10-23 16:49                         ` zimoun
2019-10-24  6:20                           ` Konrad Hinsen
2019-10-24 13:23                             ` Pierre Neidhardt
2019-10-25 14:29                               ` Konrad Hinsen
2019-10-25 14:40                                 ` Pierre Neidhardt
2019-10-10 10:19 ` Roel Janssen
2019-10-10 11:59   ` Ludovic Courtès
2019-10-10 14:57   ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ftjih226.fsf@inria.fr \
    --to=ludovic.courtes@inria.fr \
    --cc=guix-devel@gnu.org \
    --cc=konrad.hinsen@fastmail.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.