From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 02 09:48:41 2021 Received: (at submit) by debbugs.gnu.org; 2 Sep 2021 13:48:41 +0000 Received: from localhost ([127.0.0.1]:40048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLn56-0002pr-Tg for submit@debbugs.gnu.org; Thu, 02 Sep 2021 09:48:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:45814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLn52-0002ph-5s for submit@debbugs.gnu.org; Thu, 02 Sep 2021 09:48:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLn51-0000uX-U4 for bug-guix@gnu.org; Thu, 02 Sep 2021 09:48:35 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:41703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLn4z-0000qn-FL for bug-guix@gnu.org; Thu, 02 Sep 2021 09:48:35 -0400 IronPort-HdrOrdr: =?us-ascii?q?A9a23=3A9iZwCK+TPGnC/0YchVZuk+DFI+orL9Y04lQ7?= =?us-ascii?q?vn2ZKCYlEfBw+Pre+cjzuSWbtN9zYhEdcK67Scu9qBrnnPYfi7X5W43CYOCMgg?= =?us-ascii?q?eVxe9ZgLcKuweOJxHD?= X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="526402077" Received: from unknown (HELO ribbon) ([193.50.110.141]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2021 15:48:27 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guix@gnu.org Subject: Inheritance vs. =?utf-8?Q?=E2=80=98this-package=E2=80=99?= X-Debbugs-Cc: philippe.swartvagher@inria.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 Fructidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 02 Sep 2021 15:48:27 +0200 Message-ID: <87r1e73x78.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=192.134.164.83; envelope-from=ludovic.courtes@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi! We stumbled upon an idiom for package arguments that, combined with package inheritance, would not work as expected. It goes like this (taken from ): --8<---------------cut here---------------start------------->8--- (define-public starpu (package ;; =E2=80=A6 (arguments (substitute-keyword-arguments (package-arguments starpu-1.2) ((#:configure-flags flags '()) (match (assoc "mpi" (package-propagated-inputs this-package)) (("mpi" mpi) (if (string=3D? (package-name mpi) "nmad") `(cons "--enable-nmad" ,flags) flags)))))) (propagated-inputs `(("mpi" ,openmpi))))) (define-public starpu+fxt (package (inherit starpu) ;; =E2=80=A6 (arguments (substitute-keyword-arguments (package-arguments starpu) ((#:configure-flags flags '()) `(cons "--with-fxt" ,flags)))))) --8<---------------cut here---------------end--------------->8--- The first package, =E2=80=98starpu=E2=80=99, has its arguments depend on: (package-propagated-inputs this-package) This is smart because if you inherit from it without changing the =E2=80=98arguments=E2=80=99 field (for instance by doing =E2=80=98--with-in= put=3Dopenmpi=3Dnmad=E2=80=99), it=E2=80=99ll adjust its configure flags based on the MPI package it actual= ly depends on. However, this trick doesn=E2=80=99t work with the second package, =E2=80=98= starpu-fxt=E2=80=99: if you do: guix build starpu-fxt --with-input=3Dopenmpi=3Dnmad the =E2=80=98--enable-nmad=E2=80=99 configure flag will not be passed. Thi= s is because =E2=80=98starpu-fxt=E2=80=99 calls: (package-arguments starpu) which returns the original arguments of =E2=80=98starpu=E2=80=99. Still here? :-) This is admittedly a pretty far-fetched example and there are ways to work around it=C2=B9. Still, I wonder if we could up with a linguistic device (ah ha!) to address that. We don=E2=80=99t want to (package-arguments this-package) here: that would naturally lead to an infinite loop. But we want something close to it, in spirit: (package-arguments parent), where =E2=80=98parent=E2=80=99 is th= e package we inherit from. (package-arguments parent) could call the =E2=80=98arguments=E2=80=99 thunk= of the parent, but it would pass it the child as its argument. Or something like that. Thoughts? Ludo=E2=80=99. =C2=B9 https://gitlab.inria.fr/guix-hpc/guix-hpc/-/commit/761cfe97d5bb42dbb= de538593cef93e803086e3b From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 04 10:16:00 2023 Received: (at 50335) by debbugs.gnu.org; 4 Mar 2023 15:16:00 +0000 Received: from localhost ([127.0.0.1]:37466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYTc8-0003P4-F2 for submit@debbugs.gnu.org; Sat, 04 Mar 2023 10:16:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYTc6-0003Os-Mj for 50335@debbugs.gnu.org; Sat, 04 Mar 2023 10:15:59 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYTc1-0006hT-ES; Sat, 04 Mar 2023 10:15:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=b47ay3h+IVD/0xO7LkpWHe+1mvO80vxnQXpjBFbjvIE=; b=fzT4OzaVpTWGORiN5NkI wbcjftKOajF1t/6VmOCsMZSat8DBglosr0uEhgqqHU9ru3wu3k7GmFTukG3lLjw51BdCoHI91JaxH AN1KsW5CQA1xjDu4qj4a0/+fu5tmcVN9qSABwrcrFFqBeilwKbLz7QZFo+3vQkJcDgVylpchkRHjO aVsBgJzUrq6UtdVL1OGSALG8mgtW2otyMnVmT00kAPA/5AEQi2R1B8UYobBvsyUWWoQgbRM9fMFxd 5Cev9bJ97JGcALCGDl8aIIzgFfA6ukM/Qv6oI68RtTOQ1n+kyOlKItX38ViZPnugyUA2vE/6M4BDB SR7XmVUOh4TXyw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYTc0-0007Jz-VI; Sat, 04 Mar 2023 10:15:53 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 50335@debbugs.gnu.org Subject: Re: bug#50335: Inheritance vs. =?utf-8?Q?=E2=80=98this-package?= =?utf-8?Q?=E2=80=99?= References: <87r1e73x78.fsf@inria.fr> Date: Sat, 04 Mar 2023 16:15:50 +0100 In-Reply-To: <87r1e73x78.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Thu, 02 Sep 2021 15:48:27 +0200") Message-ID: <87a60stumx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (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: 50335 Cc: philippe.swartvagher@inria.fr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s skribis: > We stumbled upon an idiom for package arguments that, combined with > package inheritance, would not work as expected. [...] > We don=E2=80=99t want to (package-arguments this-package) here: that would > naturally lead to an infinite loop. But we want something close to it, > in spirit: (package-arguments parent), where =E2=80=98parent=E2=80=99 is = the package we > inherit from. > > (package-arguments parent) could call the =E2=80=98arguments=E2=80=99 thu= nk of the > parent, but it would pass it the child as its argument. Here=E2=80=99s an example where I ended up manually defining =E2=80=98paren= t=E2=80=99: https://git.savannah.gnu.org/cgit/guix.git/commit/?h=3Dcore-updates&id=3D= 0aed5bf5120bd434e53be0cea3f96547f95837d6 Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 21 18:34:20 2023 Received: (at control) by debbugs.gnu.org; 21 Oct 2023 22:34:20 +0000 Received: from localhost ([127.0.0.1]:45216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quKXw-0001XZ-QE for submit@debbugs.gnu.org; Sat, 21 Oct 2023 18:34:20 -0400 Received: from tilde.club ([2607:5300:204:4340::114]:40230 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quKXr-0001XJ-Fe for control@debbugs.gnu.org; Sat, 21 Oct 2023 18:34:15 -0400 Received: by tilde.club (Postfix, from userid 5378) id CE654224101FA; Sat, 21 Oct 2023 22:33:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 tilde.club CE654224101FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tilde.club; s=mail; t=1697927621; bh=16BzXhth4up2eBhlwRIjWEqSWdkBnFNL4hOaFZR5ADc=; h=From:To:Subject:Date:From; b=GCUG8ZgDR/2aaR0Y7IZ9PA78hyrknzcZOzZwSupT8ddCm3aXQUGGQ0FoZ5mPnZ+rk SMFJK0nNj1jS+B3F5QBikJ1nRDZB3bcftIZ08tK44tlG2hNt0cxntv1OseKtnichgQ yDIju+TVFF9zx7iz9jHeDhyBVmi4pTXFRSfdCGh8= From: Ulf Herrman To: control@debbugs.gnu.org Subject: Merge new duplicate Date: Sat, 21 Oct 2023 17:33:30 -0500 Message-ID: <87y1fvppvp.fsf@tilde.club> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) forcemerge 50335 66510