From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id UNt+FJhNKGTa8gAASxT56A (envelope-from ) for ; Sat, 01 Apr 2023 17:28:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2N5dE5hNKGSiDwEAG6o9tA (envelope-from ) for ; Sat, 01 Apr 2023 17:28:24 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 15A1B2E77A for ; Sat, 1 Apr 2023 17:28:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pid9A-0008T9-Kh; Sat, 01 Apr 2023 11:28:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pid98-0008Sn-GN for bug-guix@gnu.org; Sat, 01 Apr 2023 11:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pid98-0006XX-82 for bug-guix@gnu.org; Sat, 01 Apr 2023 11:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pid97-0005e8-Ll for bug-guix@gnu.org; Sat, 01 Apr 2023 11:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#62589: Help with patch with delayed evaluation Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 01 Apr 2023 15:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62589 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , 62589@debbugs.gnu.org Received: via spool by 62589-submit@debbugs.gnu.org id=B62589.168036286421679 (code B ref 62589); Sat, 01 Apr 2023 15:28:01 +0000 Received: (at 62589) by debbugs.gnu.org; 1 Apr 2023 15:27:44 +0000 Received: from localhost ([127.0.0.1]:38394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pid8q-0005da-0h for submit@debbugs.gnu.org; Sat, 01 Apr 2023 11:27:44 -0400 Received: from 7.mo561.mail-out.ovh.net ([46.105.57.200]:56727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pid8m-0005dQ-Uf for 62589@debbugs.gnu.org; Sat, 01 Apr 2023 11:27:42 -0400 Received: from director5.ghost.mail-out.ovh.net (unknown [10.108.20.147]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 57E7E2478C for <62589@debbugs.gnu.org>; Sat, 1 Apr 2023 15:27:39 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-hs68x (unknown [10.110.208.67]) by director5.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D9E8D1FDBC; Sat, 1 Apr 2023 15:27:38 +0000 (UTC) Received: from ngraves.fr ([37.59.142.96]) by ghost-submission-6684bf9d7b-hs68x with ESMTPSA id KqTnNWpNKGQinAEAPwVKbw (envelope-from ); Sat, 01 Apr 2023 15:27:38 +0000 X-OVh-ClientIp: 81.67.140.142 In-Reply-To: <87fs9jg974.fsf@ngraves.fr> References: <87ilefgbza.fsf@ngraves.fr> <20230401100509.24723-1-ngraves@ngraves.fr> <87zg7rgaln.fsf_-_@gnu.org> <87fs9jg974.fsf@ngraves.fr> Date: Sat, 01 Apr 2023 17:27:38 +0200 Message-ID: <87cz4nfwr9.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 5578552565900304919 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeifedgkeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeffudelkeejveetleeuffejfefftefhhfffuedtteethfelueelveffjedvffdtffenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddrleeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeeivdehkeelseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves From: Nicolas Graves via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680362904; a=rsa-sha256; cv=none; b=UMw/OYln09I2dJLq0kjvkcNpAC4z1fKS9k4tuELZnEvUHzO6bnr49v2fPyOUrhQunird1L AgirGYwqclx6xPURsy9sLCi+0130X4d3BeTT2AVTAn4zKQ51aDOVIbNnwD8KA/cLJh8fbT i4nIm8R/afK8ln59Foo6Un3cSrwsZdP4oVdy2kBGKc/K5r/f/gWIppeztEoUrd2mj3FBc8 VTPRXfn9X9Oz5AsCuNGCIZxvkWaYdNxJ8aZf2Houq8p5zWdf7SzumWzFbVsCw6TtnIe8tz 42wgWUrqzpCIpYFY0bQ/3na0wM2eFd8CKR8tu8kSomjXQXG3PhspgqXcVudnkw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680362904; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=y7FUWQH07QznLsVOJ19xnsA7XmzXj6wYjVL64BuAQWk=; b=jeI7yVkEZarlkL805H1uvkP89qSBIHv1RVRBR9C5gvLHh/zdjsnC1b1MFjZoZLP7eFOMsp reaY1iYLRkRk2HmGlcxRFOKbSuEHgNMLhI2NfAwBnDzoMLz0chdRwhYK24UnVZ9w0NNpBe gYSVrEzJ/H/Vmxl+fpXCVPYH4+NvlKShdFcNZpdyFrN1+mR+FUoGUA2oyMxhHjeOMB5hCU BK3H+k9EltBbFMXst9w3+QvpyH1hVrwjB3HoEu1w8nsmZ4n1DQPnv5icCXodgWr/yEmtDU E/fm+S+5dKZFlNOIFwwthzvGOByMrcKw3wIkmHxA6Ol/NlHv+/P9xw7UvMqPEg== X-Migadu-Spam-Score: -3.73 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Spam-Score: -3.73 X-Migadu-Queue-Id: 15A1B2E77A X-TUID: 7kf9fsrY3pqA On 2023-04-01 12:58, Nicolas Graves wrote: > On 2023-04-01 12:28, Ludovic Court=C3=A8s wrote: > >> Hi, >> >> Nicolas Graves skribis: >> >>> +(define* (make-nerd-dictation-package >>> + input-tool output-tool >>> + #:key (nerd-dictation-package nerd-dictation)) >>> + "Construct a nerd-dictation package for OUTPUT-TOOL." >>> + (match-let* (((input-name output-name) >>> + (map (lambda (tool) >>> + (lazy >>> + (delay (package-name (force tool))))) >>> + (list input-tool output-tool)))) >>> + (package >>> + (inherit nerd-dictation-package) >>> + (name (string-append "nerd-dictation-" >>> + (if (equal? (force input-name) "sox") >>> + "sox-" >>> + "") >>> + (force output-name))) >> >> I don=E2=80=99t understand the details of what the patch does, but as a = rule of >> thumb, make sure you only ever inherit from packages defined in the same >> module. > > The patch defines a helper for defining variants of nerd-dictation. It > now supports wtype and I wasn't totally satisfied by international > support for ydotool, so I wanted to switch, but copying it make a lot of > repeated code. > > I already defined such a helper with Liliana Marie Prinkler with > make-emacs-eval-in-repl, but this time I don't understand this error. > > Josselin was suggesting a module import cycle, (gnu packages > machine-learning) is imported in (gnu packages audio), the error might > come from there.=20 > >> >> Perhaps that=E2=80=99s what was going wrong? > > I've tried inheriting from the above package direclty, doesn't seem to > be that. > >> >> HTH, >> Ludo=E2=80=99. After thinking and experimenting, I think what I'm trying to do is not possible in this file. This is for a record if someone has the same kind of issue in the future.=20 When I include sox or wtype as a regular input, it works fine. But it doesn't work when called from another function, I think the issue is indeed the same as when inheriting from a package. Now, there is the counterexample of the make-emacs-eval-in-repl function. IIUC, this example works with delayed evaluation because all the packages it calls are defined *in the same file*. To test this, on way could be to test inheritance on a package defined in the same file but after the inheriting package definition. IIRC, it doesn't work, but might when using delayed evaluation. This aside, the packages I'm trying to load are outside the file, and this is probably the reason why it works for make-emacs-eval-in-repl and not this function. I will try to circumvent the issue by factorising less, maybe just the gexp, but not propagated-inputs.=20 --=20 Best regards, Nicolas Graves