unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45919] [PATCH 0/8] Exporting a manifest and channels from a profile
@ 2021-01-16 18:29 Ludovic Courtès
  2021-01-16 18:34 ` [bug#45919] [PATCH 1/8] profiles: Add 'manifest->code' Ludovic Courtès
       [not found] ` <87wnvyv7w6.fsf@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Ludovic Courtès @ 2021-01-16 18:29 UTC (permalink / raw)
  To: 45919

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





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-02-01 17:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-16 18:29 [bug#45919] [PATCH 0/8] Exporting a manifest and channels from a profile Ludovic Courtès
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
     [not found] ` <87wnvyv7w6.fsf@gnu.org>
     [not found]   ` <871re5t2lg.fsf@ambrevar.xyz>
2021-01-29 17:57     ` [bug#45919] [PATCH 0/8] Exporting a manifest and channels from a profile Pierre Neidhardt
     [not found]       ` <865z3fh8pn.fsf@gmail.com>
     [not found]         ` <87eei3quma.fsf@ambrevar.xyz>
2021-01-30 14:31           ` zimoun
     [not found]       ` <87o8h6fs1n.fsf_-_@gnu.org>
     [not found]         ` <875z3dqaq5.fsf@ambrevar.xyz>
     [not found]           ` <8735yfhqcd.fsf_-_@gnu.org>
     [not found]             ` <87v9bbolbq.fsf@ambrevar.xyz>
2021-02-01 17:04               ` bug#45919: " Ludovic Courtès

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).