[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Unexpected --export-manifest with simple transformations
From: |
zimoun |
Subject: |
Unexpected --export-manifest with simple transformations |
Date: |
Wed, 10 Feb 2021 02:36:10 +0100 |
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
- Unexpected --export-manifest with simple transformations,
zimoun <=