unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#65231: refresh: Exception in manifest is silenced, cause all packages to be selected
@ 2023-08-11 20:04 Maxim Cournoyer
  0 siblings, 0 replies; only message in thread
From: Maxim Cournoyer @ 2023-08-11 20:04 UTC (permalink / raw)
  To: 65231

Hi Guix,

Consider the following manifest:

--8<---------------cut here---------------start------------->8---
(use-modules (guix packages)
             (guix profiles)
             (guix utils)
             (gnu packages))

(define %qt-major-version "6")

(manifest
 (map package->manifest-entry
      (fold-packages
       (lambda (package lst)
         (let ((uri (and=> (package-source package)
                           (lambda (x)
                             (and (origin? x)
                                  (origin-uri x))))))
           (if (and uri
                    (string? uri)
                    (string-prefix? "mirror://qt/" uri)
                    (= %qt-major-version (version-major
                                          (package-version package))))
               (cons package lst)
               lst)))
       '())))
--8<---------------cut here---------------end--------------->8---

There's a subtle bug in it, which is the '=' function which is used
instead of 'string=?'.  I'd expect 'guix refresh -m qt-manifest.scm' to
let this exception interrupt execution, but instead it proceeds to
refresh all (?) the packages (taking a long time to compute).

At the REPL, the error is reported as:

--8<---------------cut here---------------start------------->8---
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure =: Wrong type argument in position 1: "6"
--8<---------------cut here---------------end--------------->8---

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-11 20:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-11 20:04 bug#65231: refresh: Exception in manifest is silenced, cause all packages to be selected Maxim Cournoyer

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