GNU bug report logs - #56446
[PATCH] profiles: Remove support for reading versions 0 and 1.

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Fri, 8 Jul 2022 09:30:03 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56446 in the body.
You can then email your comments to 56446 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#56446; Package guix-patches. (Fri, 08 Jul 2022 09:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 08 Jul 2022 09:30:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH] profiles: Remove support for reading versions 0 and 1.
Date: Fri,  8 Jul 2022 11:27:50 +0200
Version 2 was introduced in commit
dedb17ad010ee9ef67f3f4f3997dd17f226c8090 (May 2015), which made it into
Guix 0.9.0.

* guix/profiles.scm (find-package): Remove.
(sexp->manifest)[infer-search-paths]: Remove.
Remove clauses for versions 0 and 1.
---
 guix/profiles.scm | 65 +----------------------------------------------
 1 file changed, 1 insertion(+), 64 deletions(-)

Hi,

This change will make it impossible to read profiles created before 2015,
which was way before 1.0.

I’ll go ahead and apply it if there are no objections.

Thanks,
Ludo’.

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 701852ae98..a21cc432dc 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -507,34 +507,8 @@ (define (entry->gexp entry)
                                  (mapm %state-monad entry->gexp entries)
                                vlist-null))))))
 
-(define (find-package name version)
-  "Return a package from the distro matching NAME and possibly VERSION.  This
-procedure is here for backward-compatibility and will eventually vanish."
-  (define find-best-packages-by-name              ;break abstractions
-    (module-ref (resolve-interface '(gnu packages))
-                'find-best-packages-by-name))
-
-   ;; Use 'find-best-packages-by-name' and not 'find-packages-by-name'; the
-   ;; former traverses the module tree only once and then allows for efficient
-   ;; access via a vhash.
-   (match (find-best-packages-by-name name version)
-     ((p _ ...) p)
-     (_
-      (match (find-best-packages-by-name name #f)
-        ((p _ ...) p)
-        (_ #f)))))
-
 (define (sexp->manifest sexp)
   "Parse SEXP as a manifest."
-  (define (infer-search-paths name version)
-    ;; Infer the search path specifications for NAME-VERSION by looking up a
-    ;; same-named package in the distro.  Useful for the old manifest formats
-    ;; that did not store search path info.
-    (let ((package (find-package name version)))
-      (if package
-          (package-native-search-paths package)
-          '())))
-
   (define (infer-dependency item parent)
     ;; Return a <manifest-entry> for ITEM.
     (let-values (((name version)
@@ -620,44 +594,7 @@ (define* (sexp->manifest-entry sexp #:optional (parent (delay #f)))
              (return entry)))))))
 
   (match sexp
-    (('manifest ('version 0)
-                ('packages ((name version output path) ...)))
-     (manifest
-      (map (lambda (name version output path)
-             (manifest-entry
-               (name name)
-               (version version)
-               (output output)
-               (item path)
-               (search-paths (infer-search-paths name version))))
-           name version output path)))
-
-    ;; Version 1 adds a list of propagated inputs to the
-    ;; name/version/output/path tuples.
-    (('manifest ('version 1)
-                ('packages ((name version output path deps) ...)))
-     (manifest
-      (map (lambda (name version output path deps)
-             ;; Up to Guix 0.7 included, dependencies were listed as ("gmp"
-             ;; "/gnu/store/...-gmp") for instance.  Discard the 'label' in
-             ;; such lists.
-             (let ((deps (match deps
-                           (((labels directories) ...)
-                            directories)
-                           ((directories ...)
-                            directories))))
-               (letrec* ((deps* (map (cute infer-dependency <> (delay entry))
-                                     deps))
-                         (entry (manifest-entry
-                                  (name name)
-                                  (version version)
-                                  (output output)
-                                  (item path)
-                                  (dependencies deps*)
-                                  (search-paths
-                                   (infer-search-paths name version)))))
-                 entry)))
-           name version output path deps)))
+    ;; Versions 0 and 1 are no longer produced since 2015.
 
     ;; Version 2 adds search paths and is slightly more verbose.
     (('manifest ('version 2 minor-version ...)

base-commit: 43cf8861b8ff3e8b987b731f347e31ba8bdf00ae
-- 
2.36.1





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 08 Jul 2022 22:03:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Fri, 08 Jul 2022 22:03:02 GMT) Full text and rfc822 format available.

Message #10 received at 56446-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 56446-done <at> debbugs.gnu.org
Subject: Re: bug#56446: [PATCH] profiles: Remove support for reading
 versions 0 and 1.
Date: Sat, 09 Jul 2022 00:01:53 +0200
Ludovic Courtès <ludo <at> gnu.org> skribis:

> Version 2 was introduced in commit
> dedb17ad010ee9ef67f3f4f3997dd17f226c8090 (May 2015), which made it into
> Guix 0.9.0.
>
> * guix/profiles.scm (find-package): Remove.
> (sexp->manifest)[infer-search-paths]: Remove.
> Remove clauses for versions 0 and 1.

Pushed as e7e04396c0e91569bf493e1352d6539babc15327.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 Aug 2022 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.