offload: Print warning in context.

* guix/scripts/offload.scm (build-machine): Add `location` field.
(build-machine-system): Print location with warning.
This commit is contained in:
Julien Lepiller 2020-12-03 20:22:50 +01:00
parent 8c0751505b
commit 954e4cf6a4
No known key found for this signature in database
GPG key ID: 53D457B2D636EE82

View file

@ -2,6 +2,7 @@
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@ -65,6 +66,7 @@ (define-module (guix scripts offload)
build-machine-overload-threshold
build-machine-systems
build-machine-features
build-machine-location
build-requirements
build-requirements?
@ -112,11 +114,17 @@ (define-record-type* <build-machine>
(speed build-machine-speed ; inexact real
(default 1.0))
(features build-machine-features ; list of strings
(default '())))
(default '()))
(location build-machine-location
(default (and=> (current-source-location)
source-properties->location))
(innate)))
;;; Deprecated.
(define (build-machine-system machine)
(warning (G_ "The 'system' field is deprecated, \
(warning
(build-machine-location machine)
(G_ "The 'system' field is deprecated, \
please use 'systems' instead.~%"))
(%build-machine-system machine))