~sircmpwn/sr.ht-discuss

6 3

Non-deterministic mbox patchsets

Details
Message ID
<87plx2kp1t.fsf@ngraves.fr>
DKIM signature
missing
Download raw message
Hi SourceHut!

Thanks for this tremendous work.

I've noticed that mbox patchsets (that one gets with
https://lists.sr.ht/:user/:list/patches/:id/mbox) include timestamps,
which is bad for reproducibility.

Of course a patchset is never finished so we can never ensure
immutability so it's not that big of an issue, but reproducible input is
of paramount importance in nix/guix. We can create a function to remove
faulty timestamps on the guix side, but would you consider making these
patchsets independent from the time they are queried ?

Thanks!

As an example, only a few similar lines are faulty :

> diff mbox\(1\) mbox\(2\)        
1c1
< From nobody Sun Feb 11 22:06:46 2024
---
> From nobody Sun Feb 11 22:30:18 2024
92c92
< From nobody Sun Feb 11 22:06:46 2024
---
> From nobody Sun Feb 11 22:30:18 2024
184c184
< From nobody Sun Feb 11 22:06:46 2024
---
> From nobody Sun Feb 11 22:30:18 2024
zsh: exit 1     diff --color=auto mbox\(1\) mbox\(2\)


-- 
Best regards,
Nicolas Graves

Re: Non-deterministic mbox patchsets

Details
Message ID
<CZ3014BSP1PD.1PB17HZ1N4PZK@cmpwn.com>
In-Reply-To
<87plx2kp1t.fsf@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
I'm not sure why you're using this URL as an input to anything?

Re: Non-deterministic mbox patchsets

Details
Message ID
<87mss5lryv.fsf@ngraves.fr>
In-Reply-To
<CZ3014BSP1PD.1PB17HZ1N4PZK@cmpwn.com> (view parent)
DKIM signature
missing
Download raw message
On 2024-02-12 10:39, Drew DeVault wrote:

> I'm not sure why you're using this URL as an input to anything?

Let's say you want to have a reproducible way to build a repository with
patches, rather than maintaining your own fork.

If you take the mbox, (strip the timestamps,) pass it through `b4 am`, you
have a way to apply an almost derminist way to do this, given that you
haven't made a mistake when sending the patches.

I know that there's also the /query/patchset/:id URL that seems
reproducible but this doesn't work from wget / curl / (guix http-client).

-- 
Best regards,
Nicolas Graves

Re: Non-deterministic mbox patchsets

Details
Message ID
<CZ3587EOEWDX.1USRNIPGLQAUA@cmpwn.com>
In-Reply-To
<87mss5lryv.fsf@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
Most distros when faced with this problem will vendor the patch, I think
this is generally a better solution. This page is not designed to be
load-bearing.

Re: Non-deterministic mbox patchsets

Details
Message ID
<CAC_ByvN5-qkxyaxOLV8cooMgoE1MQZZy55xVeit4cax-LpUw9Q@mail.gmail.com>
In-Reply-To
<CZ3587EOEWDX.1USRNIPGLQAUA@cmpwn.com> (view parent)
DKIM signature
pass
Download raw message
On nix you can use `fetchpatch` [1] instead of fetchurl. That should
strip out this nondeterminism.

IDK if GNU/Guix has an equivalent.

[1] https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchpatch/default.nix

Em seg., 12 de fev. de 2024 às 10:43, Drew DeVault <sir@cmpwn.com> escreveu:
>
> Most distros when faced with this problem will vendor the patch, I think
> this is generally a better solution. This page is not designed to be
> load-bearing.

Re: Non-deterministic mbox patchsets

Details
Message ID
<87frxxlnua.fsf@ngraves.fr>
In-Reply-To
<CAC_ByvN5-qkxyaxOLV8cooMgoE1MQZZy55xVeit4cax-LpUw9Q@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
On 2024-02-12 11:20, Lucas Eduardo wrote:

> On nix you can use `fetchpatch` [1] instead of fetchurl. That should
> strip out this nondeterminism.
>
> IDK if GNU/Guix has an equivalent.

Not to my knowledge, I've wrote one yesterday, but I'm still debugging
it, thanks ! With b4, it's actually really simple.
>
> [1] https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchpatch/default.nix
>
> Em seg., 12 de fev. de 2024 às 10:43, Drew DeVault <sir@cmpwn.com> escreveu:
>>
>> Most distros when faced with this problem will vendor the patch, I think
>> this is generally a better solution. This page is not designed to be
>> load-bearing.

-- 
Best regards,
Nicolas Graves

Re: Non-deterministic mbox patchsets

Details
Message ID
<87eddhljxl.fsf@ngraves.fr>
In-Reply-To
<CZ3587EOEWDX.1USRNIPGLQAUA@cmpwn.com> (view parent)
DKIM signature
missing
Download raw message
On 2024-02-12 14:43, Drew DeVault wrote:

> Most distros when faced with this problem will vendor the patch, I think
> this is generally a better solution. This page is not designed to be
> load-bearing.

Is there another way to simply get a working patchset without
authentication?

My use-case is developping for Guix, and using it with patches that
are not yet merged (so vendoring is not useful there), on two distinct
computers (thus I can't fully rely on a local fork). I don't see an easy
alternative to what I've currently done, but I'll add a revision
variable to my code to make this deterministic, thus I will need to
query only once per patchset revision.

-- 
Best regards,
Nicolas Graves
Reply to thread Export thread (mbox)