From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iPS+I8vXMGHaEQAAgWs5BA (envelope-from ) for ; Thu, 02 Sep 2021 15:55:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CJ1yH8vXMGHwegAA1q6Kng (envelope-from ) for ; Thu, 02 Sep 2021 13:55:23 +0000 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 1EADC99B8 for ; Thu, 2 Sep 2021 15:55:23 +0200 (CEST) Received: from localhost ([::1]:60242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLnBa-0004N5-9A for larch@yhetil.org; Thu, 02 Sep 2021 09:55:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLn5T-0001q1-2r for bug-guix@gnu.org; Thu, 02 Sep 2021 09:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLn5S-0001Ki-Rm for bug-guix@gnu.org; Thu, 02 Sep 2021 09:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mLn5S-0002qS-K8; Thu, 02 Sep 2021 09:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50335: Inheritance vs. =?UTF-8?Q?=E2=80=98this-package=E2=80=99?= Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: philippe.swartvagher@inria.fr, bug-guix@gnu.org Resent-Date: Thu, 02 Sep 2021 13:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50335 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 50335@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org X-Debbugs-Original-Xcc: philippe.swartvagher@inria.fr Received: via spool by submit@debbugs.gnu.org id=B.163059052110907 (code B ref -1); Thu, 02 Sep 2021 13:49:02 +0000 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: A9a23:9iZwCK+TPGnC/0YchVZuk+DFI+orL9Y04lQ7vn2ZKCYlEfBw+Pre+cjzuSWbtN9zYhEdcK67Scu9qBrnnPYfi7X5W43CYOCMggeVxe9ZgLcKuweOJxHD 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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-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: , Cc: philippe.swartvagher@inria.fr Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630590923; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bMkr3WlilV0vRN2n8mDMsaIktioRMi5xeFj9ve2LrwI=; b=U/0cCSQw9zXhBmIZFMkGtdZusj6g0m+bMGGiaifuv645Ge3v9V3Oz7ev0aOz7ZoxkFcpKN N+f3YRYTzAK4KXu6LC2xDL/lbVHxmKx1ap7YJEsu4ym2Lu+uLu2ciE9HVu4TW/8m5hlxRE e4oPIvPjMUcfM1UtQTQzgIO18kVXEZniQxY1PsluZNyBayCRyuzqxjg3t1l3+Fv3wIylH3 gql0XTEJYluNqMm0CuCYuWpTbojqDeFaf+V4zgcra7vtGspx8HzoeKp+0I25KxiTW3aCws O8bVswM1XSLEOjBsaYC/+WvrU7HAElG8ailH/d1GKwBcxNlAWwnyRP3uGG0P6g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630590923; a=rsa-sha256; cv=none; b=SzyqUoo+PK9VqBQZ0T/43eRGhN5urL/NQxUAKbqW7GfuPl9o8zJRzFJ6WV7Xc/Pf4zmdhe DpBJFKLbkE04rFZHbbk86jR1vlAZOjSunt5Yun7kmDmggSm5ExMYKFBDEqNfPio8Fr/tdP j9FlxnMpfOz1HNLsQvqHcfEwZJRiLFrRas7E0ymsvCPMY/wual5/Ku4IjoDvI5LLan1mWx 2By18uh5fwmDI8nPUh45DW6Jv8LvuZloIfH9YZKhQyPuz9TbSG3p29wMF0RHUm/nl5+k69 EiIyjhauHQ42mOroRd5L33MeZowl2qu/XNQGaqahDHOUfa+A5AR0QroFUwNSrw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.42 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 1EADC99B8 X-Spam-Score: -2.42 X-Migadu-Scanner: scn1.migadu.com X-TUID: ZNczreH9tEYl 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