From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id wF98DmJQUWTxiQAASxT56A (envelope-from ) for ; Tue, 02 May 2023 20:03:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0KthDmJQUWS6QwEAauVa8A (envelope-from ) for ; Tue, 02 May 2023 20:03:14 +0200 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 D0EDC32DCE for ; Tue, 2 May 2023 20:03:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptuKk-0008Gl-OB; Tue, 02 May 2023 14:02:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ptuKd-0008GS-9G for guix-devel@gnu.org; Tue, 02 May 2023 14:02:31 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ptuKb-0005wg-BE for guix-devel@gnu.org; Tue, 02 May 2023 14:02:30 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f3284dfe34so6760675e9.0 for ; Tue, 02 May 2023 11:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683050539; x=1685642539; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=gGtlsXMCWVte5zsoC7YqzDWSQ22xGDyMSI8D45Edw1c=; b=BR83xFH1g8fTOfWxAViF1Q9yieoHiL7HpT+FaUNQkRjusNL0fGOnln9hYshRMqPOHq rWlcyztJq50qGf77DLxEpI/zXq3cV/mwhnOr2ryqYMFFvGUUQzeN9MvMsJvw2xMexmYk orBF95daXMMqk64/Ed1n6gJJ+jnN/nwRhDcatC7QWEVuPQMe3UlXZ8AF3D9uGOIxGrYZ 3A8+sFmmfyef6opNNOlSKdp8pZzCezoZGVPdHVa/qQhSdfM2FOZI+vBsX1Dt2GxOPlWt m/T9lSOdHhflkVlr3oaeA4D+9lbXKItwmUhoL71OjrzX8mERabgNyZM1qkpQvvwpOkG/ NrzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683050539; x=1685642539; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gGtlsXMCWVte5zsoC7YqzDWSQ22xGDyMSI8D45Edw1c=; b=LwFcu7A1PPn6uLBlqW9VrtRO2txN+K61VLKCfRfigD0kKmo/+HhwaTRCCuCKyC0tyQ 76zu1sPScXVTq8N1epfpzQyp/AWv5SZ0OkEdzOim8MGyVmKNe6N6qg5dI4vdutSTA+/+ xi8umI0sPlSoU26rTW58dn7R8hRR7X1UdEpqJTY8KMVrfxecSdP9lSsDAWWGCiU0xf5c mZeLaOTLKkAxqhyiwD8mCE90WxOrqMYWe1y3g8GLwqYwRynChVUwKnDYX5OyuIjcpIY/ yYpGytbP6ME34WxoZRKWXsEtHuTZ8qDcrZ7iuIHkAYhFst9jc50gG/TzTKX3hDNp4ru2 H+zw== X-Gm-Message-State: AC+VfDycLYLUBoid+ZN8QI9RX8h+RT4DFP9TyQbZpDCqgTMJrQTST2st 2XDBFpjtSNpA9HJzvTQHtN8= X-Google-Smtp-Source: ACHHUZ6A8GshU3BNeZYxAO8xjjpVt4rheGbLGVL53n25raA3I/LzPmFRIV4IVRsvwYjEZMIeODCKiw== X-Received: by 2002:a05:600c:602a:b0:3f1:8c5d:145 with SMTP id az42-20020a05600c602a00b003f18c5d0145mr2771844wmb.0.1683050539048; Tue, 02 May 2023 11:02:19 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id i6-20020a5d6306000000b002fed865c55esm31593809wru.56.2023.05.02.11.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 11:02:18 -0700 (PDT) From: Simon Tournier To: Maxim Cournoyer , Ludovic =?utf-8?Q?Court?= =?utf-8?Q?=C3=A8s?= Cc: =?utf-8?Q?Bj=C3=B6rn_H=C3=B6fling?= , guix-devel@gnu.org, Lars-Dominik Braun Subject: Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json In-Reply-To: <871qjy51zo.fsf@gmail.com> References: <20230312220021.22bfff4f@tangletp> <878rfwgbng.fsf@gnu.org> <86lej8y75p.fsf@gmail.com> <87cz3t44hi.fsf_-_@inria.fr> <86pm7sb7vf.fsf@gmail.com> <87354oqdal.fsf@gmail.com> <87v8hg9lct.fsf@gmail.com> <875y9c9963.fsf@gmail.com> <87v8hb9o74.fsf@inria.fr> <871qjy51zo.fsf@gmail.com> Date: Tue, 02 May 2023 19:35:59 +0200 Message-ID: <86ilda1vr4.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::335; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x335.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683050594; a=rsa-sha256; cv=none; b=ncPE0N31/w9QwWBxyNfp5Y1I62Zu+Gw/Gznuxcu9VCAN+zKUPf0ybDGNPSIzc8ujMbg4VL IvN8OMhdOpSjbFgc9nEBvG9xJ6nUtMBC62ZH3HpeMyUFaz/sTlUHH1LIR1l7gL2ppCwalJ /nHFRc5MRNvcTMIvcqH3e2ycaNGxCXQqpniFLWT5aulut3YBfmkhPt9TcbNjT2Br1wCuRz sQFJ6YkkpEGhn+3k4TgyWHG4COnuolp4L2VT9nTWpm9lh4nvp1Jhpfhvqz/voAzRSquDbY WLQaTz2uwCZWOaOGjk6F7KymITTNHxnL6GTFFOMQMcYxBwj2wSajRxSK7E7k8g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=BR83xFH1; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683050594; 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=gGtlsXMCWVte5zsoC7YqzDWSQ22xGDyMSI8D45Edw1c=; b=V70eLO3ltFVzrHgb6naYlf6MSk9AR5g00eJwn4XHbiwiE+c9yV6qgWDuBd42Po0pVz2v33 XngfHuq7XL3Wna7hgooenPbmzIYZEcnrevg5ppF+DlvQMmKbQGTYfuHSkaVzDae8NRHbFx ltiopfQYpmDbDCyLBv7AkTb73NFlMgSEdLW1s6nqx/OSRZ6OscPGECpG46tKKukxtmpVz8 3pdEAZFmbVMFRDDczDOmj9Zv4f5qze9vrlZs3WQSr1z9kDTSN5sBKE4GS912UlQnuEgTYr Z/czEiOaXADDa3FwFwjzXpiulawliRrpN3mgq0fKSWiV36GI3H94pqygQfRvxQ== X-Migadu-Spam-Score: -3.41 X-Spam-Score: -3.41 X-Migadu-Queue-Id: D0EDC32DCE X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=BR83xFH1; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-TUID: tDCCbTblkwOv Hi, On Tue, 02 May 2023 at 08:52, Maxim Cournoyer w= rote: > Thanks for explaining, it makes sense. One way to tip package writers > in the right direction would be to add a warning when such a situation > occurs upon running 'guix lint'. Somehow improve =E2=80=9Cguix lint -c archival=E2=80=9D. ;-) > Simon's solution is a bit more complicated/verbose than the gexp version > currently in used taste, but it works while preserving the origin and > avoids extra steps in each package that will be using sorbet-monorepo, > so I think I'd go with it. My point was to show that =E2=80=99snippet=E2=80=99 could produce the exact= same output but exposing the =E2=80=99origin=E2=80=99 usable by third-party (sources.js= on or else). Maybe the snippet can be simplified. :-) Another solution would to list =E2=80=99sorbet-monorepo=E2=80=99 as an inpu= t and then apply a generic build phase dealing with mono repo. Hum, I think the =E2=80=99snippet=E2=80=99 approach is better. :_ Note =E2=80=99racket-packages-origin=E2=80=99 from (gnu packages racket) lo= oks similar: --8<---------------cut here---------------start------------->8--- (computed-file (string-append "racket-pkg-" name "-sources") (with-imported-modules `((guix build utils)) #~(begin (use-modules (guix build utils)) (mkdir-p (string-append #$output "/share/racket/pkgs")) (chdir (string-append #$output "/share/racket/pkgs")) #$@(map (match-lambda ((? string? name) #~(copy-recursively #$(file-append origin (string-appen= d "/" name)) #$name)) ((name ".") #~(copy-recursively #$origin #$name)) ((name path) #~(copy-recursively #$(file-append origin (string-appen= d "/" path)) #$name))) specs))))) --8<---------------cut here---------------end--------------->8--- and that somehow uses the =E2=80=99inputs=E2=80=99 approach. Well, contrar= y to what I said earlier in this thread, not all the sources for building Racket are captured by sources.json: --8<---------------cut here---------------start------------->8--- $ wget https://guix.gnu.org/sources.json $ guix shell jq $ cat sources.json | jq | grep sorbet $ cat sources.json | jq | grep 'github.com/racket' "git_url": "https://github.com/racket/racket", --8<---------------cut here---------------end--------------->8--- As you see, it requires, https://github.com/racket/2d as input and that=E2=80=99s not listed. I will give a look later if no one beats me. :-) Somehow, my initial point when mentioning =E2=80=99computed-origin-method= =E2=80=99 is that maybe there is a need. Maybe it=E2=80=99s an opportunity to rehash th= is =E2=80=9Cmethod=E2=80=9D. Or another that provides 1. the structure we nee= d for extracting and 2. the flexibility we need for special use cases. Cheers, simon