From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gBifLAyIVGGcyAAAgWs5BA (envelope-from ) for ; Wed, 29 Sep 2021 17:36:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GPYKKAyIVGFsJQAAB5/wlQ (envelope-from ) for ; Wed, 29 Sep 2021 15:36:44 +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 2E55435BD8 for ; Wed, 29 Sep 2021 17:36:44 +0200 (CEST) Received: from localhost ([::1]:44616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVbdG-0000ci-Sc for larch@yhetil.org; Wed, 29 Sep 2021 11:36:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVbbq-0007L2-KJ for guix-patches@gnu.org; Wed, 29 Sep 2021 11:35:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVbbq-0000B3-CQ for guix-patches@gnu.org; Wed, 29 Sep 2021 11:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVbbq-0001tY-6b for guix-patches@gnu.org; Wed, 29 Sep 2021 11:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50620] [PATCH 0/2] Unify 'computed-origin-method' (linux, icecat) Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 29 Sep 2021 15:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50620 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mark H Weaver Cc: 50620@debbugs.gnu.org, zimoun Received: via spool by 50620-submit@debbugs.gnu.org id=B50620.16329296777242 (code B ref 50620); Wed, 29 Sep 2021 15:35:02 +0000 Received: (at 50620) by debbugs.gnu.org; 29 Sep 2021 15:34:37 +0000 Received: from localhost ([127.0.0.1]:49899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVbbQ-0001sj-Hd for submit@debbugs.gnu.org; Wed, 29 Sep 2021 11:34:36 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVbbO-0001sV-Tf for 50620@debbugs.gnu.org; Wed, 29 Sep 2021 11:34:35 -0400 Received: by mail-wr1-f65.google.com with SMTP id k7so4899521wrd.13 for <50620@debbugs.gnu.org>; Wed, 29 Sep 2021 08:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=PK096D43xDcLy+DzKfOxvd78xfKN7lQh7bRaYqlWSlk=; b=ckjZofuqp3yHG+dIdxdLUU67o30MUifVRH9Y+1/92QAdtpOTCK3+WOK8AnhkPl80q1 vfa90Jl+iir9vwfE3LQR6+mYOTPbvV1lGsJLGjGufEiGG86+lOkk6XjlNuJkek3EcUqy uBFwxIpwvJOg3F1wgbWtn11azU4uhwZlh63Tr1W939PctweuRsLHCZadMC0WyJGRjxBS MHNIce1XUJy//l7GAlT0+Rk2HCuWd0UefI8Jgr0jUnKPAdJGx9IHcBwe0Tn1JDBpUCBW qIMIqSHcAy2+AFCUK3QCXiMoyL5RX2cnNyXJucPJZ68DcY0TLPa7Yw+Y9jLCvMG1A6tN bkZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=PK096D43xDcLy+DzKfOxvd78xfKN7lQh7bRaYqlWSlk=; b=jp5kO1lACDrlYPLiL8YOuB6AvpWl/2uogRN+cP4sFvaKIuZz2re+tdvAHeH/Ivjsgj iVjfBa5xrKwA6UxLTiAgGiSAVnF7qVMnBCpBLgvCYto5KvFZ5XsvmFtLFVZb4hY6Wd0N IMgSoqiV0/QJAVIyiheghmR6Yh6/LGfwZInodH+d3A2ePZaxAs+RJ8cmfliwh7SGoYMg 1MIzYDdicKMtIqoUn/sWpYNiECbs0Ut9ojPzVwxJWjwvXSMtSoROEKLCVPj+UJrOW9bg SAN6dFa5DdV6iFLEd9NNYgykIjL/J0+4Z2egBUfX5yavtROc8CAW43L4o1eXrLmhnh4h Cw8g== X-Gm-Message-State: AOAM5317n/XnLsel8JAtHvll3Gd900QfxlhvSOgouJ56idQOrfIpqwLj rHUYGyZt37lhXJ7dAOgLseg= X-Google-Smtp-Source: ABdhPJyzn74BxRxccc9iyK+vjLFZHsXwV1Ttxj5S8nd18Yvecnh9rZedGxtsb40CtRwOdb+qGNZ4jw== X-Received: by 2002:adf:e509:: with SMTP id j9mr604155wrm.416.1632929668813; Wed, 29 Sep 2021 08:34:28 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id u3sm168908wmc.16.2021.09.29.08.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 08:34:28 -0700 (PDT) Message-ID: From: Liliana Marie Prikler Date: Wed, 29 Sep 2021 17:34:27 +0200 In-Reply-To: <87a6jv8qu7.fsf_-_@gnu.org> References: <20210916114734.2686426-1-zimon.toutoune@gmail.com> <9b6ee27ff10e1042a5d61d0f93d957cf760e9ecb.camel@gmail.com> <87v930ay5y.fsf@netris.org> <87pmstghx0.fsf@netris.org> <87a6jv8qu7.fsf_-_@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632929804; 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=PK096D43xDcLy+DzKfOxvd78xfKN7lQh7bRaYqlWSlk=; b=aBjKcybnasINapCZ1Ow+bPPHy4ZVZr2SXnjOLKzfaTwdMehYwnHtVsZVIqrlsMvP6TjQ4s zk9j4fRCS7aPMifpBSmflO95ZdCEjqwwwSF4K7Gbk1kMTwvnlS13PYHrd/5uwf5S2ej3Tn lKAHoCfyQgDHbDITZB3LJspp1pxkOQBO2gWUGX3RiPLG5QObG1mlr4kW4jQHUIA3UIND4C Mohihnmum4vJ+JI6DqTJFS6Du9a7HzSbC+bCExkZWjjmWSmuMnMgoS7I9jar/JxT4Zpzej YSjLAl5sT+jvpJxiCB90vRLOdVZ5gL9fH2L/DhLmdb+qtO2HOqwrJbqI8Um/aQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632929804; a=rsa-sha256; cv=none; b=rL9iiAiksCtTs+0EAY6k0++OJXRyWTSJ2dArCRgbtgdQKzxVAWPvTmwMio10YoZ2eiYTKP E5eUIxKycFoEFYoo4SZgR6kaWbx6gv40Q/FA/xwHfB3XkO3JdVnQWBQNcBbe7vIjOwKb+R 4STUe9jyEcjxPwcFTKlXYbBDRASNaFHKT4b8sodSalkO01YTNdpQViCWTwUJhzonT6112v uVziGJCDtHcyH0sQqR2LoQUaCwcw5AausbJ840DNabruhD/qPx4u+sw4jSyCj7FbswI1WA 6XuA+5RhOikjvktz/PNcheQjuPGdGFkruZ3c4dC/1t+2EA+1vqwRheGKcnU/OA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=ckjZofuq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.20 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=ckjZofuq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 2E55435BD8 X-Spam-Score: 0.20 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9W0+FnnlmMWG Hi there, Am Mittwoch, den 29.09.2021, 15:16 +0200 schrieb Ludovic Courtès: > Hi there! > > I’d rather go with zimoun’s original patch, which is focused and does > nothing more than what was originally intended, which is to factorize > the procedure. I’ll go ahead and apply it shortly if there are no > objections. I have trouble understanding this paragraph. What exactly is "this patch" and what do you mean by "factorizing"? If it means moving computed-origin-method elsewhere, then yes, for a short-time solution only moving it is a wise choice in my opinion, but zimoun and I still disagree on the target. zimoun says (guix packages) for reasons unknown to me, whereas I say (gnu packages), because it's closer to where it's used and doesn't imply that this is going to be a part of the (guix) download schemes anytime soon. > As Mark wrote, ‘computed-origin-method’ remains a hack, so we can > discuss about the best way to improve on it, but that’s a separate > discussion. What you propose, Liliana, is one possible way to > improve on the situation, but only on the surface: the hack remains, > it just gets its own module. I don't necessarily perceive computed-origin-method as a hack, though, at least not in concept. The current implementation may be a hack indeed, but I don't think the very concept of expressing an input as a function is. We are functional programmers after all :) > A better solution IMO would be to improve the ‘snippet’ mechanism in > the first place. ‘computed-origin-method’ improves on it in two > ways: (1) lazy evaluation of the gexp, and (2) allows the use of a > different base name. > > I would think #2 is addressed by the ‘file-name’ field (isn’t it?). > > As for #1, it can be addressed by making the ‘snippet’ field delayed > or thunked. It’s a one line change; the only thing we need is to > measure, or attempt to measure, the impact it has on module load > time. > > Thoughts? This would work for packages, whose source are some base source with patches or snippets applied, as is indeed the case for linux and icecat. However, there are also other potential uses for computed origins. Grepping for the string "'unpack 'unpack", which indicates that more sources are unpacked at build-time returns more than fifty instances in a number of locations. This is potentially dangerous, as for one, we will probably want to phase out the "origins as inputs" idiom once we have short-form inputs and also it could be argued, that `guix build -S` returns something wrong in those packages. I think that some version of `computed-origin-method' will eventually need to become public API as such packages may not always be best described as "a base package with a snippet". If we had recursive origins – i.e. origins, that can take origins as inputs – we might be able to do some of that, but I don't think it would necessarily work for linux-libre or icecat, as with those you don't want the tainted versions to be kept around. Perhaps this could be worked around by not interning the intermediate origins, but only using their file-names inside the temporary directory in which the snippet is applied? Another thing is that the final act of the linux-libre promise is not the packing of the tarball, but the deblob-check. Guix currently lacks a way of modeling such checks in their origin, but I'd argue it would need one if we wanted to do computed origins via snippets. This is not required by icecat and so one "simplification" could be that computed- origin-method would not require the user to create a tarball, but instead simply provide a name for the tarball and a directory to create it from (via a promise again). A combination of the above might make computed origins obsolete for good, but the question remains whether that is a better design. What do y'all think?