unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45028] [PATCH] offload: Print warning in context.
@ 2020-12-03 19:52 Julien Lepiller
  2020-12-14  8:41 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Lepiller @ 2020-12-03 19:52 UTC (permalink / raw)
  To: 45028

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

Hi Guix, attached is a patch to add context to the warning about the
system field. When offloading, we get this message if we haven't
updated our machines.scm:

guix offload: warning: The 'system' field is deprecated, please use
'systems' instead.

and it's not clear what system field this message is refering to
(especially for me, since I simply re-enabled offloading after a few
months by copying my old backup machines.scm).

Now the message is:

/etc/guix/machines.scm:9:6: warning: The 'system' field is deprecated,
please use 'systems' instead.

which directs the user to the right file, and line (so if you have many
offload machines, you know where to fix).

Since the message comes from the daemon, you need to run the daemon
from your guix checkout to test the patch.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-offload-Print-warning-in-context.patch --]
[-- Type: text/x-patch, Size: 1975 bytes --]

From d29c55f67c63c6fe49a4febd7999640a0dab2a55 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Thu, 3 Dec 2020 20:22:50 +0100
Subject: [PATCH] offload: Print warning in context.

* guix/scripts/offload.scm (build-machine): Add `location` field.
(build-machine-system): Print location with warning.
---
 guix/scripts/offload.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
index 6366556647..58ee53e85c 100644
--- a/guix/scripts/offload.scm
+++ b/guix/scripts/offload.scm
@@ -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 @@
             build-machine-overload-threshold
             build-machine-systems
             build-machine-features
+            build-machine-location
 
             build-requirements
             build-requirements?
@@ -112,11 +114,17 @@
   (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))
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#45028] [PATCH] offload: Print warning in context.
  2020-12-03 19:52 [bug#45028] [PATCH] offload: Print warning in context Julien Lepiller
@ 2020-12-14  8:41 ` Ludovic Courtès
  2020-12-15 14:04   ` bug#45028: " Julien Lepiller
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2020-12-14  8:41 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 45028

Hi Julien,

Julien Lepiller <julien@lepiller.eu> skribis:

> From d29c55f67c63c6fe49a4febd7999640a0dab2a55 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Thu, 3 Dec 2020 20:22:50 +0100
> Subject: [PATCH] offload: Print warning in context.
>
> * guix/scripts/offload.scm (build-machine): Add `location` field.
> (build-machine-system): Print location with warning.

LGTM!

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#45028: [PATCH] offload: Print warning in context.
  2020-12-14  8:41 ` Ludovic Courtès
@ 2020-12-15 14:04   ` Julien Lepiller
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Lepiller @ 2020-12-15 14:04 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 45028-done

Pushed as 954e4cf6a4cc67701dff8d089e8e02861e3b36c2, thank you!




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-15 14:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 19:52 [bug#45028] [PATCH] offload: Print warning in context Julien Lepiller
2020-12-14  8:41 ` Ludovic Courtès
2020-12-15 14:04   ` bug#45028: " Julien Lepiller

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