From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qS/XMuajPGFhJwAAgWs5BA (envelope-from ) for ; Sat, 11 Sep 2021 14:41:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id nvTZLeajPGEvGwAAbx9fmQ (envelope-from ) for ; Sat, 11 Sep 2021 12:41:10 +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 54A3A1E5A8 for ; Sat, 11 Sep 2021 14:41:10 +0200 (CEST) Received: from localhost ([::1]:51750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mP2Jh-0006MO-Cr for larch@yhetil.org; Sat, 11 Sep 2021 08:41:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mP2JH-0006L7-4r for guix-devel@gnu.org; Sat, 11 Sep 2021 08:40:43 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:52008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mP2JE-0000mD-Sn; Sat, 11 Sep 2021 08:40:42 -0400 Received: by mail-wm1-x336.google.com with SMTP id y132so3073763wmc.1; Sat, 11 Sep 2021 05:40:40 -0700 (PDT) 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=t3ojRMd0QGHI6Ck01p+VWbTj4pVtgj1SrSzco+unCFY=; b=FIWFVnw2Qmi0IOJYlYn8ujb62pBCafBpDSir5xa8c5uWRmH9RGHb5hSFBUHKfJeihw QqIfz7cdDpIKGv5xRlKSSwtbIp7HqI8WAr6UXcr+9PX+IHm3fwUSHaQ6nF3D3VmW++Tl tNyAEIbv+VkmaQ/VZkBB7v1i4yXMBFe2N0kQF/pDeBoK8oDt9eYfQn/M47NGvkTIYwBp adUrfcwzydjYBOWFDClt50sVkTi3qowrotsvcrvI8p6ewzGVuZX9L078ole1T2zXxYGa VaNbtnVVEya/kD/ef2wUVOt5zOZDvVJFNzByhDyElcdlswWVLuc/ApTdK2jYxw+pA34c fGeg== 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=t3ojRMd0QGHI6Ck01p+VWbTj4pVtgj1SrSzco+unCFY=; b=bsr/63wwiQKKFGrt3aC2Lqw8xi90CHwKeAZLjyxn/M6UBLAM/iq6rIqHQ8quQngorh 0KJjoySlyJV0S/oX7SZ82QMlMJUMAMfH4BlImdPJ6sXZCtYDm9LUjNSt01t9XfIgE823 bTO4cMlhhPWXJKxllU5uQ0Joliw5rKp93kdOhHR3XdqwDA4u48qoyJWEowVDOCfCwRcs GIN+LAhMuWjTF9fCCI+pTMlTcmMUpfRmD/7a2HEfMnQgP4xFyn7lEYQwZWVsCIffrTZH cXcxOh55hn6b0q72doZF5c50/lKvt3cWcCr1jEI1VbEDh08WSPGIxMMbukf6EyD0V/VU x2aw== X-Gm-Message-State: AOAM5309pU3byfDgrGQ41otOqf9B2+cijH94ip0QdMOc/if/k50zLKlY gAeR2IVkzfXHGsmSolDwVstR04jQt2I= X-Google-Smtp-Source: ABdhPJw0t9q7BwAJHc5Jzo+OAOwzYqDo1Ya4lBmHe6SJ4PKrBBRD3vubTyVTqcLRlGy+/NDtIaPiEw== X-Received: by 2002:a7b:c005:: with SMTP id c5mr2627104wmb.59.1631364039046; Sat, 11 Sep 2021 05:40:39 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id f1sm1534258wri.43.2021.09.11.05.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 05:40:38 -0700 (PDT) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Transform: walk through packages In-Reply-To: <8735qe23el.fsf@gnu.org> References: <86pmu1qz2f.fsf@gmail.com> <87a6kv5m1q.fsf@gnu.org> <8735qe23el.fsf@gnu.org> Date: Sat, 11 Sep 2021 14:09:52 +0200 Message-ID: <86k0jnb9f3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x336.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "guix-devel@gnu.org" Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631364070; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=t3ojRMd0QGHI6Ck01p+VWbTj4pVtgj1SrSzco+unCFY=; b=eensDdd0giZ5E6hsAK5uON5Kfa7WsNiEVkIxIiXdKfgjgYQdDlNPGerAVg+oqrA259MRIE l4Tpb5BmHqgFcfUQfuDCRaNBoiOwgttlszA8Kp3XxM2uvXfCBffDu0A/8/xih7BbpjHp81 o2qXXWkenpS5N4lsh9ytgWhCeoUxjncLFLdoJK/56SpJilm2lC7DoMUQLPxpEdWh5H+57E vsx8CDTO1zWBASGsAUhtOjZtKPL+u8opSgTxwc/+PbGZxpnB/5Ccs0FlzILx56+4iDtBej baIi7VWDaRHEbYYEQwwGB7OHYVmqHQE6wfx0b9uZVtWqYfCszQFCKF/Pztbx1g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631364070; a=rsa-sha256; cv=none; b=j00Cn8mRo60n13sdNO1J6hec8jTQV9deNYogjfxX2ePjJlb2HQSI9RzuXC/dSTTpYIPvDz PQy6OpvtI+wBYUa10RMmMP+NZCFCEp0+b+P/wjtJcrTNKGTJrlA9ZBoaBD7+nH3vu07p93 ib3zVsvSquoSO4DUrRfnRIfDPRvK+aeSmPJ+ThnMD6Ug/gcijVTbqZNuOkbcNBHAz87x6r Nn9NGi0xMgUZSmQnof6nykX7s6MnCoslAG7jVoklEIFrs8xflj9QCChFUbPRnrqBjj1YPJ gfwr7q3mUAVlD16uXVyHJTchGR95vJu1UAS0b6uNvG3KWrCFpEghiaZIpvlLQw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=FIWFVnw2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -1.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=FIWFVnw2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 54A3A1E5A8 X-Spam-Score: -1.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: bK92OInbm6ap Hi, The initial message [1] leads to various questions about transformations: 1) optimize the walk 2) check if the transformation makes sense or not. 3) apply a transformation to a non-existent package, The #2 is commented in this subthread [2]. The #3 is addressed with the draft patch attached [3]. Here, let comment about #1. 1: 2: 3: On Wed, 08 Sep 2021 at 22:55, Ludovic Court=C3=A8s wrote: > zimoun skribis: >> Last, speaking about transformations, the graph is walked too much >> when several transformations is applied: >> >> guix build hello --with-latest=3Dfoo --with-input=3Dbar=3Dbaz --with-= latest=3Dchouib >> >> then the graph is walked 3 times, IIUC. The options needs a rewrite >> to pass a list of specs to 'package-with-latest-upstream' and not >> twice a list with only one element. This would reduce to 2 walks. >> Then it could be nice to compose the transformation and then walk only >> once (apply 'package-mapping' only once). >> Well, maybe I miss something. > > Right, I guess it could work. It=E2=80=99s the same complexity anyway, b= ut at > least it would lower the constant costs. Yeah, for sure. But for example, if you go to 5 shops, buy stuff, put in your bag, you will not first go to each and just pay then second go again to each and bring the stuff. It is the same complexity in term of number of shops, though. ;-) I do not know the Guile internals so maybe I miss a point. From my understanding, this pattern is odd: (map f (map g xs)) and instead it seems better: (map (compose f g) xs) The =E2=80=9Cvisible=E2=80=9D effect of the win of the factor 2 in the cons= tant costs depends on the constant costs of f and g vs the constant cost to walk the list. But still, there is a factor 2 win. :-) For instance, GHC has a rewrite rule [4] pass for automatic optimization when compiling. :-) 4: Anyway. From the previous example, it appears to me easy to group the transform =E2=80=99--with-latest=E2=80=99 and applies a list of 2 elements.= It is somehow a list arrangement in =E2=80=99applicable=E2=80=99 and then each tr= ansform already accepts a list of specs. I will try to come up with a patch if no one beats me. :-) However, I do not know beforehand if all the transformations (e.g., --with-latest and --with-input) will compose well. Well, it is an investigation of this comment. ;-) (transform ;; XXX: We used to pass TRANSFORM a list of several ;; arguments, but we now pass only one, assuming that ;; transform composes well. Cheers, simon