From: Simon Tournier <zimon.toutoune@gmail.com>
To: 74015@debbugs.gnu.org
Subject: bug#74015: 'guix shell --export-manifest' fails for some transformations
Date: Fri, 25 Oct 2024 19:08:17 +0200 [thread overview]
Message-ID: <87a5eshzzy.fsf@gmail.com> (raw)
Hi,
I notice this:
--8<---------------cut here---------------start------------->8---
$ cat manifest.scm
(use-modules (guix transformations) (guix packages)
(guix download) (guix build-system r))
(define r-knitr
(specification->package "r-knitr"))
(define r-knitr-other
(package
(inherit r-knitr)
(version "1.47")
(source (origin
(method url-fetch)
(uri (cran-uri "knitr" version))
(sha256
(base32
"1kx6g8ddbigwx3bmq771gwi3din3fxjn59l801904kjaz6dq9pgs"))))))
(define r-ggplot2
(package
(inherit
((package-input-rewriting `((,r-knitr . ,r-knitr-other)))
(specification->package "r-ggplot2")))
(name "my-ggplot")))
(define transform
(options->transformation
'((with-c-toolchain . "r-minimal=gcc-toolchain@12")
(with-c-toolchain . "r=gcc-toolchain@12"))))
(packages->manifest
(append
(map specification->package
(list "python" "python-numpy"))
(map transform
(list (specification->package "r")
r-ggplot2))))
$ guix shell -m manifest.scm --export-manifest
guix shell: warning: transformation 'with-c-toolchain' had no effect on my-ggplot@3.5.1.
;; What follows is a "manifest" equivalent to the command line you gave.
;; You can store it in a file that you may then pass to any 'guix' command
;; that accepts a '--manifest' (or '-m') option.
(use-modules (guix transformations))
(define transform1
(options->transformation
'((with-c-toolchain . "r-minimal=gcc-toolchain@12")
(with-c-toolchain . "r=gcc-toolchain@12"))))
(packages->manifest
(list (specification->package "python")
(specification->package "python-numpy")
(transform1 (specification->package "r"))
(transform1 (specification->package "my-ggplot"))))
--8<---------------cut here---------------end--------------->8---
Well, this is incorrect. While I understand the approximation when
dealing with profiles built over time in the imperative way, here I am
missing why the transformation of ’r-ggplot2’ is skipped. And even the
export manifest is broken.
It’s skipped because:
--8<---------------cut here---------------start------------->8---
$ guix shell -m manifest.scm
$ grep ggplot $GUIX_ENVIRONMENT/manifest
("my-ggplot"
"/gnu/store/x0jbmvg0nbl7lyk8zd938rq2c7c9qkn4-my-ggplot-3.5.1"
--8<---------------cut here---------------end--------------->8---
Please note that if the symbol ’r-ggplot2’ is not named “my-ggplot” but
kept as ’r-ggplot2“:
(define r-ggplot2
((package-input-rewriting `((,r-knitr . ,r-knitr-other)))
(specification->package "r-ggplot2")))
then the bug is maybe worse because the exported manifest “works” but
without the transformation… which can be misleading and hard to detect.
Well, I understand it’s hard to capture this kind of transformation.
Still, it appears to me as an half-baked feature. :-)
That’s annoying in some context as “guix pack --save-provenance” [1].
Even, it defeats the idea of a self-contained reproducible binary
container. ;-)
Maybe, aside the profile ’manifest’ file, we could store all the
manifests provided by the command line. Something as:
/gnu/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-profile/manifest
/gnu/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-profile/manifest.orig1
/gnu/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-profile/manifest.orig2
…
where manifest.orig1 and manifest.orig2 are the copy of files ’foo.scm’
and ’bar.scm’ from:
-m foo.scm -m bar.scm
This way, the option --export-manifest could be improved.
WDYT?
Cheers,
simon
1: https://hpc.guix.info/blog/2021/10/when-docker-images-become-fixed-point
reply other threads:[~2024-10-25 17:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=87a5eshzzy.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=74015@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 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).