GNU bug report logs - #50515
(guix-artwork)[PATCH 0/2] List linux origins in 'sources.json'.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: zimoun <zimon.toutoune@HIDDEN>; Keywords: patch; dated Sat, 11 Sep 2021 00:15:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 50515 <at> debbugs.gnu.org:


Received: (at 50515) by debbugs.gnu.org; 16 Sep 2021 11:49:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 16 07:49:03 2021
Received: from localhost ([127.0.0.1]:54008 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQpt1-0007Rm-9P
	for submit <at> debbugs.gnu.org; Thu, 16 Sep 2021 07:49:03 -0400
Received: from mail-qt1-f171.google.com ([209.85.160.171]:34385)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mQpsz-0007RG-A7
 for 50515 <at> debbugs.gnu.org; Thu, 16 Sep 2021 07:49:01 -0400
Received: by mail-qt1-f171.google.com with SMTP id 2so5225887qtw.1
 for <50515 <at> debbugs.gnu.org>; Thu, 16 Sep 2021 04:49:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=vPLyQjQL3+difjvlrEF0yqHj+M3JNJD0i9a8x4BFLSQ=;
 b=oAHopS61t22ganYTAH1TdA0iiHHmkOhe0yR2m13b9e1KeajvFtS3CkePTf5YzF/5Xp
 zRTkd/a1MF0QGfMrNhmqWSl5bpGDLtq3dtiO4BF4OBs4HfEVLRatJ9NlK6PwZ/bQL9Al
 0ZXOP9jtj+4e+6v6V5Ys0DlEAAIwyYGBl/OFdFBSF6+5jOf6POGEG1OFif+UG6mXL9Xr
 E2KnhMpjHgXDEeZkxaXDRcGqeSCD5x9bY5+xt3Kd5c9eZMFYCaDtuQpphS5OGa+pvHyW
 KFx6KwCU2mV7G/iRhxNkbWOrd9OYdAAHAQAdrXJgGlg5x5e9jOe6OmCaxWmdnl3RDhgA
 kWhw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=vPLyQjQL3+difjvlrEF0yqHj+M3JNJD0i9a8x4BFLSQ=;
 b=S/M371xHXiAhojsswz99earOmxeVo1fYkamzM88TKuRUdgSuOH6kkcB0/jLPs09VM+
 UzjcNjGE3o6uqsqGMpKQpzMq9VT8N9W9Cv8M/LEe/wsbNqQGIlkU85n5zO9JbRrsLbNj
 mKxRTSbjRXB00CqkR4fVgzSD1v7YfbY93PFlUFuFuyoN+gTvvtgkY/zegQZhs/gwHxMj
 j8Ok5fJ7cZ0dz5x5ohpZ4B0IssNlzywsDJEB3jbdJCzwep8/yS2h7aYi6kNh2293n5Az
 OrHh4L7iobGNTijskncGWGTI/vcprDnnPvRSDuBwWfo6QIYKn774WOGz/7EjmrGRF5QD
 FN9g==
X-Gm-Message-State: AOAM5324c0Gg9KBBNP4GA+BGrG6V2EKjFAQo5rwhj3EaidGGjNhFsJA0
 hz6GFeohaD7tMR5Y0isYVx1ij7SVs7Qc7KynKKDXlg+vw94=
X-Google-Smtp-Source: ABdhPJyLjPqb4OhpMzBuo1iYOAect8CoTZd0iPEaHmm8xQTRfDc4mLab7eR4GwPTitV7OLxmGbFjdwdkwn/FaGzOqI8=
X-Received: by 2002:ac8:66d8:: with SMTP id m24mr4568872qtp.39.1631792935731; 
 Thu, 16 Sep 2021 04:48:55 -0700 (PDT)
MIME-Version: 1.0
References: <20210911002608.14074-2-zimon.toutoune@HIDDEN>
 <20210911002608.14074-1-zimon.toutoune@HIDDEN> <87a6kid34a.fsf@HIDDEN>
 <865yv5vu06.fsf@HIDDEN> <871r5pcrhz.fsf@HIDDEN>
In-Reply-To: <871r5pcrhz.fsf@HIDDEN>
From: zimoun <zimon.toutoune@HIDDEN>
Date: Thu, 16 Sep 2021 13:48:44 +0200
Message-ID: <CAJ3okZ2bbM6hno17RzGCLaTbE9cjvnd6TwXZuEUiiSrN_YOgkA@HIDDEN>
Subject: Re: [PATCH 2/2] website: Add 'computed-origin-method' packages to
 'sources.json'.
To: Mark H Weaver <mhw@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50515
Cc: 50515 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Mark,

On Thu, 16 Sept 2021 at 02:08, Mark H Weaver <mhw@HIDDEN> wrote:
> zimoun <zimon.toutoune@HIDDEN> writes:
>
> > Therefore, there is an option (3). Move the =E2=80=99computed-origin-me=
thod=E2=80=99
> > procedure to (guix packages) and add a comment about it; use it for
> > icecat and linux with (@@ (guix packages) computed-origin-method).
> >
> > WDYT about this (3)?  It simplifies this patch and let the time to
> > discuss the =E2=80=99computed-origin-method=E2=80=99 case without expos=
ing it to the
> > public API.
>
> Sure, that sounds like a fine approach.

Done in patch#50620.

<http://issues.guix.gnu.org/50620>

Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#50515; Package guix-patches. Full text available.

Message received at 50515 <at> debbugs.gnu.org:


Received: (at 50515) by debbugs.gnu.org; 16 Sep 2021 00:09:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 15 20:09:04 2021
Received: from localhost ([127.0.0.1]:53459 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQexb-0006cz-Pr
	for submit <at> debbugs.gnu.org; Wed, 15 Sep 2021 20:09:03 -0400
Received: from world.peace.net ([64.112.178.59]:57558)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mhw@HIDDEN>) id 1mQexY-0006cR-LU
 for 50515 <at> debbugs.gnu.org; Wed, 15 Sep 2021 20:09:02 -0400
Received: from mhw by world.peace.net with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <mhw@HIDDEN>)
 id 1mQexS-0007iE-0Z; Wed, 15 Sep 2021 20:08:54 -0400
