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 iOpcA94HUWQ1OAAASxT56A (envelope-from ) for ; Tue, 02 May 2023 14:53:50 +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 aDUFA94HUWRPwgAAauVa8A (envelope-from ) for ; Tue, 02 May 2023 14:53:50 +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 A63C0E6C0 for ; Tue, 2 May 2023 14:53:49 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptpVD-0004nq-9Z; Tue, 02 May 2023 08:53:08 -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 1ptpVA-0004mW-Qq for guix-devel@gnu.org; Tue, 02 May 2023 08:53:04 -0400 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ptpV9-0003Ms-0Z for guix-devel@gnu.org; Tue, 02 May 2023 08:53:04 -0400 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-7516ac80c6cso184786185a.1 for ; Tue, 02 May 2023 05:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683031981; x=1685623981; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=FOFebP3pwO1fXYbWyj1CXyi5EPhUDp7hrM4yFf40u6Q=; b=ecsMrQVP5tIl54htTODF4PpwHclajyqnA7viN7cC+Kqor5rahCoq3SDdsjmdA59Vgp djhM2vzH4z5ATcIl+ugSb/0hjwbEJAGsefUZCEYQMNHJ3veDAFjvq5ea6gHgO3WEwDvz ys7AWoa3ycDZXXoSnpTu8Bcj3q1tgY+fEEPMIIHhA3rOmAJyhYIeadQnIi46pPTTmeA1 t+4aPCgtLwwbzCoL9feQlVWkGhVGi9iNJ4AhdDpirADooWiv6mIXZAItkOZ3r292A+pc EdUZ+MPsAhsNpKcnKiRMlpSsOFhHdMi5YvmorWuFX/oYbWI7oZryTM812Ta/DQSol35N 0lmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683031981; x=1685623981; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FOFebP3pwO1fXYbWyj1CXyi5EPhUDp7hrM4yFf40u6Q=; b=AMlvYSofOj3DxurCr7IKw+nF79x/R/nlQNjxs+8XYfm296uPsrBqe4g6cEf2t+paxu 7wquPMYs39tRRCdh/1R/8/J2Uvq/yvPbQXooF9RDURBqhGCAz+BwkW42Yo53Z5Z2Gysy TTFEmRtyY1zwINAPPxWrfiGpVKwUp+OtZfxqo9IayBL4T4G3PrFQLf2CwuZkf/5tugYi w9hqCm9YcEZ0os6UlSUPol6kHYR+m6bB0S5gIcONtK75DZhLEvYFK99EgdKyriSYbZI5 mJUlfJ6h7WDpOgPsmoMy1EHcDgWAtzOqRv5JyTt5xmf9+lJZBS2d1sKvsmXlY1zmaRjn RTew== X-Gm-Message-State: AC+VfDyGU1Z2p7VN+wtNQfQ5/2sXk4lAiBF1nWc7EFT6ThlQPNM4ORqq 2fEtD3iGEB5UuWY/LpMFGJk= X-Google-Smtp-Source: ACHHUZ6cVbCBqX6GFTQWUXzdA2rDfPD7I8L0KZVI97CU/Z+kWG65vRepfmpFJh3xWA7pn9fJolyvFw== X-Received: by 2002:a05:622a:1741:b0:3ef:3711:e571 with SMTP id l1-20020a05622a174100b003ef3711e571mr25567177qtk.36.1683031981340; Tue, 02 May 2023 05:53:01 -0700 (PDT) Received: from hurd (dsl-157-118.b2b2c.ca. [66.158.157.118]) by smtp.gmail.com with ESMTPSA id dp1-20020a05620a2b4100b0074ded6ad058sm9668835qkb.129.2023.05.02.05.53.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 05:53:00 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: Simon Tournier , =?utf-8?Q?Bj=C3=B6rn_H?= =?utf-8?Q?=C3=B6fling?= , guix-devel@gnu.org, Lars-Dominik Braun Subject: Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json 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> Date: Tue, 02 May 2023 08:52:59 -0400 In-Reply-To: <87v8hb9o74.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Tue, 02 May 2023 09:39:43 +0200") Message-ID: <871qjy51zo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::732; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x732.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=1683032029; a=rsa-sha256; cv=none; b=sl6bGqHsQEDyY4udAQOt8+8NBXiqtYi1VqOL6GZBmFruHJhy8bv0mFnedYPOqQK2Wc93A0 dn+AKOxU98oGz3OKtfL2+tNLzUa9E3SuwjbcHIf5c2iqUysCFu47wDN06+92b02Rhx9oRu IyioxIIThXxkAMy23fkL66EedU2bwMQWeGQnCRx/mft1erHug77ikLveC7KaGdSU/W5onT C7ZVjGterOsRKkQZ+TFx29AFhFj2VgQntghR0nZeOMBb+r8u144Dnt7wkix8y65snQeXQi 34mqHxQxjlRrF/heeT0YtIxujc8KFNA+19wjxQEz+H0c7Dwzw54aJCKpxt3ZVg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=ecsMrQVP; 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=1683032029; 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=FOFebP3pwO1fXYbWyj1CXyi5EPhUDp7hrM4yFf40u6Q=; b=bGCfBgvBsi3vRsJxFE9zCxPy14Fv+4TycK9glHRWCMMosghJjJNlvYemg7q6+HXGT9mRj6 DnpPUmoVDtgwISuc+etakDofB9KlWXw5xsjqo/AN/dCK3tV9fttcF4xpZRYQ5eqpjqP7wU McPC06SV1OsL1O1Iely8jnjBG0Bjmu+jzWzIW8glXjbMLZbFR7ODBklUGs1OaWPkkzrf0l VnXVrrbn8/gpXQnnpAxhHSpGKOuKhf/ntn6Cey0mtrEZsEI0JDh+GeP++m3r2600W1tyoN ZihKCj054gccvdlBFdNfR7uQDrrQtcbcY0ewUyKusqBxIHQ/I3Gvj91yzY33uA== X-Migadu-Spam-Score: -3.31 X-Spam-Score: -3.31 X-Migadu-Queue-Id: A63C0E6C0 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=ecsMrQVP; 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: mtHdh94R/yDa Hi Ludo, Ludovic Court=C3=A8s writes: > Hello, > > Maxim Cournoyer skribis: > >> Simon Tournier writes: > > [...] > >>> I agree that any file-like object is nice. Somehow, the issue is to >>> =E2=80=9Cunpack=E2=80=9C the information of this object. For instance, >>> >>> scheme@(guix-user)> (define ruby-sorbet-runtime (@@ (gnu packages ruby)= ruby-sorbet-runtime)) >>> scheme@(guix-user)> (package-source ruby-sorbet-runtime) >>> $1 =3D #< name: >>> "ruby-sorbet-runtime-0.5.10610.20230106174520-1fa668010-checkout" >>> gexp: #>> (copy-recursively (string-append #>> #< url: "https://github.com/sorbet/sorbet" commit: >>> "0.5.10610.20230106174520-1fa668010" recursive?: #f> #>> sha256:0f21dl06alxwn6xgdxyrkd58plmmsv04z2bcls9ld4cfzsrs5537> () >>> 7fd7ad6b81e0>:out> "/gems/sorbet-" #) >>> #)) gnu/packages/ruby.scm:14071:5 7fd7ae734480> >>> guile: #f options: (#:local-build? #t)> >>> >>> >>> and as far as I understand, this case cannot be handled by some generic >>> code. The extraction of the =E2=80=9Creal=E2=80=9D origin needs manual= and specific >>> extraction because of this =E2=80=99computed-file=E2=80=99. >>> >>> For sure, =E2=80=99source=E2=80=99 can use any file-like object because= some use-cases >>> require that. However, I would be tempted to use an =E2=80=99origin=E2= =80=99 as a >>> preferred choice =E2=80=93 i.e., when it=E2=80=99s possible and try to = make it >>> possible. ;-) Because, somehow, it =E2=80=9Cnormalizes=E2=80=9C the sou= rce information >>> and eases its extraction. > > Oh, got it. > >> I'm not sure I follow, perhaps because I lack context about how >> Disarchiver use the source field of a package. Would you mind >> explaining a bit what the problem is or pointing me to a place it was >> already explained? > > The problem with the idiom used for =E2=80=98ruby-sorbet-runtime=E2=80=99= is that the > origin is hidden inside a gexp. > > Thus, the machinery that produces > (the file that SWH fetches periodically to ingest the source code > packages refer to) will not add it. To put it differently, we have no > guarantee that the commit above will be archived and that we=E2=80=99ll > eventually be able to rebuild =E2=80=98ruby-sorbet-runtime=E2=80=99. > > So I guess as a matter of policy, we should try and find other ways to > express this so we don=E2=80=99t lose track of origins. 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'. > In this particular case, we could do what Simon proposed or, even > simpler, just add a phase that calls =E2=80=98chdir=E2=80=99 (the advanta= ge being that > we don=E2=80=99t have to create copies of subsets of =E2=80=98sorbet-mono= repo=E2=80=99). I seem to recall there was more to it than simply having a self-contained source correctly named, such as avoiding extra phases doing chdir and having to delete extraneous .gems that'd get picked up erroneously and build the wrong thing/fail the build. 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. --=20 Thanks, Maxim