From: zimoun <zimon.toutoune@gmail.com>
To: "Guix Devel" <guix-devel@gnu.org>, "Ludovic Courtès" <ludo@gnu.org>
Subject: Unexpected --export-manifest with simple transformations
Date: Wed, 10 Feb 2021 02:36:10 +0100 [thread overview]
Message-ID: <868s7wbt6d.fsf@gmail.com> (raw)
Hi,
If the transformations are in the manifest.scm file, then they are
lost. For example, consider:
--8<---------------cut here---------------start------------->8---
$ guix package \
-p /tmp/profile-cli \
-i python python-numpy \
hello --with-c-toolchain=hello=gcc-toolchain@10
guix package: warning: transformation 'with-c-toolchain' had no effect on python@3.8.2
guix package: warning: transformation 'with-c-toolchain' had no effect on python-numpy@1.17.3
[...]
$ guix package -p /tmp/profile-cli --export-manifest > /tmp/manifest.scm
$ cat /tmp/manifest.scm
;; This "manifest" file can be passed to 'guix package -m' to reproduce
;; the content of your profile. This is "symbolic": it only specifies
;; package names. To reproduce the exact same profile, you also need to
;; capture the channels being used, as returned by "guix describe".
;; See the "Replicating Guix" section in the manual.
(use-modules (guix transformations))
(define transform1
(options->transformation
'((with-c-toolchain . "hello=gcc-toolchain@10"))))
(packages->manifest
(list (transform1 (specification->package "hello"))
(specification->package "python-numpy")
(specification->package "python")))
--8<---------------cut here---------------end--------------->8---
So far, so good. Then let use this manifest to create a profile.
$ guix package -p /tmp/profile-exported -m /tmp/manifest.scm
and the issue is that ’/tmp/profile-exported/manifest’ does not contain
the transformation. Other said:
--8<---------------cut here---------------start------------->8---
$ guix package -p /tmp/profile-exported --export-manifest
;; This "manifest" file can be passed to 'guix package -m' to reproduce
;; the content of your profile. This is "symbolic": it only specifies
;; package names. To reproduce the exact same profile, you also need to
;; capture the channels being used, as returned by "guix describe".
;; See the "Replicating Guix" section in the manual.
(specifications->manifest
(list "hello" "python-numpy" "python"))
--8<---------------cut here---------------end--------------->8---
Note that obviously:
--8<---------------cut here---------------start------------->8---
$ ls -l /tmp/profile-{cli,exported}/bin/ | grep hello
lrwxrwxrwx 3 root root 64 Jan 1 1970 hello -> /gnu/store/qi7pqqsxhbwmy75hl43j7l0aw1xr7r42-hello-2.10/bin/hello
lrwxrwxrwx 3 root root 64 Jan 1 1970 hello -> /gnu/store/qi7pqqsxhbwmy75hl43j7l0aw1xr7r42-hello-2.10/bin/hello
--8<---------------cut here---------------end--------------->8---
Well, is it a bug or a feature? ;-)
From my understanding, it makes sense to save the transformations from a
manifest. But it is not clear what should be the good solution for
that because it is not easy; again from my understanding.
The obvious answer is: do not loose the manifest.scm file! :-) Sure, I
am working in the context where Alice produced a Docker image with “guix
pack -f docker --save-provenance -m manifest.scm” where manifest.scm
uses transformations. Then since Alice is post-doc and goes doing other
stuff elsewhere, the source probably vanishes. Bob wants to rebuild the
Docker image. It is possible for simple case as I already illustrated
it. :-)
To be concrete, I am trying to write down a non-trivial example using a
custom package and a transformation for a blog post and/or Cookbook
recipe.
Cheers,
simon
next reply other threads:[~2021-02-10 1:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-10 1:36 zimoun [this message]
2021-02-10 23:01 ` Unexpected --export-manifest with simple transformations Ludovic Courtès
2021-02-11 5:33 ` zimoun
2021-02-22 22:41 ` Ludovic Courtès
2021-02-25 14:48 ` zimoun
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=868s7wbt6d.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@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).