publish: Do not render the narinfo "System" field.

This has been discussed here: https://issues.guix.gnu.org/50040.

* guix/scripts/publish.scm (narinfo-string): Do not render the "System" field
that is expensive to compute and currently unused.
This commit is contained in:
Mathieu Othacehe 2021-08-31 13:31:57 +02:00
parent 590be0a1ed
commit 222f4661ed
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -4,6 +4,7 @@
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com> ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -358,20 +359,20 @@ References: ~a~%"
compression))) compression)))
compressions) compressions)
hash size references)) hash size references))
;; Do not render a "Deriver" or "System" line if we are rendering ;; Do not render a "Deriver" line if we are rendering info for a
;; info for a derivation. ;; derivation. Also do not render a "System" line that would be
;; expensive to compute and is currently unused.
(info (if (not deriver) (info (if (not deriver)
base-info base-info
(catch 'system-error (catch 'system-error
(lambda () (lambda ()
(let ((drv (read-derivation-from-file deriver))) (let ((drv (read-derivation-from-file deriver)))
(format #f "~aSystem: ~a~%Deriver: ~a~%" (format #f "~aDeriver: ~a~%"
base-info (derivation-system drv) base-info (basename deriver))))
(basename deriver))))
(lambda args (lambda args
;; DERIVER might be missing, but that's fine: ;; DERIVER might be missing, but that's fine:
;; it's only used for <substitutable> where it's ;; it's only used for <substitutable> where it's
;; optional. 'System' is currently unused. ;; optional.
(if (= ENOENT (system-error-errno args)) (if (= ENOENT (system-error-errno args))
base-info base-info
(apply throw args)))))) (apply throw args))))))