Subject: [bug#77072] [PATCH v1] channels: add transformer field

From: Rutherther <[email-masked]>
Date: Fri, 19 Sep 2025 16:11:20 +0200

Hi,

I think this currently breaks inferiors cache.
Specifically, the cache relies on the `commit` fields, merging them together
and obtaining a hash. Since the transformer field is not taken into
account, there can be an incorrect cache hit, specifically:

1. You make an inferior with some for given commits
2. You make an inferior with different transformers for same commits
This way you get cache hit, omitting the new transformers.

Same way if you change transformers from one to another.

This breaks both inferior in code and time-machine.

Moreover, I don't think this has an easy resolution. The thing is
that the transformers can do whatever, point to a file, download a file
from the internet... this means the result might not be the same for
first, second, third time you run it, because the underlying files can
change. For this reason, we cannot just hash contents of the transformer
field as text. I think that something similar to fixed output derivation
would have to be made. Specifically to tell Guix the patches haven't
changed. I think that what I described in my initial answer would help
this goal - instead of a transformer to use patches, those patches
would have a hash. Those hashes can then be used in the inferior cache
as well as for not obtaining the files again if not necessary. (they
could be fetched to the store as FODs) Alternatively the patches
could first be all obtained and hash made from the contents. This
would achieve the goal, while allowing for the files to change,
ie. if you point it to a PR and the PR gets a new version.

Rutherther