From: Mark H Weaver <mhw@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>
Subject: Re: [PATCH 2/2] website: Add 'computed-origin-method' packages to
 'sources.json'.
In-Reply-To: <865yv5vu06.fsf@HIDDEN>
References: <20210911002608.14074-2-zimon.toutoune@HIDDEN>
 <20210911002608.14074-1-zimon.toutoune@HIDDEN>
 <87a6kid34a.fsf@HIDDEN> <865yv5vu06.fsf@HIDDEN>
Date: Wed, 15 Sep 2021 20:07:09 -0400
Message-ID: <871r5pcrhz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50515
Cc: 50515 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Simon,

zimoun <zimon.toutoune@HIDDEN> writes:

> Therefore, there is an option (3). Move the =E2=80=99computed-origin-meth=
od=E2=80=99
> procedure to (guix packages) and add a comment about it; use it for
> icecat and linux with (@@ (guix packages) computed-origin-method).
>
> WDYT about this (3)?  It simplifies this patch and let the time to
> discuss the =E2=80=99computed-origin-method=E2=80=99 case without exposin=
g it to the
> public API.

Sure, that sounds like a fine approach.

   Thank you!
      Mark

--=20
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>.




Information forwarded to guix-patches@HIDDEN:
bug#50515; Package guix-patches. Full text available.

Message received at 50515 <at> debbugs.gnu.org:


