GNU bug report logs - #41140
“guix system” suggests wrong module import when using “remove”

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Ricardo Wurmus <rekado@HIDDEN>; dated Fri, 8 May 2020 22:01:02 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 41140 <at> debbugs.gnu.org:


Received: (at 41140) by debbugs.gnu.org; 11 May 2020 20:24:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 11 16:24:06 2020
Received: from localhost ([127.0.0.1]:53438 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jYEy6-0000AN-3E
	for submit <at> debbugs.gnu.org; Mon, 11 May 2020 16:24:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57894)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1jYEy4-00009f-2d
 for 41140 <at> debbugs.gnu.org; Mon, 11 May 2020 16:24:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46603)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1jYExy-0006ja-RQ; Mon, 11 May 2020 16:23:58 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39054 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1jYExy-0002CH-6Y; Mon, 11 May 2020 16:23:58 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Ricardo Wurmus <rekado@HIDDEN>
Subject: Re: bug#41140: =?utf-8?Q?=E2=80=9Cguix_system=E2=80=9D?= suggests
 wrong module import when using =?utf-8?B?4oCccmVtb3Zl4oCd?=
References: <87lfm22il6.fsf@HIDDEN>
Date: Mon, 11 May 2020 22:23:55 +0200
In-Reply-To: <87lfm22il6.fsf@HIDDEN> (Ricardo Wurmus's message of "Sat,
 09 May 2020 00:00:05 +0200")
Message-ID: <87h7wmfcf8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 41140
Cc: 41140 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ricardo Wurmus <rekado@HIDDEN> skribis:

> But now I=E2=80=99m curious and I look at the documentation for =E2=80=9C=
remove=E2=80=9D from
> (rnrs lists):
>
>  -- Scheme Procedure: remp proc list
>  -- Scheme Procedure: remove obj list
>  -- Scheme Procedure: remv obj list
>  -- Scheme Procedure: remq obj list
>      =E2=80=98remove=E2=80=99, =E2=80=98remv=E2=80=99, and =E2=80=98remq=
=E2=80=99 are identical to the =E2=80=98delete=E2=80=99, =E2=80=98delv=E2=
=80=99,
>      and =E2=80=98delq=E2=80=99 procedures provided by Guile=E2=80=99s co=
re library, (*note List
>      Modification::).  =E2=80=98remp=E2=80=99 is identical to the alterna=
te =E2=80=98remove=E2=80=99
>      procedure provided by SRFI-1; *Note SRFI-1 Deleting::.
>
> Oh.

Bah, R6 is terrible in that respect.

> So here are my questions:
>
> * can we prefer (srfi srfi-1) over (rnrs lists) in the suggestions for =
=E2=80=9Cremove=E2=80=9D?

I don=E2=80=99t think we should do that.  However, listing all the
possibilities, as Danny suggests, would be nice.

> * can we avoid this by extending modify-services to support =E2=80=9Cdele=
te=E2=80=9D
>   much like modify-phases, and suggesting to use that instead of
>   =E2=80=9Cremove=E2=80=9D?

That=E2=80=99s the better option!

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#41140; Package guix. Full text available.

Message received at 41140 <at> debbugs.gnu.org:


Received: (at 41140) by debbugs.gnu.org; 11 May 2020 20:22:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 11 16:22:45 2020
Received: from localhost ([127.0.0.1]:53426 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jYEwn-00007B-5s
	for submit <at> debbugs.gnu.org; Mon, 11 May 2020 16:22:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57734)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1jYEwl-00006z-HU
 for 41140 <at> debbugs.gnu.org; Mon, 11 May 2020 16:22:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46583)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1jYEwg-0006FA-3k; Mon, 11 May 2020 16:22:38 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39052 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1jYEwf-00027F-L9; Mon, 11 May 2020 16:22:37 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Ricardo Wurmus <rekado@HIDDEN>
Subject: Re: bug#41140: =?utf-8?Q?=E2=80=9Cguix_system=E2=80=9D?= suggests
 wrong module import when using =?utf-8?B?4oCccmVtb3Zl4oCd?=
