Subject: Re: [bug#61701] [PATCH] doc: Propose new cookbook section for reproducible research.

From: Simon Tournier <[email-masked]>
Date: Tue, 28 Feb 2023 15:16:16 +0100

Hi,

On mer., 22 févr. 2023 at 23:21, Kyle Andrews <[email-masked]> wrote:

> However, I ran into issues applying patches which I don't yet understand
> how to deal with. It would be really cool if Guix had a command which
> showed the state at each step in the process of creating a store
> object. Whatever the workflow and tacit knowledge you use to debug these
> things, I don't grasp it yet.

Well, it appears to me expected that patches from 3.9 does not apply ’as
is’ to 3.6; or even the recipe itself.

For instance, commit a1454169e0 introduces Python 3.7.0 and the last
Python 3.6 series was 3.6.5.  The change reads,

--8<---------------cut here---------------start------------->8---
-        `(modify-phases ,phases
-           (add-after 'unpack 'patch-timestamp-for-pyc-files

[...] 40 lines

-           ;; FIXME: Without this phase we have close to 2000 files that
+       `(modify-phases ,phases
+          ;; Unset SOURCE_DATE_EPOCH while running the test-suite and set it
+          ;; again afterwards.  See <https://bugs.python.org/issue34022>.
+          (add-before 'check 'unset-SOURCE_DATE_EPOCH
+            (lambda _ (unsetenv "SOURCE_DATE_EPOCH") #t))
+          (add-after 'check 'reset-SOURCE_DATE_EPOCH
+            (lambda _ (setenv "SOURCE_DATE_EPOCH" "1") #t))
+           ;; FIXME: Without this phase we have close to 400 files that
            ;; differ across different builds of this package.  With this phase
-           ;; there are about 500 files left that differ.
+           ;; there are 44 files left that differ.
--8<---------------cut here---------------end--------------->8---

Then 3.8.0 with commit af6a9fc276 requires these patches,

--8<---------------cut here---------------start------------->8---
+       (patches (search-patches
+                 "python-3.8-search-paths.patch"
+                 "python-3-fix-tests.patch"
+                 "python-3.8-fix-tests.patch"
+                 "python-3-deterministic-build-info.patch"))
--8<---------------cut here---------------end--------------->8---

and so on.

I understand the issue, on one hand inferior is appealing but expensive
if you have many and on the other hand, a simple switch of origins does
not work out of the box.

That’s why we have the guix-past channel [1]. :-) It maintains older
versions of some packages with the current Guix.  I think it is the
place to define the matrix of Python versions; at least the ones you
want.  Well, if your aim is to have the matrix of Python versions all
working with Guix, you cannot cut the boring task to define all the
entries of this matrix – package transformation has some limitations. :-)

You could start by extracting the recipe of Python 3.6.5 from commit
d66146073d (father of a1454169e0 updating to 3.7) and add it to the
guix-past channel.

Well, we seem far from a “cookbook section for reproducible research.” :-)

1: <https://gitlab.inria.fr/guix-hpc/guix-past>

Cheers,
simon