Received: (at 50515) by debbugs.gnu.org; 13 Sep 2021 07:18:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 13 03:18:08 2021
Received: from localhost ([127.0.0.1]:44046 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mPgEC-0008Ac-7I
	for submit <at> debbugs.gnu.org; Mon, 13 Sep 2021 03:18:08 -0400
Received: from mail-wr1-f43.google.com ([209.85.221.43]:45036)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mPgEA-0008A0-4u
 for 50515 <at> debbugs.gnu.org; Mon, 13 Sep 2021 03:18:07 -0400
Received: by mail-wr1-f43.google.com with SMTP id d6so12987332wrc.11
 for <50515 <at> debbugs.gnu.org>; Mon, 13 Sep 2021 00:18:06 -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=xUrpcfKSMj7qsgl07P2WZGhe3zeTvNKbk9O3k2i0J8E=;
 b=kD/bys02EEOwuNM2ZxzrddoBTXszSERDXsypfHk3GeuUWHtJi7Y/2h5cYlJxHVpxFz
 7MUSS2FpCjl4nRmRmLvGVjaZtK63GEX859vrVLFYwk/AgDahD/IF3ZpsqNXQhIR6ywKm
 GsEx9l/bjoqfwYcEarBPZ8nqCZ7m/mvOjON1fDMBra93LApXPAHMdGYI5X5FAKeMkXP9
 WPv/qgRcE9GVh3e/ohvUIlguyHtu2ygYpk0xPA0PNt/JZIsHhoCWwMVXf690mCACzAIy
 EMa9vLp7ln1jxANvDZ5ea0RHG/cj4mdh/zMnvFXL3JiiSDiQYij1zCIyANbhPXfFr/lx
 VBIw==
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=xUrpcfKSMj7qsgl07P2WZGhe3zeTvNKbk9O3k2i0J8E=;
 b=2kCn/4abz5hRsI6tBRvDuZinpbHx9SaDnGYROu2k3sjUGipZLlilwzIN1lIidiuHE9
 1dcmZASoLzkMHUY1wJio1OAhguFcyC1OQOn67aSX0IuY5g5HAlNkPEGy4IkMNC82mdBR
 TPrKHtumCjcCL7dh9GzINGHA0iEspa2IYJT6G4Ggdgw/Oo1QFMrlpOToROW+d0zj3SCg
 K2Gtq5YGGnSFtCk2fAYg0xYmhzjtKS3MwinuUy2O8AC1cr8YMzPgnKj4m5IoQShqxW3d
 zp2/q4l7n1bgTChR+ozeVP9sSBIvk/xM8nyUOtE0opDEY/IkZnUmj5WOuWQfxn0LuyCC
 L+Sw==
X-Gm-Message-State: AOAM531klYXLqgFMvO9RocuEBahHpVM4jqBJ3HvOOy917RRluTcV1Qc0
 J0bkeV6BM4ncKYfr3usmjOPG1sbjMEs=
X-Google-Smtp-Source: ABdhPJyTojq+8BSO/eUmOD5WeCWeaO3Uj2cJwobm3etWXq6FjPLLaV06CHx63xQ/w5GMAdnY1t7h+Q==
X-Received: by 2002:a05:6000:1627:: with SMTP id
 v7mr11048543wrb.347.1631517480023; 
 Mon, 13 Sep 2021 00:18:00 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id u13sm6441667wrt.41.2021.09.13.00.17.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 13 Sep 2021 00:17:59 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Mark H Weaver <mhw@HIDDEN>
Subject: Re: [PATCH 2/2] website: Add 'computed-origin-method' packages to
 'sources.json'.
In-Reply-To: <87a6kid34a.fsf@HIDDEN>
References: <20210911002608.14074-2-zimon.toutoune@HIDDEN>
 <20210911002608.14074-1-zimon.toutoune@HIDDEN>
 <87a6kid34a.fsf@HIDDEN>
Date: Mon, 13 Sep 2021 09:01:45 +0200
Message-ID: <865yv5vu06.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50515
Cc: 50515 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Mark,

Thanks for looking at the patch and for your inputs.


On Sat, 11 Sep 2021 at 20:54, Mark H Weaver <mhw@HIDDEN> wrote:

>> @@ -106,53 +109,67 @@
>>           (append-map (cut maybe-expand-mirrors <> %mirrors)
>>                       (map string->uri urls))))
>>=20
>> -  `((type . ,(cond ((or (eq? url-fetch method)
>> -                        (eq? url-fetch/tarbomb method)
>> -                        (eq? url-fetch/zipbomb method)) 'url)
>> -                   ((eq? git-fetch method) 'git)
>> -                   ((or (eq? svn-fetch method)
>> -                        (eq? svn-multi-fetch method)) 'svn)
>> -                   ((eq? hg-fetch method) 'hg)
>> -                   (else                   #nil)))
>> -    ,@(cond ((or (eq? url-fetch method)
>> +  (match uri
>> +    ((? promise? promise)               ;computed-origin-method
>> +     (match (force promise)
>
> Here, you're implicitly assuming that 'computed-origin-method' is the
> only origin method that puts a promise in the 'uri' field.  That may be
> true today, but it will not necessarily be true tomorrow, and therefore
> it seems suboptimal to make that assumption in the code.

Yes, I agree.  My initial draft contained something as your wrote below:

     (or (eq? method (@@ (gnu packages gnuzilla) computed-origin-method))
         (eq? method (@@ (gnu packages linux) computed-origin-method)))

but then, I thought it was a redundant test because then the promise
check is necessary to unwrap the values of embedded origins.  And
currently, all the 'computed-origin-method's use a promise.

> Instead, I would suggest checking for "computed origins" in the same way
> that is done for the other cases: using 'eq?'.  It's not ideal, but it's
> more future-proof than checking for a promise in the 'url' field, and
> anyway it's the way things are currently being done.

I cannot predict the future but the check about the method is as
suboptimal as mine. :-) If another package uses computed-origin-method,
then it should be added here.  However, from my understanding, there is
an higher probability that this hypothetical packages would use a
promise.

> However, there's a difficulty, and I suspect you're already aware of it
> and that it's why you used the suboptimal approach above:
>
> At present, 'computed-origin-method' is not exported by any Guix module,
> nor is there even a unique definition of it.  Instead, there are two
> copies of it, one in gnuzilla.scm and one in linux.scm.

Yes. :-)

> The reason 'computed-origin-method' is not exported is because it never
> went through the review process that such a radical new capability in
> Guix should go through before becoming part of it's public API.
>
> At the time that I added 'computed-origin-method', I was under time
> pressure to push security updates for IceCat, and my previous method of
> cherry picking dozens of upsteam patches and applying them to the most
> recent IceCat release suddenly became impractical due to comprehensive
> code reformatting done upstream.
>
> I've always viewed 'computed-origin-method' as a temporary hack to work
> around limitations in the 'snippet' mechanism.  Most importantly, last I
> checked, it was not possible for a 'snippet' to produce a tarball with a
> different base name than the original downloaded source.  I consider it
> a *requirement* for the 'icecat' source tarball and it's unpacked
> directory to be named "icecat-=E2=80=A6" and not "firefox-=E2=80=A6", and=
 similarly for
> 'linux-libre'.

Thanks for explaining.

> Anyway, regarding your proposed patch: for now, I would suggest the
> following options:
>
> (1) In a separate preceding commit, move 'computed-origin-method' to its
>     own module, export it, use the exported one in gnuzilla.scm and
>     linux.scm, and use 'eq?' to test for it in the code above.  There
>     should probably also be a comment next to the definition of
>     'computed-origin-method' pointing out that it's a temporary hack,
>     hopefully to be superceded by snippets when they have gained the
>     required functionality.

I think it is the better approach.  Move the =E2=80=99computed-origin-metho=
d=E2=80=99
procedure to (guix packages) and export it; add a comment about it.

However, I would not like that the sources.json situation stays blocked
by the computed-origin-method situation when sources.json is produced by
the website independently of Guix, somehow. :-)

Therefore, there is an option (3). Move the =E2=80=99computed-origin-method=
=E2=80=99
procedure to (guix packages) and add a comment about it; use it for
icecat and linux with (@@ (guix packages) computed-origin-method).

WDYT about this (3)?  It simplifies this patch and let the time to
discuss the =E2=80=99computed-origin-method=E2=80=99 case without exposing =
it to the
public API.

> (2) Alternatively, for now, use 'eq?' against the two private copies
>     (accessed using @@, see below), along with a "FIXME" comment.
>
> ___ (or (eq? method (@@ (gnu packages gnuzilla) computed-origin-method))
> _______ (eq? method (@@ (gnu packages linux) computed-origin-method)))

I commented above why I am not convinced that is better than directly
check the promise.  I do agree with the FIXME comment; the commit
message is not enough here.



Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#50515; Package guix-patches. Full text available.

Message received at 50515 <at> debbugs.gnu.org:


Received: (at 50515) by debbugs.gnu.org; 12 Sep 2021 00:56:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 11 20:56:38 2021
Received: from localhost ([127.0.0.1]:41650 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mPDnS-0002S1-6A
	for submit <at> debbugs.gnu.org; Sat, 11 Sep 2021 20:56:38 -0400
Received: from world.peace.net ([64.112.178.59]:49096)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mhw@HIDDEN>) id 1mPDnQ-0002Ro-BR
 for 50515 <at> debbugs.gnu.org; Sat, 11 Sep 2021 20:56:36 -0400
Received: from mhw by world.peace.net with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <mhw@HIDDEN>)
 id 1mPDnJ-0002QN-Ko; Sat, 11 Sep 2021 20:56:29 -0400
From: Mark H Weaver <mhw@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>
Subject: Re: [PATCH 2/2] website: Add 'computed-origin-method' packages to
 'sources.json'.
In-Reply-To: <20210911002608.14074-2-zimon.toutoune@HIDDEN>
References: <20210911002608.14074-2-zimon.toutoune@HIDDEN>
 <20210911002608.14074-1-zimon.toutoune@HIDDEN>
Date: Sat, 11 Sep 2021 20:54:50 -0400
Message-ID: <87a6kid34a.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50515
Cc: 50515 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Simon,

> With Guix 9875f9bca3976bf3576eab9be42164fde454597e, the packages consider=
ed
> are IceCat and the Linux kernel; see: gnu/packages/gnuzilla.scm and
> gnu/packages/linux.scm.
>
> * website/apps/packages/builder.scm (gexp-references): Unexported variable
> from the module '(guix gexp)'.
> (origin->json): Add 'computed-origin-method' case.

Thanks for working on this.

> diff --git a/website/apps/packages/builder.scm b/website/apps/packages/bu=
ilder.scm
> index fb53215..ecf958a 100644
> --- a/website/apps/packages/builder.scm
> +++ b/website/apps/packages/builder.scm
[...]
> @@ -106,53 +109,67 @@
>           (append-map (cut maybe-expand-mirrors <> %mirrors)
>                       (map string->uri urls))))
>=20
> -  `((type . ,(cond ((or (eq? url-fetch method)
> -                        (eq? url-fetch/tarbomb method)
> -                        (eq? url-fetch/zipbomb method)) 'url)
> -                   ((eq? git-fetch method) 'git)
> -                   ((or (eq? svn-fetch method)
> -                        (eq? svn-multi-fetch method)) 'svn)
> -                   ((eq? hg-fetch method) 'hg)
> -                   (else                   #nil)))
> -    ,@(cond ((or (eq? url-fetch method)
> +  (match uri
> +    ((? promise? promise)               ;computed-origin-method
> +     (match (force promise)

Here, you're implicitly assuming that 'computed-origin-method' is the
only origin method that puts a promise in the 'uri' field.  That may be
true today, but it will not necessarily be true tomorrow, and therefore
it seems suboptimal to make that assumption in the code.

Instead, I would suggest checking for "computed origins" in the same way
that is done for the other cases: using 'eq?'.  It's not ideal, but it's
more future-proof than checking for a promise in the 'url' field, and
anyway it's the way things are currently being done.

However, there's a difficulty, and I suspect you're already aware of it
and that it's why you used the suboptimal approach above:

At present, 'computed-origin-method' is not exported by any Guix module,
nor is there even a unique definition of it.  Instead, there are two
copies of it, one in gnuzilla.scm and one in linux.scm.

The reason 'computed-origin-method' is not exported is because it never
went through the review process that such a radical new capability in
Guix should go through before becoming part of it's public API.

At the time that I added 'computed-origin-method', I was under time
pressure to push security updates for IceCat, and my previous method of
cherry picking dozens of upsteam patches and applying them to the most
recent IceCat release suddenly became impractical due to comprehensive
code reformatting done upstream.

I've always viewed 'computed-origin-method' as a temporary hack to work
around limitations in the 'snippet' mechanism.  Most importantly, last I
checked, it was not possible for a 'snippet' to produce a tarball with a
different base name than the original downloaded source.  I consider it
a *requirement* for the 'icecat' source tarball and it's unpacked
directory to be named "icecat-=E2=80=A6" and not "firefox-=E2=80=A6", and s=
imilarly for
'linux-libre'.

I'm sorry that I never found the energy to clean this up properly.

Anyway, regarding your proposed patch: for now, I would suggest the
following options:

(1) In a separate preceding commit, move 'computed-origin-method' to its
    own module, export it, use the exported one in gnuzilla.scm and
    linux.scm, and use 'eq?' to test for it in the code above.  There
    should probably also be a comment next to the definition of
    'computed-origin-method' pointing out that it's a temporary hack,
    hopefully to be superceded by snippets when they have gained the
    required functionality.

(2) Alternatively, for now, use 'eq?' against the two private copies
    (accessed using @@, see below), along with a "FIXME" comment.

___ (or (eq? method (@@ (gnu packages gnuzilla) computed-origin-method))
_______ (eq? method (@@ (gnu packages linux) computed-origin-method)))

What do you think?

I'm not on the guix-patches list, so please CC me on replies that you'd
like me to see.

       Thanks,
         Mark

--=20
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>.




Information forwarded to guix-patches@HIDDEN:
bug#50515; Package guix-patches. Full text available.

Message received at 50515 <at> debbugs.gnu.org:


Received: (at 50515) by debbugs.gnu.org; 11 Sep 2021 00:26:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 10 20:26:22 2021
Received: from localhost ([127.0.0.1]:39331 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOqqc-000526-0f
	for submit <at> debbugs.gnu.org; Fri, 10 Sep 2021 20:26:22 -0400
Received: from mail-wr1-f53.google.com ([209.85.221.53]:35646)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mOqqX-00051a-QM
 for 50515 <at> debbugs.gnu.org; Fri, 10 Sep 2021 20:26:19 -0400
Received: by mail-wr1-f53.google.com with SMTP id i23so4967841wrb.2
 for <50515 <at> debbugs.gnu.org>; Fri, 10 Sep 2021 17:26:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=vwrGUIXLJn4AliOmzs+v9XSS3uJLqjn9QpjTHO8By9M=;
 b=UTc60ixqoFDufwyEsATmiYo09Nu69kvFsi6HTE8gNZPGloEZvGMtl+6xDC4Vw34tzp
 pYWLEOWio9NY8oPm1oJ2VzQYQnuhhI365JOOTZcxszfharVP1PEuCIXn/DFNnGj5QDPd
 h1Y4tkAMZjyrcjUzYQRscsQcyruvT5Z3fbEFvkaEUuaR6fMxfu91uWdfe179jAwEGSij
 vGXE+ALOG6dAw6IqRV8PPkMHTCyEPc4TQRAZWyX/fLyGsd/ZHA3Gp9lSwAqPZ3yFDDdc
 xEF6l1hgFH5ah1JiPHBElozKA9YqvOL9XMmmboKe5ZCh9uAhJzu8FBLnsVDNMJkuOiFr
 cS+g==
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:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=vwrGUIXLJn4AliOmzs+v9XSS3uJLqjn9QpjTHO8By9M=;
 b=aucPoGFcjilX7OglfbSe3007ig8sWcp2YXDPuBlGWjZSIKQjx1jPPuzCwv1PPfUrxQ
 t7ZsbKongYqpdHvisJ49R3C+/7LS6Yf5/dLzHpJpgDuTNhKllgyR/ONr4bQQjkMI51Nj
 eIm8raAcwaQXTWOMBbwfrk8wtbRz8YdwJlC+ojzL22bp8EwetZxdV1iYYIeOZbScc9tL
 lhFi+fBOtLRNi1Ek1gWWvWxODo6fNwxb9/Wn6tvONH+Wa/qC+OPbCWIheSvZVOeO03zz
 B1l5a2yipNQTP+ayj+eZ2yrzD3OBElwlYAnLk+hj4E5y06dEou9ldHd7TJ23vfYwdMLG
 SQuA==
X-Gm-Message-State: AOAM533k/hQ35LJ3bXn0Uf6MgkNHC2VP0INw+gmQAIs2Ev7+/VNTT0jz
 F8OF+5tBF2nhR3OQSBx2z5sb8OOZbkA=
X-Google-Smtp-Source: ABdhPJwVQkQg3Llb58m653LbNcaOsHTdDJ4K7I3EDBDprc0mctyd/Q8w8LlICbnMLQ/ZF44ocB3xHA==
X-Received: by 2002:a5d:5262:: with SMTP id l2mr417880wrc.190.1631319972031;
 Fri, 10 Sep 2021 17:26:12 -0700 (PDT)
Received: from localhost.localdomain ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 x21sm181561wmc.14.2021.09.10.17.26.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 10 Sep 2021 17:26:11 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: 50515 <at> debbugs.gnu.org
Subject: [PATCH 2/2] website: Add 'computed-origin-method' packages to
 'sources.json'.
Date: Sat, 11 Sep 2021 02:26:08 +0200
Message-Id: <20210911002608.14074-2-zimon.toutoune@HIDDEN>
X-Mailer: git-send-email 2.29.2
In-Reply-To: <20210911002608.14074-1-zimon.toutoune@HIDDEN>
References: <20210911002608.14074-1-zimon.toutoune@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  With Guix 9875f9bca3976bf3576eab9be42164fde454597e,
 the packages
 considered are IceCat and the Linux kernel; see: gnu/packages/gnuzilla.scm
 and gnu/packages/linux.scm. * website/apps/packages/builder.scm
 (gexp-references):
 Unexported variable from the module '(guix gexp)'. (origin->json): Add
 'computed-origin-method'
 case. (package-json-builder): Adjust. (sources-js [...] 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (zimon.toutoune[at]gmail.com)
 2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: nixo.xyz (xyz)]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.221.53 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.221.53 listed in list.dnswl.org]
X-Debbugs-Envelope-To: 50515
Cc: zimoun <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

With Guix 9875f9bca3976bf3576eab9be42164fde454597e, the packages considered
are IceCat and the Linux kernel; see: gnu/packages/gnuzilla.scm and
gnu/packages/linux.scm.

* website/apps/packages/builder.scm (gexp-references): Unexported variable
from the module '(guix gexp)'.
(origin->json): Add 'computed-origin-method' case.
(package-json-builder): Adjust.
(sources-json-builder): Idem.
[flatten]: New procedure.
---
 website/apps/packages/builder.scm | 134 +++++++++++++++++++-----------
 1 file changed, 84 insertions(+), 50 deletions(-)

diff --git a/website/apps/packages/builder.scm b/website/apps/packages/builder.scm
index fb53215..ecf958a 100644
--- a/website/apps/packages/builder.scm
+++ b/website/apps/packages/builder.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2017 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado@HIDDEN>
 ;;; Copyright © 2019 Nicolò Balzarotti <nicolo@HIDDEN>
-;;; Copyright © 2020 Simon Tournier <zimon.toutoune@HIDDEN>
+;;; Copyright © 2020, 2021 Simon Tournier <zimon.toutoune@HIDDEN>
 ;;;
 ;;; Initially written by sirgazil
 ;;; who waives all copyright interest on this file.
@@ -49,11 +49,14 @@
   #:use-module ((guix base64) #:select (base64-encode))
   #:use-module ((guix describe) #:select (current-profile))
   #:use-module ((guix config) #:select (%guix-version))
+  #:use-module (guix gexp)
   #:use-module (json)
   #:use-module (ice-9 match)
   #:use-module ((web uri) #:select (string->uri uri->string))
   #:export (builder))
 
+;;; Required by 'origin->json' for 'computed-origin-method' corner cases
+(define gexp-references (@@ (guix gexp) gexp-references))
 
 ;;;
 ;;; Application builder.
@@ -98,7 +101,7 @@
   (define method
     (origin-method origin))
 
-  (define uri                                     ;represented as string
+  (define uri
     (origin-uri origin))
 
   (define (resolve urls)
@@ -106,53 +109,67 @@
          (append-map (cut maybe-expand-mirrors <> %mirrors)
                      (map string->uri urls))))
 
-  `((type . ,(cond ((or (eq? url-fetch method)
-                        (eq? url-fetch/tarbomb method)
-                        (eq? url-fetch/zipbomb method)) 'url)
-                   ((eq? git-fetch method) 'git)
-                   ((or (eq? svn-fetch method)
-                        (eq? svn-multi-fetch method)) 'svn)
-                   ((eq? hg-fetch method) 'hg)
-                   (else                   #nil)))
-    ,@(cond ((or (eq? url-fetch method)
+  (match uri
+    ((? promise? promise)               ;computed-origin-method
+     (match (force promise)
+       ((? gexp? g)
+        (map origin->json
+             (filter-map (match-lambda
+                           ((? gexp-input? thing)
+                            (match (gexp-input-thing thing)
+                              ((? origin? o) o)
+                              (_ #f)))
+                           (_ #f))
+                         (gexp-references g))))
+       (_ `((type . #nil)))))
+    (_                                  ;represented as string
+     `((type . ,(cond ((or (eq? url-fetch method)
+                           (eq? url-fetch/tarbomb method)
+                           (eq? url-fetch/zipbomb method)) 'url)
+                      ((eq? git-fetch method) 'git)
+                      ((or (eq? svn-fetch method)
+                           (eq? svn-multi-fetch method)) 'svn)
+                      ((eq? hg-fetch method) 'hg)
+                      (else                   #nil)))
+       ,@(cond ((or (eq? url-fetch method)
+                    (eq? url-fetch/tarbomb method)
+                    (eq? url-fetch/zipbomb method))
+                `(("urls" . ,(list->vector
+                              (resolve
+                               (match uri
+                                 ((? string? url) (list url))
+                                 ((urls ...) urls)))))))
+               ((eq? git-fetch method)
+                `(("git_url" . ,(git-reference-url uri))))
+               ((eq? svn-fetch method)
+                `(("svn_url" . ,(svn-reference-url uri))))
+               ((eq? svn-multi-fetch method)
+                `(("svn_url" . ,(svn-multi-reference-url uri))))
+               ((eq? hg-fetch method)
+                `(("hg_url" . ,(hg-reference-url uri))))
+               (else '()))
+       ,@(if (or (eq? url-fetch method)
                  (eq? url-fetch/tarbomb method)
                  (eq? url-fetch/zipbomb method))
-             `(("urls" . ,(list->vector
-                           (resolve
-                            (match uri
-                              ((? string? url) (list url))
-                              ((urls ...) urls)))))))
-            ((eq? git-fetch method)
-             `(("git_url" . ,(git-reference-url uri))))
-            ((eq? svn-fetch method)
-             `(("svn_url" . ,(svn-reference-url uri))))
-            ((eq? svn-multi-fetch method)
-             `(("svn_url" . ,(svn-multi-reference-url uri))))
-            ((eq? hg-fetch method)
-             `(("hg_url" . ,(hg-reference-url uri))))
-            (else '()))
-    ,@(if (or (eq? url-fetch method)
-              (eq? url-fetch/tarbomb method)
-              (eq? url-fetch/zipbomb method))
-          (let* ((content-hash (origin-hash origin))
-                 (hash-value (content-hash-value content-hash))
-                 (hash-algorithm (content-hash-algorithm content-hash))
-                 (algorithm-string (symbol->string hash-algorithm)))
-            `(("integrity" . ,(string-append algorithm-string "-"
-                                             (base64-encode hash-value)))))
-          '())
-    ,@(if (eq? method git-fetch)
-          `(("git_ref" . ,(git-reference-commit uri)))
-          '())
-    ,@(if (eq? method svn-fetch)
-          `(("svn_revision" . ,(svn-reference-revision uri)))
-          '())
-    ,@(if (eq? method svn-multi-fetch)
-          `(("svn_revision" . ,(svn-multi-reference-revision uri)))
-          '())
-    ,@(if (eq? method hg-fetch)
-          `(("hg_changeset" . ,(hg-reference-changeset uri)))
-          '())))
+             (let* ((content-hash (origin-hash origin))
+                    (hash-value (content-hash-value content-hash))
+                    (hash-algorithm (content-hash-algorithm content-hash))
+                    (algorithm-string (symbol->string hash-algorithm)))
+               `(("integrity" . ,(string-append algorithm-string "-"
+                                                (base64-encode hash-value)))))
+             '())
+       ,@(if (eq? method git-fetch)
+             `(("git_ref" . ,(git-reference-commit uri)))
+             '())
+       ,@(if (eq? method svn-fetch)
+             `(("svn_revision" . ,(svn-reference-revision uri)))
+             '())
+       ,@(if (eq? method svn-multi-fetch)
+             `(("svn_revision" . ,(svn-multi-reference-revision uri)))
+             '())
+       ,@(if (eq? method hg-fetch)
+             `(("hg_changeset" . ,(hg-reference-changeset uri)))
+             '())))))
 
 (define (packages-json-builder)
   "Return a JSON page listing all packages."
@@ -167,7 +184,12 @@
       ,@(if cpe-name `(("cpe_name" . ,cpe-name)) '())
       ,@(if cpe-version `(("cpe_version" . ,cpe-version)) '())
       ,@(if (origin? (package-source package))
-            `(("source" . ,(origin->json (package-source package))))
+            `(("source" . ,(let ((json (origin->json (package-source package))))
+                             (match json
+                               ((('type . x) other ...)
+                                json)
+                               ((head tail ...) ;multi-origin
+                                head)))))       ;XXXX: Improve this approximation
             '())
       ("synopsis" . ,(package-synopsis package))
       ,@(if (package-home-page package)
@@ -195,11 +217,23 @@
   (define (package->json package)
     `(,@(if (origin? (package-source package))
             (origin->json (package-source package))
-            `(("type" . "no-origin")
+            `((type . "no-origin")
               ("name" . ,(package-name package))))))
 
+  (define (flatten lst)
+    ;; Convert nested lists to simple list
+    `(,@(if (null? lst)
+            '()
+            (match lst
+              ((head tail ...)
+               (match head
+                 ((('type . x) other ...)
+                  (cons head (flatten tail)))
+                 (_
+                  (append (flatten head) (flatten tail)))))))))
+
   (make-page "sources.json"
-             `(("sources" . ,(list->vector (map package->json (all-packages))))
+             `(("sources" . ,(list->vector (flatten (map package->json (all-packages)))))
                ("version" . "1")
                ("revision" .
                 ,(match (current-profile)
-- 
2.29.2





Information forwarded to guix-patches@HIDDEN:
bug#50515; Package guix-patches. Full text available.

Message received at 50515 <at> debbugs.gnu.org:


Received: (at 50515) by debbugs.gnu.org; 11 Sep 2021 00:26:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 10 20:26:19 2021
Received: from localhost ([127.0.0.1]:39329 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOqqY-00051o-Qk
	for submit <at> debbugs.gnu.org; Fri, 10 Sep 2021 20:26:18 -0400
Received: from mail-wr1-f43.google.com ([209.85.221.43]:41837)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mOqqX-00051Y-5I
 for 50515 <at> debbugs.gnu.org; Fri, 10 Sep 2021 20:26:18 -0400
Received: by mail-wr1-f43.google.com with SMTP id w29so4198538wra.8
 for <50515 <at> debbugs.gnu.org>; Fri, 10 Sep 2021 17:26:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=S2iU+STXnZDF50cw9O56YPWttyO0HP7tAGp0BTItsiY=;
 b=ojxNjCTX19wniOY+MuaniLpZfSJbWZseUvc9z27uPY+TBvkVNVMwgyGUJTMe/Og1mF
 49q8dXto8hoYHfJGS5LCuozrChqqczdetkH4nq8Cw74BaHouTS/k1rRd/n/dhvG5duPg
 XfmLRA+dMBv016xa1w9HFoucM8H2oZqTWhFfkz+t7RAxnRmd2ihc2YhXApTlO1QfX0W0
 2p7dkb5t8ASfjhEqCUEN1A5DabSgReyCKrY4OKqTW0oAT8s/cJE52sQ5L8rSn6RvgW4Z
 aFE07nqtNTJOkbs0EScYAN/XZHR/2ibeDvFuacriWexr64QdLxlZyM8n8XjvKJjXJO2C
 YZ2g==
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:date:message-id:mime-version
 :content-transfer-encoding;
 bh=S2iU+STXnZDF50cw9O56YPWttyO0HP7tAGp0BTItsiY=;
 b=reBtSeNwGG86oS8IqMegeDqqg0Z/8f5/jqcg7ZXsdz67QGV0nTgcIJMx9GnU/yFc+w
 m9lJGzl3FuTTBpFvcok1JM7oKMSy62Duc7Hp5VFFwrqF1UB+kU0iByqeDHWQP4Ob6DDT
 sJFJuyy/PFazoOHQd3H1z6xiU3ZvMZlwlIaotv0JRpGbG2av7mGgBWOh6mRmAAa9B42I
 ToItXx30j5ZFEsilZJAaYPIziDqFjGqIdxf48j311HGQqFRDy/9a1vpQYscwOezLrBz7
 d4wc5q8AlEBtW+fi118HNptLYRKa/gPbCPW00d8Rcpt8aFIKhrkC0RrHo5zsYt+9Saoo
 RV1Q==
X-Gm-Message-State: AOAM531NVmvtdkQsO6yctciPThlevV1bRN7x+9dXA4dN3ODHzmVFze4S
 W21QHkdH3Tda3CoBjWrnd9NRcCIjmGI=
X-Google-Smtp-Source: ABdhPJxOSydNaFWoIfirTxx51u3tIcdmpcfVb3er7pCpUnPTnY7yeX60tdpHyUtHtahljb1xSY6VzA==
X-Received: by 2002:adf:d184:: with SMTP id v4mr395636wrc.229.1631319971324;
 Fri, 10 Sep 2021 17:26:11 -0700 (PDT)
Received: from localhost.localdomain ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 x21sm181561wmc.14.2021.09.10.17.26.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 10 Sep 2021 17:26:11 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: 50515 <at> debbugs.gnu.org
Subject: [PATCH 1/2] website: Tweak 'GUIX_WEB_SITE_LOCAL'.
Date: Sat, 11 Sep 2021 02:26:07 +0200
Message-Id: <20210911002608.14074-1-zimon.toutoune@HIDDEN>
X-Mailer: git-send-email 2.29.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50515
Cc: zimoun <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* website/apps/packages/data.scm (%package-list): Compare to 'yes' instead of
any value.
* website/README: Document it.
---
 website/README                 | 3 +++
 website/apps/packages/data.scm | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/website/README b/website/README
index ce2819f..19951d6 100644
--- a/website/README
+++ b/website/README
@@ -37,6 +37,9 @@ commands:
                           -- haunt build
 #+end_example
 
+Any other value than =GUIX_WEB_SITE_LOCAL=yes= will build the full website
+considering all the packages and not a small subset.
+
 ** Serve locally
 #+begin_example
   LANG=en_US.UTF-8 guix environment -CN -m manifest.scm \
diff --git a/website/apps/packages/data.scm b/website/apps/packages/data.scm
index d1bbc92..eb34d26 100644
--- a/website/apps/packages/data.scm
+++ b/website/apps/packages/data.scm
@@ -50,7 +50,8 @@
                    (string<? (package-name p1)
                              (package-name p2))))))
       (cond ((null? packages) '())
-            ((getenv "GUIX_WEB_SITE_LOCAL") (list-head packages 300))
+            ((string=? "yes" (getenv "GUIX_WEB_SITE_LOCAL"))
+             (list-head packages 300))
             (else packages)))))
 
 (define (all-packages)
-- 
2.29.2





Information forwarded to guix-patches@HIDDEN:
bug#50515; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Sep 2021 00:14:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 10 20:14:38 2021
Received: from localhost ([127.0.0.1]:39317 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOqfG-0004gL-8g
	for submit <at> debbugs.gnu.org; Fri, 10 Sep 2021 20:14:38 -0400
Received: from lists.gnu.org ([209.51.188.17]:40362)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mOqfE-0004gD-RQ
 for submit <at> debbugs.gnu.org; Fri, 10 Sep 2021 20:14:37 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43580)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@HIDDEN>)
 id 1mOqfE-0006hW-Jm
 for guix-patches@HIDDEN; Fri, 10 Sep 2021 20:14:36 -0400
Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:42907)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@HIDDEN>)
 id 1mOqfC-0000Sl-Pf
 for guix-patches@HIDDEN; Fri, 10 Sep 2021 20:14:36 -0400
Received: by mail-wr1-x42d.google.com with SMTP id q11so4921697wrr.9
 for <guix-patches@HIDDEN>; Fri, 10 Sep 2021 17:14:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=WRAhr1WrsJPKv4hmA5A/kRDwJ9xhGb3MJu+2jy+D7/U=;
 b=cM/BtfKh3Hp6hI6L6Ho5/E4DBZvEIc0vpduEYtsHU692dQPGFvF6hMyeMzNu1+OH/d
 JX4nixN4OUCsiPFbczdLRK3DU2WyS8nRjADm4sosBE64BCVic1d8H33uzCU7jZUr05iK
 w6Dklz+vVUBvYoMBwFVMLbroVQRo1UMBsjLf2VruCVXkui1bX9iXNHu1mJe9iwPcjCoi
 esrcpD34f63S51uZTH3ATZM6YV4E0GwvoUbOr9kxz/Fvx0AUhetv68+IxdqQ2njq4h/G
 LLShPnru4peec0B8wo7k9/eKK1LtWATsHfLaZ29c+p1nznBI5TTPt6OTG1J/9andCbSP
 gipQ==
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:date:message-id:mime-version
 :content-transfer-encoding;
 bh=WRAhr1WrsJPKv4hmA5A/kRDwJ9xhGb3MJu+2jy+D7/U=;
 b=wSbjOZPH5QYLoP5shsstW9YVm/VtKIw8ystmDxXW+MEv11Xie0uY3bKKaY5nSBhZaX
 DA01INnZZda87QX1Re/Ka6CKRTKi6YsI6PweY7kml0lL9ny/pVa5sZDr6ATJuWZKEMcX
 rT/hJLitOfIk1o8Izn2I7Zl4Q4+yrW/ZUkZh1fblXCRPFn8cudbzzPbC9u6rOaUvOrqi
 jQ6w9bj6zYn7F+j+oYVYj9dVE8XBb+K0KvB9rn93wJ4EaRHqvxH+mOofdzUr2lYWUTH4
 ofn+1dvIxCWDFOVSdHYpxISEU0/fNNrVIjZBfmAJ7nVgQj/SvyEsTqoi4TVhrU154XZU
 ibeQ==
X-Gm-Message-State: AOAM533b7X3uYROKjFwKvUGNLUVOLIbS9S10RN6k5ME4GyqEVMlNiy5y
 kp+p4N4+yawoiHkPNlfpmiiLZD0HPK4=
X-Google-Smtp-Source: ABdhPJykILvEucZTl582kwr4ZLqpWQANjPLvWpwOy1fK3z+1K8WVCjDL0MwgGeh0+Ep0tZrm3MC0qw==
X-Received: by 2002:adf:9f51:: with SMTP id f17mr350277wrg.301.1631319272345; 
 Fri, 10 Sep 2021 17:14:32 -0700 (PDT)
Received: from localhost.localdomain ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 t18sm89358wrp.97.2021.09.10.17.14.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 10 Sep 2021 17:14:32 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: guix-patches@HIDDEN
Subject: (guix-artwork)[PATCH 0/2] List linux origins in 'sources.json'.
Date: Sat, 11 Sep 2021 02:14:24 +0200
Message-Id: <20210911001424.9860-1-zimon.toutoune@HIDDEN>
X-Mailer: git-send-email 2.29.2
MIME-Version: 1.0
X-Debbugs-CC: <ludo@HIDDEN>, <leo@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a00:1450:4864:20::42d;
 envelope-from=zimon.toutoune@HIDDEN; helo=mail-wr1-x42d.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-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: zimoun <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi,

This patch is a follow-up of this message:

<https://lists.gnu.org/archive/html/guix-devel/2021-09/msg00106.html>

Now, 'sources.json' file contains the missing origins; for instance:

--8<---------------cut here---------------start------------->8---
$ cat /tmp/gnu.org/software/guix/sources.json | jq | grep fsfla | sort | uniq -c
      4         "https://linux-libre.fsfla.org/pub/linux-libre/releases/4.14.238-gnu/deblob-4.14"
      4         "https://linux-libre.fsfla.org/pub/linux-libre/releases/4.14.238-gnu/deblob-check"
      4         "https://linux-libre.fsfla.org/pub/linux-libre/releases/4.19.196-gnu/deblob-4.19"
      4         "https://linux-libre.fsfla.org/pub/linux-libre/releases/4.19.196-gnu/deblob-check"
      2         "https://linux-libre.fsfla.org/pub/linux-libre/releases/4.4.274-gnu/deblob-4.4"
      2         "https://linux-libre.fsfla.org/pub/linux-libre/releases/4.4.274-gnu/deblob-check"
      2         "https://linux-libre.fsfla.org/pub/linux-libre/releases/4.9.274-gnu/deblob-4.9"
      2         "https://linux-libre.fsfla.org/pub/linux-libre/releases/4.9.274-gnu/deblob-check"
      4         "https://linux-libre.fsfla.org/pub/linux-libre/releases/5.10.47-gnu/deblob-5.10"
      4         "https://linux-libre.fsfla.org/pub/linux-libre/releases/5.10.47-gnu/deblob-check"
     14         "https://linux-libre.fsfla.org/pub/linux-libre/releases/5.12.14-gnu/deblob-5.12"
     14         "https://linux-libre.fsfla.org/pub/linux-libre/releases/5.12.14-gnu/deblob-check"
      4         "https://linux-libre.fsfla.org/pub/linux-libre/releases/5.4.129-gnu/deblob-5.4"
      4         "https://linux-libre.fsfla.org/pub/linux-libre/releases/5.4.129-gnu/deblob-check"
      2         "https://linux-libre.fsfla.org/pub/linux-libre/releases/5.4.20-gnu/linux-libre-5.4.20-gnu.tar.xz",
--8<---------------cut here---------------end--------------->8---

First, it should be investigated why the deblob script
'5.12.14-gnu/deblob-5.12' appears 14 times.  In the same idea, the
source of 5.12.14 appears 28 times.  Well, I have tried to add
’delete-duplicates’ but without success.  To be continued… :-)

Second, I do not know if SWH ingests scripts as:

<https://linux-libre.fsfla.org/pub/linux-libre/releases/5.12.14-gnu/deblob-check>

and it is worth to carefully check with them. :-)

Last, the first patch tweaks the check to ease from the command-line the
build of the full website and not only 300 packages (otherwise it is
easy to miss corner cases ;-)).  Other said, turn
’GUIX_WEB_SITE_LOCAL=yes’ to ’GUIX_WEB_SITE_LOCAL=whatever-value’ (where
whatever-value can be ’no’ for instance) allows to build the full
website. It appears to me simpler than the previous check.  WDYT?


All the best,
simon


zimoun (2):
  website: Tweak 'GUIX_WEB_SITE_LOCAL'.
  website: Add 'computed-origin-method' packages to 'sources.json'.

 website/README                    |   3 +
 website/apps/packages/builder.scm | 134 +++++++++++++++++++-----------
 website/apps/packages/data.scm    |   3 +-
 3 files changed, 89 insertions(+), 51 deletions(-)


base-commit: d8efebc0794e8d6b2debc0e8a233a4b4b3b6f676
--
2.29.2




Acknowledgement sent to zimoun <zimon.toutoune@HIDDEN>:
New bug report received and forwarded. Copy sent to ludo@HIDDEN, leo@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to ludo@HIDDEN, leo@HIDDEN, guix-patches@HIDDEN:
bug#50515; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 16 Sep 2021 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.