unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Unexpected --export-manifest with simple transformations
@ 2021-02-10  1:36 zimoun
  2021-02-10 23:01 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: zimoun @ 2021-02-10  1:36 UTC (permalink / raw)
  To: Guix Devel, Ludovic Courtès

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



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

end of thread, other threads:[~2021-02-25 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-10  1:36 Unexpected --export-manifest with simple transformations zimoun
2021-02-10 23:01 ` Ludovic Courtès
2021-02-11  5:33   ` zimoun
2021-02-22 22:41     ` Ludovic Courtès
2021-02-25 14:48       ` zimoun

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