Subject: [PATCH 0/2] Add (guix inferior) and improve 'guix pull -l'
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Cc: Ludovic Courtès <[email-masked]>
Date: Tue, 10 Jul 2018 18:45:59 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello Guix!

This patch adds (guix inferior), a module to interact with an inferior Guix
process, along with a ‘guix repl’ command, which spawns a REPL optionally a
simple sexp-based protocol.

‘guix pull -l’ uses (guix inferior) to display this:

--8<---------------cut here---------------start------------->8---
Generation 1	Jun 10 2018 00:18:18
  guix 65956ad
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: origin/master
    commit: 65956ad3526ba09e1f7a40722c96c6ef7c0936fe
Generation 2	Jun 11 2018 11:02:49
  guix e0cc7f6
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: origin/master
    commit: e0cc7f669bec22c37481dd03a7941c7d11a64f1d
  2 new packages: keepalived, libnfnetlink
  6 packages upgraded: [email-masked], [email-masked],
    [email-masked], [email-masked], [email-masked], [email-masked]
Generation 3	Jun 13 2018 23:31:07
  guix 844cc1c
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: origin/master
    commit: 844cc1c8f394f03b404c5bb3aee086922373490c
  28 new packages: emacs-helm-ls-git, emacs-helm-mu, emacs-helm-pass, emacs-image+,
    emacs-package-lint, emacs-puppet-mode, emacs-wgrep-helm, go-github-com-gorilla-mux,
    go-github-com-jonboulle-clockwork, go-github-com-spf13-pflag, libostree, ovmf-aarch64, ovmf-arm, qtwebglplugin,
    qtwebview, r-ellipse, r-factoextra, r-factominer, r-flashclust, r-ggpubr, r-ggsci, r-ggsignif, r-hdf5r,
    r-nbclust, r-writexl, skopeo, umoci, vkd3d
  69 packages upgraded: [email-masked], [email-masked], [email-masked], efivar@36, [email-masked],
    [email-masked], [email-masked], [email-masked], [email-masked], [email-masked],
    [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked],

[...]

--8<---------------cut here---------------end--------------->8---

It takes about one second per generation on my SSD-powered laptop, though, so
we might want to have a persistent cache of each generation’s package list.

Eventually I think we can use (guix inferior) for other purposes.  For example,
hpcguix-web should use it to regularly grab the latest package list.  And, we
could add a gexp compiler for <inferior-package> such that one can seamlessly
refer to packages coming from a different Guix version.  Then, if we wanted to,
we could have ‘guix package’ & co. allow you to specify packages coming from
a different Guix.  Could be fun!

Thoughts?  Comments?

Ludo’.

Ludovic Courtès (2):
  Add (guix inferior) and (guix scripts repl).
  pull: Use (guix inferior) to display new and upgraded packages.

 Makefile.am           |   3 +
 doc/guix.texi         |  59 +++++++++++++
 guix/inferior.scm     | 197 +++++++++++++++++++++++++++++++++++++++++
 guix/scripts/pull.scm |  91 ++++++++++++++++---
 guix/scripts/repl.scm | 199 ++++++++++++++++++++++++++++++++++++++++++
 tests/inferior.scm    |  69 +++++++++++++++
 6 files changed, 607 insertions(+), 11 deletions(-)
 create mode 100644 guix/inferior.scm
 create mode 100644 guix/scripts/repl.scm
 create mode 100644 tests/inferior.scm

-- 
2.18.0