References: <87lfm22il6.fsf@HIDDEN> <877dxj327c.fsf@HIDDEN>
Date: Mon, 11 May 2020 22:22:36 +0200
In-Reply-To: <877dxj327c.fsf@HIDDEN> (Ricardo Wurmus's message of "Sun,
 10 May 2020 23:33:11 +0200")
Message-ID: <87lflyfchf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 41140
Cc: 41140 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Ricardo Wurmus <rekado@HIDDEN> skribis:

>>From 40c1208cbe9cbfa58ee385ef6ee06b775d309753 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <rekado@HIDDEN>
> Date: Sun, 10 May 2020 23:29:38 +0200
> Subject: [PATCH] services: Support DELETE in MODIFY-SERVICES macro.
>
> * gnu/services.scm (%modify-service): Add clause for DELETE syntax.
> (modify-services): Use FILTER-MAP; adjust docstring.
> * doc/guix.texi (System Services): Mention alternative syntax.
> (X Window): Use MODIFY-SERVICES syntax.

I like it!

> -  #:use-module (srfi srfi-1)
> +  #:use-module ((srfi srfi-1) #:hide (delete))
>    #:use-module (srfi srfi-9)
>    #:use-module (srfi srfi-9 gnu)
>    #:use-module (srfi srfi-26)
> @@ -272,7 +273,11 @@ singleton service type NAME, of which the returned s=
ervice is an instance."
>      (service type value)))
>=20=20
>  (define-syntax %modify-service
> -  (syntax-rules (=3D>)
> +  (syntax-rules (=3D> delete)
> +    ((_ svc (delete kind) clauses ...)
> +     (if (eq? (service-kind svc) kind)
> +         #f
> +         (%modify-service svc clauses ...)))

Best practice suggests that =E2=80=98delete=E2=80=99 should be bound (info =
"(guile)
Syntax Rules"):

--8<---------------cut here---------------start------------->8---
   Although literals can be unbound, usually they are bound to allow
them to be imported, exported, and renamed.  *Note Modules::, for more
information on imports and exports.  In Guile there are a few standard
auxiliary syntax definitions, as specified by R6RS and R7RS:
--8<---------------cut here---------------end--------------->8---

Now, if we export a new =E2=80=98delete=E2=80=99 binding from here, it=E2=
=80=99ll annoy
everyone.  So perhaps we can keep the srfi-1 =E2=80=98delete=E2=80=99 and r=
e-export it,
as done in (guix build utils)=E2=80=A6 though that situation is also annoyi=
ng
because we get warnings saying that it collides with core =E2=80=98delete=
=E2=80=99.

Dunno, give it a try!

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#41140; Package guix. Full text available.

Message received at 41140 <at> debbugs.gnu.org:


Received: (at 41140) by debbugs.gnu.org; 10 May 2020 21:33:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 10 17:33:20 2020
Received: from localhost ([127.0.0.1]:50636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jXtZY-0003xd-Ap
	for submit <at> debbugs.gnu.org; Sun, 10 May 2020 17:33:20 -0400
Received: from sender4-of-o53.zoho.com ([136.143.188.53]:21399)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1jXtZX-0003xT-1I
 for 41140 <at> debbugs.gnu.org; Sun, 10 May 2020 17:33:19 -0400
ARC-Seal: i=1; a=rsa-sha256; t=1589146397; cv=none; 
 d=zohomail.com; s=zohoarc; 
 b=XDUBaWLIjyyrcbL/OGxUN1+Fk46JGqR3NJR/yxTb1UEhAIPzwO+Ay/nPOXaOtiAQ/cdhuFHMX+lV6q8JNmFlxxzIuAG/hLSovP6dfDCk+SvvgLCBuJlge2bQ4Q6sLM0MFoKWpkSY6ZXxVdks/+WQnYcNT/5r4R3R51TrQhyDl9A=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc; t=1589146397;
 h=Content-Type:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To;
 bh=P5JxEadNQYmEcxysc0hdDywuV6B0wvNj528MPE4W1Pg=; 
 b=BcfDHZV/1g2eBODxBtDUWJoYHIAHmZeUYgucd09gU34/lhkxgX0B+uPz1spvmoCxJ7nvb9gIZcfVoQKTmr2SexJRCx/OG97PFjlAraI+eI1FF1AffqUgVgiEAEzjhAvKUESsi6lnIJtlLfWkwE6fdPRpgsNRoONDXvKgR3POFlU=
ARC-Authentication-Results: i=1; mx.zohomail.com;
 dkim=pass  header.i=elephly.net;
 spf=pass  smtp.mailfrom=rekado@HIDDEN;
 dmarc=pass header.from=<rekado@HIDDEN> header.from=<rekado@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589146397; 
 s=zoho; d=elephly.net; i=rekado@HIDDEN;
 h=References:From:To:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type;
 bh=P5JxEadNQYmEcxysc0hdDywuV6B0wvNj528MPE4W1Pg=;
 b=IvUVjUG29X6/GJmi7u+NEBO5tnIFS5jhOUOvjhIdp8ifUM07IPgJjia6Da5fCeGL
 CXnRJE1m99hVRk4Drir94Oa+hnElqj/Lvghw9cttzFvr6Zh/cfjfJLeVAFx0oKwAD47
 OINcD4uFhaPzmOhBEVLWxFzeagzibI+H3Rht01fQ=
Received: from localhost (p4FD5A118.dip0.t-ipconnect.de [79.213.161.24]) by
 mx.zohomail.com with SMTPS id 1589146395885613.4655770232221;
 Sun, 10 May 2020 14:33:15 -0700 (PDT)
References: <87lfm22il6.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.3
From: Ricardo Wurmus <rekado@HIDDEN>
To: 41140 <at> debbugs.gnu.org
Subject: Re: =?utf-8?Q?=E2=80=9Cguix_system=E2=80=9D?= suggests wrong module
 import when using =?utf-8?B?4oCccmVtb3Zl4oCd?=
In-reply-to: <87lfm22il6.fsf@HIDDEN>
X-URL: https://elephly.net
X-PGP-Key: https://elephly.net/rekado.pubkey
X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
Date: Sun, 10 May 2020 23:33:11 +0200
Message-ID: <877dxj327c.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-ZohoMailClient: External
X-Zoho-Virus-Status: 1
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 41140
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Ricardo Wurmus <rekado@HIDDEN> writes:

> * can we avoid this by extending modify-services to support =E2=80=9Cdele=
te=E2=80=9D
>   much like modify-phases, and suggesting to use that instead of
>   =E2=80=9Cremove=E2=80=9D?

The attached patch does this.

What do you think?

--=20
Ricardo


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline;
 filename=0001-services-Support-DELETE-in-MODIFY-SERVICES-macro.patch
Content-Transfer-Encoding: quoted-printable

From 40c1208cbe9cbfa58ee385ef6ee06b775d309753 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@HIDDEN>
Date: Sun, 10 May 2020 23:29:38 +0200
Subject: [PATCH] services: Support DELETE in MODIFY-SERVICES macro.

* gnu/services.scm (%modify-service): Add clause for DELETE syntax.
(modify-services): Use FILTER-MAP; adjust docstring.
* doc/guix.texi (System Services): Mention alternative syntax.
(X Window): Use MODIFY-SERVICES syntax.
---
 doc/guix.texi    | 13 ++++++++++---
 gnu/services.scm | 23 +++++++++++++++--------
 2 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 14a42e7070..25274a8539 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11230,6 +11230,14 @@ following expression returns a list that contains =
all the services in
         %desktop-services)
 @end lisp
=20
+Alternatively, the @code{modify-services} macro can be used:
+
+@lisp
+(modify-services %desktop-services
+  (delete avahi-service-type))
+@end lisp
+
+
 @unnumberedsubsec Instantiating the System
=20
 Assuming the @code{operating-system} declaration
@@ -14732,9 +14740,8 @@ and tty8.
                    (service slim-service-type (slim-configuration
                                                (display ":1")
                                                (vt "vt8")))
-                   (remove (lambda (service)
-                             (eq? (service-kind service) gdm-service-type))
-                           %desktop-services))))
+                   (modify-services %desktop-services
+                     (delete gdm-service-type)))))
 @end lisp
