From: zimoun <zimon.toutoune@gmail.com>
To: Guix Devel <guix-devel@gnu.org>
Cc: Marius Bakke <marius@gnu.org>
Subject: grafted package and CLI
Date: Tue, 05 Jul 2022 02:07:32 +0200 [thread overview]
Message-ID: <86ilocxvzv.fsf@gmail.com> (raw)
Hi,
Commit 3fc6709d4285f44d1e861c7b09951adf3073e898 is a security fixes for
the package ’curl’; it reads,
--8<---------------cut here---------------start------------->8---
(define-public curl
(package
(name "curl")
(version "7.79.1")
+ (replacement curl-7.84.0)
[...]
+;; Replacement package with fixes for multiple vulnerabilities.
+;; See <https://curl.se/docs/security.html>.
+(define curl-7.84.0
+ (package
+ (inherit curl)
--8<---------------cut here---------------end--------------->8---
So far, so good! Well, it leads to these behaviour:
$ guix show curl | recsel -p name,version
name: curl
version: 7.79.1
$ guix build curl -S
/gnu/store/67w9zrlm1xahczf55f9rd15aaqadbixj-curl-7.84.0.tar.xz
Or even, it can be confusing:
$ guix shell curl@7.79.1 -- curl --version
curl 7.84.0 (x86_64-unknown-linux-gnu) libcurl/7.84.0 GnuTLS/3.7.2 zlib/1.2.11 libidn2/2.3.1 nghttp2/1.44.0
Release-Date: 2022-06-27
[..]
The issue is not new, e.g., see [1]. I proposed a patch [2] (see below)
which addresses the issue with “guix show”.
However, it does not address issue with “guix package -A | grep ^curl”;
and it is potentially not fixable because it uses
’fold-available-packages’ which loads the cache (for performance) and
this cache does not contain the ’replacement’ field – it is not a good
idea to introduce it, IMHO.
About “guix shell”, a warning could be added.
Well, WDYT?
Cheers,
simon
--8<---------------cut here---------------start------------->8---
diff --git a/guix/ui.scm b/guix/ui.scm
index 7fbd4c63a2..b6497f5e5c 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1528,9 +1528,18 @@ HYPERLINKS? is true, emit hyperlink escape sequences when appropriate."
(define (package<? p1 p2)
(string<? (package-full-name p1) (package-full-name p2)))
+ (define replacement
+ (package-replacement p))
+
;; Note: Don't i18n field names so that people can post-process it.
(format port "name: ~a~%" (package-name p))
(format port "version: ~a~%" (package-version p))
+ (when replacement
+ (unless
+ (string=?
+ (package-version p)
+ (package-version replacement))
+ (format port "replacement: ~a~%" (package-version replacement))))
(format port "outputs: ~a~%" (string-join (package-outputs p)))
(format port "systems: ~a~%"
(string-join (package-transitive-supported-systems p)))
--8<---------------cut here---------------end--------------->8---
1: <https://yhetil.org/guix/871rc5jv1o.fsf@netris.org>
2: <https://yhetil.org/guix/86im5a6ea4.fsf@gmail.com>
next reply other threads:[~2022-07-05 0:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 0:07 zimoun [this message]
2022-07-07 8:00 ` grafted package and CLI Ludovic Courtès
2022-07-07 13:29 ` zimoun
2022-07-07 15:09 ` Ludovic Courtès
2022-07-07 16:58 ` zimoun
2022-07-17 15:35 ` bokr
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=86ilocxvzv.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=guix-devel@gnu.org \
--cc=marius@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).