From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uNXqBFN5kmFbiwAAgWs5BA (envelope-from ) for ; Mon, 15 Nov 2021 16:14:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id iKajAFN5kmGWWwAAB5/wlQ (envelope-from ) for ; Mon, 15 Nov 2021 15:14:27 +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 40091C3B3 for ; Mon, 15 Nov 2021 16:14:26 +0100 (CET) Received: from localhost ([::1]:51050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmdge-0002Aj-UD for larch@yhetil.org; Mon, 15 Nov 2021 10:14:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmdgI-000277-Fp for guix-patches@gnu.org; Mon, 15 Nov 2021 10:14:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmdgI-00021R-80 for guix-patches@gnu.org; Mon, 15 Nov 2021 10:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmdgI-0005a7-3M for guix-patches@gnu.org; Mon, 15 Nov 2021 10:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51655] [PATCH] build-system: haskell: Add =?UTF-8?Q?=E2=80=98package-with-explicit-haskell=E2=80=99?= procedure. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 15:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51655 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Xinglu Chen , 51655@debbugs.gnu.org Cc: Lars-Dominik Braun Received: via spool by 51655-submit@debbugs.gnu.org id=B51655.163698922421421 (code B ref 51655); Mon, 15 Nov 2021 15:14:02 +0000 Received: (at 51655) by debbugs.gnu.org; 15 Nov 2021 15:13:44 +0000 Received: from localhost ([127.0.0.1]:55800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmdg0-0005ZR-CI for submit@debbugs.gnu.org; Mon, 15 Nov 2021 10:13:44 -0500 Received: from mail-wm1-f47.google.com ([209.85.128.47]:40581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmdfy-0005Z4-VA for 51655@debbugs.gnu.org; Mon, 15 Nov 2021 10:13:43 -0500 Received: by mail-wm1-f47.google.com with SMTP id az33-20020a05600c602100b00333472fef04so15366559wmb.5 for <51655@debbugs.gnu.org>; Mon, 15 Nov 2021 07:13:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=OWmliPwa6XpT73FDilnTpIIdM8PmnBV7CWMQ70J9tE4=; b=VPtip+ZLqaUgBJ5RgiSAdFSTQTGSV3/6I3xVoLfvTk4KOphJUovyT+fVP1s29ayHPm t20AAzi9R+roK9P1IwpJ6kV/PWuMECoIWj9vXjN5YdWTvsh2Sjo60F0zAgOYxia0G7Ub P3UuE3eknd9r6kxFR4vmnKu6LIkF0Y9qQR/739ocLU9mNdzsxDzfMuJO/M2jZEnsJeSL A7AmISBH2XJPSqSR6wwvP8cQRuFgrZtPdD5GAnzxunOzbpJqjjHMdGhKIzWXr+0jZBea F3aZhZktYcYeuKEmEXA0x/MFDMPc0Jgw65t8oaujwEi7vrDmnqVrDVSKwlQ340cWguPn Cv+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=OWmliPwa6XpT73FDilnTpIIdM8PmnBV7CWMQ70J9tE4=; b=v0aoKwa3SR9QDNMeCGu7s+n03ecMCOLZDRFRd61LP9iANopVWXMDjEGVJY9iLnBDyV Jjn4+GJYwh0cM0qwyrXxSEx1eBdLpEozLVcOpIrnk7vn8PvMXWbIG2oqzq+zN2mEV4cs oPsUSlsVM+24S7lk28Ted3rkJXkrXh/RDyNR/aCjTOt0quH8k5w2wvuEpg1Ah3kwxDFN 7dL4HhPVLLsSvdIHh4e4dPJLBQ8/yBer2R3KbvVScWSgNYrU5WaCBg1bHuoGRCW4FHGr rg4Gb3kspqV3wKgayuXUFzmpQWBCDXGQy4EpOXrcBLYRhC4zEhdFBJ9HfSIpb86/IXZi 9/uw== X-Gm-Message-State: AOAM530GtAOc10KaM/AFHT8HMIX8Jc20vOSViXrMh9vl6gJwIeqm1s2W BtqPVJsw9Xirkyq6F+VNehM= X-Google-Smtp-Source: ABdhPJx4EQz5ubhKa3UIs2VhLUkmU70PSM5jF/meJ0zr/MkhvappD/QY1wyrqWs2lfNyWuTONVzSAw== X-Received: by 2002:a05:600c:4ec7:: with SMTP id g7mr43463863wmq.138.1636989217119; Mon, 15 Nov 2021 07:13:37 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id 10sm18061586wrb.75.2021.11.15.07.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 07:13:36 -0800 (PST) From: zimoun In-Reply-To: <7f7b889aebed4c17e3a021883bfed1d67c564109.1636216701.git.public@yoctocell.xyz> References: <7f7b889aebed4c17e3a021883bfed1d67c564109.1636216701.git.public@yoctocell.xyz> Date: Mon, 15 Nov 2021 16:03:50 +0100 Message-ID: <86bl2lbgvd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636989266; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=OWmliPwa6XpT73FDilnTpIIdM8PmnBV7CWMQ70J9tE4=; b=gDSUKQo60i/RK+HfokIY9uygB7Kx/H+Q0vxEi/gynC6I0WN1HmVQPWezBG+RHmhpdn/8Tw +cS9+jOibgDshC8JtiCnL8tSmjlISbF3TESBnl1HvTFgJN0Q5uMDfgQ10L5GITzzv45K7s DF6yhcxQzJbKjZrxSvjE/fVdl2tshDqVJUfCOahT51g7eiGPxbiv/GL3JbKArNNpwMWw4A 5fs/+rQ/83nczxtcHrQ29vsOlJBU/ijh+p6r56FX7hYusrdx4iUIP7auIcfJGxoLomZCT7 ZIrcZhYSex5KFYUBZDMr29syAMkyNpxxWsgldmHZfq9uS08EN6ONQdf5vHqSdw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636989266; a=rsa-sha256; cv=none; b=OMo+fAksXOHMWZugMPnpGTVbxgX8Q9crVzFL5pvc5Ck8xWwxMeEIS94TpKF/kOY7jaTj1B kjX75+U+EZ1D5GKzL8KxV2IK9gw/Mytu7Jj6vBcTOhkahGSnvG6K/eKDrYUB9s3rJnll5n O50GD6ZfuQETvKgyzse1KyBlo+77OqPPBxT5Yvx7v3zB82ZL9A2Zu08UoplgmdHDJ7tpM1 KUOMlnbAmC6Sw1h1vZGNul8PLBGvzYRw/4yRccxBjgitzDAKBEkIVU04r/EcmYPvMSijTk Fv56UIuOhH08KKEUFlfsc/Bxn5tlm5iKEGkX+Vgu29VkrvDCPBkl86dBeJeRCg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VPtip+ZL; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.84 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VPtip+ZL; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 40091C3B3 X-Spam-Score: -1.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: XaKK1aJt2Qc2 Hi, On Sun, 07 Nov 2021 at 11:55, Xinglu Chen wrote: > * guix/packages.scm (package-with-explicit-compiler): New procedure; > factorized from =E2=80=98package-with-explicit-python=E2=80=99. > * guix/build-system/python.scm (package-with-explicit-python): Use > =E2=80=98package-with-explicit-compiler=E2=80=99. > * guix/build-system/haskell.scm (package-with-explicit-haskell): New proc= edure. > * doc/guix.texi (Defining Package Variants): Document it. > --- > doc/guix.texi | 37 ++++++++++++++++++ > guix/build-system/haskell.scm | 8 ++++ > guix/build-system/python.scm | 71 +++++++---------------------------- > guix/packages.scm | 55 +++++++++++++++++++++++++++ > 4 files changed, 113 insertions(+), 58 deletions(-) Neat refactoring! :-) It is something discussing several times and I do not know if =E2=80=99package-with-explicit-ocaml=E2=80=99 could not be adde= d too. The issue is that it depends on more than only one element for =E2=80=9Ccompili= ng=E2=80=9D: ocaml, findlib and dune. On the other hand, guix/build-system/gnu.scm contains =E2=80=99package-with-explicit-inputs*=E2=80=99 which is more or less the s= ame idea. And =E2=80=99transform-package-toolchain=E2=80=99 is another instance. This =E2=80=99package-with-explicit-{ocaml,python}=E2=80=99 pre-dates the transf= ormations and deep rewriting. Therefore, maybe refactor could revisit the complete story. Well, I had headaches last time I gave a look at transformations. And I do not know if it is possible to have a generic transformation for rewriting implicit inputs of all build systems. That=E2=80=99s something t= hat could be nice to nice: =E2=80=99package-with-explicit-python=E2=80=99 based= on a =E2=80=9Cgeneric=E2=80=9D =E2=80=99package-with-explicit-compiler=E2=80=99 = (compiler or toolchain though) and provides =E2=80=99package-with-explicit-*=E2=80=99 for all buil= d systems (ocaml, ghc, emacs, guile, etc.). > +@lisp > +(use-modules (guix build-system haskell)) > + > +(define (default-haskell-8.8) > + ;; Lazily resolve the binding to avoid a circular dependency. > + (let ((haskell (resolve-interface '(gnu packages haskell)))) > + (module-ref haskell 'ghc-8.8))) > + > +(define package-with-haskell-8.8 > + (package-with-explicit-haskell (delay (default-haskell-8.8)) > + "ghc-" "ghc-8.8-" > + #:variant-property 'ghc-8.8-variant)) > +@end lisp As Lars said, an instance is missing, IMHO. Cheers, simon