=20
 @end defvr
diff --git a/gnu/services.scm b/gnu/services.scm
index 2e4648bf78..ac614a7317 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright =C2=A9 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Court=C3=
=A8s <ludo@HIDDEN>
 ;;; Copyright =C2=A9 2016 Chris Marusich <cmmarusich@HIDDEN>
+;;; Copyright =C2=A9 2020 Ricardo Wurmus <rekado@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,7 +34,7 @@
   #:use-module (guix modules)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
-  #:use-module (srfi srfi-1)
+  #:use-module ((srfi srfi-1) #:hide (delete))
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-9 gnu)
   #:use-module (srfi srfi-26)
@@ -272,7 +273,11 @@ singleton service type NAME, of which the returned ser=
vice is an instance."
     (service type value)))
=20
 (define-syntax %modify-service
-  (syntax-rules (=3D>)
+  (syntax-rules (=3D> delete)
+    ((_ svc (delete kind) clauses ...)
+     (if (eq? (service-kind svc) kind)
+         #f
+         (%modify-service svc clauses ...)))
     ((_ service)
      service)
     ((_ svc (kind param =3D> exp ...) clauses ...)
@@ -302,16 +307,18 @@ TYPE.  Consider this example:
     (mingetty-service-type config =3D>
                            (mingetty-configuration
                             (inherit config)
-                            (motd (plain-file \"motd\" \"Hi there!\")))))
+                            (motd (plain-file \"motd\" \"Hi there!\"))))
+    (delete udev-service-type))
=20
 It changes the configuration of the GUIX-SERVICE-TYPE instance, and that of
-all the MINGETTY-SERVICE-TYPE instances.
+all the MINGETTY-SERVICE-TYPE instances, and it deletes instances of the
+UDEV-SERVICE-TYPE.
=20
-This is a shorthand for (map (lambda (svc) ...) %base-services)."
+This is a shorthand for (filter-map (lambda (svc) ...) %base-services)."
     ((_ services clauses ...)
-     (map (lambda (service)
-            (%modify-service service clauses ...))
-          services))))
+     (filter-map (lambda (service)
+                   (%modify-service service clauses ...))
+                 services))))
=20
 
 ;;;
--=20
2.25.1


--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#41140; Package guix. Full text available.

Message received at 41140 <at> debbugs.gnu.org:


Received: (at 41140) by debbugs.gnu.org; 9 May 2020 07:30:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 09 03:30:26 2020
Received: from localhost ([127.0.0.1]:46736 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jXJwI-00007E-IZ
	for submit <at> debbugs.gnu.org; Sat, 09 May 2020 03:30:26 -0400
Received: from dd26836.kasserver.com ([85.13.145.193]:33554)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1jXJwF-000071-J4
 for 41140 <at> debbugs.gnu.org; Sat, 09 May 2020 03:30:24 -0400
Received: from localhost (80-110-127-207.cgn.dynamic.surfer.at
 [80.110.127.207])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id B25FF336559F;
 Sat,  9 May 2020 09:30:21 +0200 (CEST)
Date: Sat, 9 May 2020 09:30:18 +0200
From: Danny Milosavljevic <dannym@HIDDEN>
To: Ricardo Wurmus <rekado@HIDDEN>
Subject: Re: bug#41140: =?utf-8?Q?=E2=80=9Cguix_system=E2=80=9D?= suggests
 wrong module import when using =?utf-8?Q?=E2=80=9Cremove=E2=80=9D?=
Message-ID: <20200509093018.426a528d@HIDDEN>
In-Reply-To: <87lfm22il6.fsf@HIDDEN>
References: <87lfm22il6.fsf@HIDDEN>
X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="Sig_/siF6GzT7E0/dUp/0y_IldTI";
 protocol="application/pgp-signature"; micalg=pgp-sha512
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 41140
Cc: 41140 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--Sig_/siF6GzT7E0/dUp/0y_IldTI
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Ricardo,

On Sat, 09 May 2020 00:00:05 +0200
Ricardo Wurmus <rekado@HIDDEN> wrote:

> * can we prefer (srfi srfi-1) over (rnrs lists) in the suggestions for =
=E2=80=9Cremove=E2=80=9D?

If possible, I'd just make it search all the modules with that binding that
are available in the search path.  It's okay if that's slow--since it's a
fatal error case anyway.

Then it could say "either (rnrs lists) or (srfi srfi-1), but probably not
both".

Better than hardcoding preferences...

So in short, known-variable-definition shouldn't find the "best" module but
rather all modules with such a binding.  Also, it sounds like that just
searches the currently-loaded modules.  Aren't that too few?

If we don't want that for some reason, we can just add "srfi srfi-1" to the
last "match" form where it already prefers "(gnu ...)", but that's gonna
turn into whack-a-mole fast.

--Sig_/siF6GzT7E0/dUp/0y_IldTI
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl62XAoACgkQ5xo1VCww
uqVODgf/RY3O5EhEpi6QKjaHsQddpRPrnImDhUDTRyNRI0ExSxxvbMbJHlOx5HCj
L1DHRyJ6VbZbaA9h0ahez5euls+qj/gGe9bR4mMmMtHtyEyWY153xAQjioYQ9StX
RMEfXkpszZ1X5/k3/whTu8nm2y4lwH83J7hznIpZbEyJe1LZVCRNGITP7vzYvaWa
1uyMeIh6YA+0ymd6ufSyNZDPs/L76YgHdnN7+EaPjelCdhgkUf+UwsNbW4cMi+oi
T15+8Ze91YLKwX51kFceR3NKZIVJXG+GS3jlNb/gWZanuOxZWodacV8SWdji0k2V
IZbo3pnSlvmZnIYyxfZ4dHEoH42ZvQ==
=IrRH
-----END PGP SIGNATURE-----

--Sig_/siF6GzT7E0/dUp/0y_IldTI--




Information forwarded to bug-guix@HIDDEN:
bug#41140; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 May 2020 22:00:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 08 18:00:22 2020
Received: from localhost ([127.0.0.1]:46418 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jXB2b-0000Eu-Vp
	for submit <at> debbugs.gnu.org; Fri, 08 May 2020 18:00:22 -0400
Received: from lists.gnu.org ([209.51.188.17]:43278)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1jXB2V-0000Ee-QW
 for submit <at> debbugs.gnu.org; Fri, 08 May 2020 18:00:20 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42848)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rekado@HIDDEN>)
 id 1jXB2V-0002TK-GP
 for bug-guix@HIDDEN; Fri, 08 May 2020 18:00:15 -0400
Received: from sender4-of-o53.zoho.com ([136.143.188.53]:21378)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256)
 (Exim 4.90_1) (envelope-from <rekado@HIDDEN>)
 id 1jXB2U-0000Ok-9k
 for bug-guix@HIDDEN; Fri, 08 May 2020 18:00:15 -0400
ARC-Seal: i=1; a=rsa-sha256; t=1588975211; cv=none; 
 d=zohomail.com; s=zohoarc; 
 b=l5L0z08nc/3AoTRu9a5OkdII0BSD2r0+uwFY71bLkp/qtu87tkgJWOJo4Tbq+c+FA8D65KlBK3mg0trYjDRNpleNEf6H4RDF8h45iTaxuT/keMG2G3K48q3A5Q3xYfFWo5U4vA2iY1tsShqKKEJ4MJ2pfHK9g1zCGcMjnjFpuao=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc; t=1588975211;
 h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To;
 bh=FCf2JepdS3QuIjDepQ1o0Di/JCnAYRwLmdQPFem7ngU=; 
 b=VL6uojJRX7IN0paCAMdCXygdBBC1wgP0w5kGvXf/DNjA8FClsMsTYq5mQjSuDCcvWlmvYEwJmRbaUjvqTrC5ZMTdT8yGdgljQH1O+S4nRLwPw4TRhL8s15ehogVqDOAiK0NUh+SyuYTOubJvZmM14KavAX/DAP8Isk+aoNaHpBI=
ARC-Authentication-Results: i=1; mx.zohomail.com;
 dkim=pass  header.i=elephly.net;
 spf=pass  smtp.mailfrom=rekado@HIDDEN;
 dmarc=pass header.from=<rekado@HIDDEN> header.from=<rekado@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1588975211; 
 s=zoho; d=elephly.net; i=rekado@HIDDEN;
 h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding;
 bh=FCf2JepdS3QuIjDepQ1o0Di/JCnAYRwLmdQPFem7ngU=;
 b=i4jbvmcdWK+47tcfl4vs4rR0eYyE14Zq2F1DIiOAjveANhvrpYloabzElWRiu+4t
 uqy+cNOAcOZz9DKAVKE1j+s7pMly0t6FRu8/AB4PcJ/Bx6T4lHxr88cKYCYnfIGPMRF
 LIBMcL3Rs4q3naaE1x9cE45Or4cfHsV3hXIzx7N8=
Received: from localhost (p54AD4BDF.dip0.t-ipconnect.de [84.173.75.223]) by
 mx.zohomail.com with SMTPS id 1588975208580384.8162927891266;
 Fri, 8 May 2020 15:00:08 -0700 (PDT)
User-agent: mu4e 1.2.0; emacs 26.3
From: Ricardo Wurmus <rekado@HIDDEN>
To: bug-guix@HIDDEN
Subject: =?utf-8?Q?=E2=80=9Cguix_system=E2=80=9D?= suggests wrong module
 import when using =?utf-8?B?4oCccmVtb3Zl4oCd?=
X-URL: https://elephly.net
X-PGP-Key: https://elephly.net/rekado.pubkey
X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
Date: Sat, 09 May 2020 00:00:05 +0200
Message-ID: <87lfm22il6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-ZohoMailClient: External
Received-SPF: pass client-ip=136.143.188.53; envelope-from=rekado@HIDDEN;
 helo=sender4-of-o53.zoho.com
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/08 16:39:42
X-ACL-Warn: Detected OS   = Linux 3.11 and newer [fuzzy]
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

I want to delete a service from %desktop-services, so I write

--8<---------------cut here---------------start------------->8---
=E2=80=A6
(services (remove
           (lambda (service)
             (eq? (service-kind service) that-annoying-service-type))
           %desktop-services))
=E2=80=A6
--8<---------------cut here---------------end--------------->8---

Then I run =E2=80=9Cguix system build config.scm=E2=80=9D and Guix tells me=
 that it
doesn=E2=80=99t know what =E2=80=9Cremove=E2=80=9D is:

--8<---------------cut here---------------start------------->8---
config.scm:56:18: error: remove: unbound variable
hint: Did you forget `(use-modules (rnrs lists))'?
--8<---------------cut here---------------end--------------->8---

I add the suggested module import to my file and it no longer complains,
but that-annoying-service-type has not actually been removed.  Oh no!

Of course, the Guix manual says this:

--8<---------------cut here---------------start------------->8---
   Again, =E2=80=98%desktop-services=E2=80=99 is just a list of service obj=
ects.  If you
want to remove services from there, you can do so using the procedures
for list filtering (*note (guile)SRFI-1 Filtering and Partitioning::).
For instance, the following expression returns a list that contains all
the services in =E2=80=98%desktop-services=E2=80=99 minus the Avahi service:

     (remove (lambda (service)
               (eq? (service-kind service) avahi-service-type))
             %desktop-services)
--8<---------------cut here---------------end--------------->8---

But maybe I don=E2=80=99t know what SRFI-1 is and I trust that the hint Guix
provides will be the right thing to do.

But now I=E2=80=99m curious and I look at the documentation for =E2=80=9Cre=
move=E2=80=9D from
(rnrs lists):

--8<---------------cut here---------------start------------->8---
 -- Scheme Procedure: remp proc list
 -- Scheme Procedure: remove obj list
 -- Scheme Procedure: remv obj list
 -- Scheme Procedure: remq obj list
     =E2=80=98remove=E2=80=99, =E2=80=98remv=E2=80=99, and =E2=80=98remq=E2=
=80=99 are identical to the =E2=80=98delete=E2=80=99, =E2=80=98delv=E2=80=
=99,
     and =E2=80=98delq=E2=80=99 procedures provided by Guile=E2=80=99s core=
 library, (*note List
     Modification::).  =E2=80=98remp=E2=80=99 is identical to the alternate=
 =E2=80=98remove=E2=80=99
     procedure provided by SRFI-1; *Note SRFI-1 Deleting::.
--8<---------------cut here---------------end--------------->8---

Oh.

So here are my questions:

* can we prefer (srfi srfi-1) over (rnrs lists) in the suggestions for =E2=
=80=9Cremove=E2=80=9D?

* can we avoid this by extending modify-services to support =E2=80=9Cdelete=
=E2=80=9D
  much like modify-phases, and suggesting to use that instead of
  =E2=80=9Cremove=E2=80=9D?

--
Ricardo




Acknowledgement sent to Ricardo Wurmus <rekado@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#41140; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 11 May 2020 20:30:02 UTC

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