all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 45919@debbugs.gnu.org
Subject: [bug#45919] [PATCH 0/8] Exporting a manifest and channels from a profile
Date: Sat, 16 Jan 2021 19:29:57 +0100	[thread overview]
Message-ID: <20210116182957.31075-1-ludo@gnu.org> (raw)

Hi there!

Here’s a simple but oft-requested feature (I remember discussing
with Pierre and Simon a year ago at the Guix Days about ways to
implement it—time flies!): these patches provide ‘guix package
--export-manifest’ and ‘--export-channels’.  These options spit
a manifest and a channel spec, respectively, with the goal of
helping users who wish to migrate to the declarative model.

‘--export-manifest’ honors transformations: if entries in the
profile have associated transformations, those are preserved in
the generated manifest.  It also honors version specifiers (to
some extent); for example, if you have guile@2.2 in your profile,
it’ll put “guile@2.2” in the manifest, where “2.2” is the
shortest prefix to disambiguate it from the other available
versions of “guile”.

‘--export-channels’ does what you expect.  When several commits
of the same channel were used to build your profile, it picks
the last one and adds the other one in a comment.

There’s a catch though: it’s easy to get a large number of
commits.  For example, my main profile contains ~300 packages.
I usually upgrade everything at once, so you’d expect to see
a single commit for the ‘guix’ channel.  But that’s not the
case: when running ‘guix upgrade’, entries that do not need
to be upgraded are left unchanged, and thus they carry their
original commit.  For my profile, the result is:

--8<---------------cut here---------------start------------->8---
$ guix package --export-channels
;; This channel file can be passed to 'guix pull -C' or to
;; 'guix time-machine -C' to obtain the Guix revision that was
;; used to populate this profile.

(list
     ;; Note: these other commits were also used to install some of the packages in this profile:
     ;;   "458cb25b9e7e7c954f468023abea2bebb5d8c75b"
     ;;   "4969b51d175497bfcc354c91803e9d70542b7113"
     ;;   "3d85c3ec652feb22824f355538b51e6955ded361"
     ;;   "3462678bc346c2f6ea81245d6842264b6dccd945"
     ;;   "74eeb11daee906cb012f10b6bb3afd254f9ea5c2"
     ;;   "e1f5c2292b88525414b5d0336a00bfa6741d4f14"
     ;;   "3bdb2a026bc9d3967a31a2ccbcd670c018f85d3d"
     ;;   "bf986c3e4325594c1c6a43cf0b67b92262842863"
     ;;   "7607ace5091aea0157ba5c8a508129cc5fc4f931"
     ;;   "98b89f432103b66efacee0bcba41a94148b8e870"
     ;;   "7090159c23d6345992ab976d71fefeb1583cfcdf"
     ;;   "c6872990b51971922f3064cba54ab752fcdc1559"
     ;;   "6ee7468758d7c043692ae8c0b5e130fa4eabe94c"
     ;;   "9744cc7b4636fafb772c94adb8f05961b5b39f16"
     ;;   "d8feee9f18ede0d1ea4d0e4876f09a0dab770295"
     ;;   "b76b1d3fb65fec98b96a2b4cfa984316dd956a29"
     (channel
       (name 'guix)
       (url "/home/ludo/src/guix")
       (commit
         "c6ca0fceb715340cfb2ba01bfec128aa8d385b92")
       (introduction
         (make-channel-introduction
           "9edb3f66fd807b096b48283debdcddccfea34bad"
           (openpgp-fingerprint
             "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA"))))
)
--8<---------------cut here---------------end--------------->8---

The long commit list doesn’t look great, but in fact the chosen
commit is almost certainly good enough.

I looked into ‘guix package’ to see if we could update provenance
data for manifest entries that are not upgraded because they’re
already up-to-date (so that we end up with fewer different commits),
and it’s tricky to do that, and maybe not desirable.  So I left it
at that.

Anyway, for me the goal of these options is not “disassemble” the
profile and provide its exact source code, but rather to help
migrate to the declarative model.  I think it does a good job
at that.

Thoughts?

Ludo’.

Ludovic Courtès (8):
  profiles: Add 'manifest->code'.
  utils: Add 'version-unique-prefix'.
  guix package: Add '--export-manifest'.
  channels: Factorize 'manifest-entry-channel' and channel
    serialization.
  channels: Add the channel name to channel sexps.
  guix describe: Use 'manifest-entry-channel'.
  channels: Add 'channel->code'.
  guix package: Add '--export-channels'.

 build-aux/build-self.scm  |   3 +
 doc/guix.texi             |  45 +++++++++++++
 guix/build/profiles.scm   |   6 +-
 guix/channels.scm         | 134 ++++++++++++++++++++++++++------------
 guix/describe.scm         |  34 +++++++++-
 guix/profiles.scm         |  86 +++++++++++++++++++++++-
 guix/scripts/describe.scm |  52 +++++----------
 guix/scripts/package.scm  | 118 ++++++++++++++++++++++++++++++++-
 guix/utils.scm            |  35 +++++++++-
 tests/guix-package.sh     |  10 ++-
 tests/profiles.scm        |  30 ++++++++-
 tests/utils.scm           |   8 ++-
 12 files changed, 471 insertions(+), 90 deletions(-)

-- 
2.30.0





             reply	other threads:[~2021-01-16 18:31 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-16 18:29 Ludovic Courtès [this message]
2021-01-16 18:34 ` [bug#45919] [PATCH 1/8] profiles: Add 'manifest->code' Ludovic Courtès
2021-01-16 18:34   ` [bug#45919] [PATCH 2/8] utils: Add 'version-unique-prefix' Ludovic Courtès
2021-01-16 18:34   ` [bug#45919] [PATCH 3/8] guix package: Add '--export-manifest' Ludovic Courtès
2021-01-16 18:34   ` [bug#45919] [PATCH 4/8] channels: Factorize 'manifest-entry-channel' and channel serialization Ludovic Courtès
2021-01-16 18:34   ` [bug#45919] [PATCH 5/8] channels: Add the channel name to channel sexps Ludovic Courtès
2021-01-16 18:34   ` [bug#45919] [PATCH 6/8] guix describe: Use 'manifest-entry-channel' Ludovic Courtès
2021-01-16 18:34   ` [bug#45919] [PATCH 7/8] channels: Add 'channel->code' Ludovic Courtès
2021-01-16 18:34   ` [bug#45919] [PATCH 8/8] guix package: Add '--export-channels' Ludovic Courtès
2021-01-27 13:14 ` bug#45919: [PATCH 0/8] Exporting a manifest and channels from a profile Ludovic Courtès
2021-01-27 21:02   ` [bug#45919] " zimoun
2021-01-28 15:54     ` Ludovic Courtès
2021-02-01 22:37       ` Unreproducible “guix pack -f docker” because config.scm-builder zimoun
2021-02-02 14:48         ` zimoun
2021-02-02 18:12         ` Ludovic Courtès
2021-02-02 20:11           ` zimoun
2021-02-05 10:09             ` Ludovic Courtès
2021-02-05 17:22               ` zimoun
2021-02-06 21:46                 ` Ludovic Courtès
2021-02-08 18:44                   ` [PATCH] Fix unreproducible “guix pack -f docker” (hard link) zimoun
     [not found]                   ` <86lfbzad42.fsf@gmail.com>
2021-02-09  8:35                     ` Unreproducible “guix pack -f docker” because config.scm-builder Ludovic Courtès
2021-02-09  8:51                       ` zimoun
2021-01-28 17:57     ` [bug#45919] [PATCH 0/8] Exporting a manifest and channels from a profile Bengt Richter
2021-01-29 19:13       ` zimoun
2021-01-28 17:04   ` bug#45919: " Pierre Neidhardt
2021-01-29 17:57     ` [bug#45919] " Pierre Neidhardt
2021-01-29 18:57       ` zimoun
2021-01-29 21:51         ` Pierre Neidhardt
2021-01-30 14:31           ` zimoun
2021-01-30 21:23             ` bug#45919: " Ludovic Courtès
2021-01-31  5:08               ` Ryan Prior
2021-02-01 13:30                 ` Ludovic Courtès
2021-01-30 13:55       ` Ludovic Courtès
2021-01-31 17:26         ` Pierre Neidhardt
2021-02-01 13:25           ` Ludovic Courtès
2021-02-01 15:32             ` Pierre Neidhardt
2021-02-01 17:04               ` 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=20210116182957.31075-1-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=45919@debbugs.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 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.