store: Warn about daemon deprecation.

* guix/deprecation.scm (warn-about-old-daemon): New procedure.
* guix/store.scm (build-things): Use it to warn about old daemons.
This commit is contained in:
Mathieu Othacehe 2022-02-08 14:28:56 +01:00
parent ec5d2b54cd
commit f9c62b23cc
No known key found for this signature in database
GPG key ID: 8354763531769CA6
2 changed files with 9 additions and 0 deletions

View file

@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@ -24,6 +25,8 @@ (define-module (guix deprecation)
define-deprecated/public
define-deprecated/alias
warn-about-old-daemon
warn-about-deprecation))
;;; Commentary:
@ -32,6 +35,10 @@ (define-module (guix deprecation)
;;;
;;; Code:
(define (warn-about-old-daemon)
(warning (G_ "Your Guix daemon is seriously outdated, please consider
updating it by following the 'Upgrading Guix' documentation section.~%")))
(define* (warn-about-deprecation variable properties
#:key replacement)
(let ((location (and properties (source-properties->location properties))))

View file

@ -1442,6 +1442,8 @@ (define build-things
things)))
(parameterize ((current-store-protocol-version
(store-connection-version store)))
(when (< (current-store-protocol-version) 355) ;0x163
(warn-about-old-daemon))
(if (>= (store-connection-minor-version store) 15)
(build store things mode)
(if (= mode (build-mode normal))