Subject: bug#61684: can't compose 'with-patch' with 'with-source'

From: Simon Tournier <[email-masked]>
Date: Tue, 21 Feb 2023 20:05:32 +0100

Hi Maxim,

On Tue, 21 Feb 2023 at 13:08, Maxim Cournoyer <[email-masked]> wrote:

> Given 'with-source' discards any patch from the original source, I thought
> I could at least add them back via 'with-patch', but it appears this
> does not work:

I remember some headaches with this thread [1]. :-)

1: <https://yhetil.org/guix/[email-masked]>

>
> --8<---------------cut here---------------start------------->8---
> scheme@(gnu packages jami)> (options->transformation 
>                              `((with-source . "[email-masked]=/home/maxim/src/jami/jami-20230220.0.tar.gz")
>                                (with-patch . ,(string-append 
>                                                "libjami=" (search-patch 
>                                                            "jami-disable-integration-tests.patch")))))
> $6 = #<procedure 7f2cd01a97e0 at guix/transformations.scm:1010:2 (obj)>
> scheme@(gnu packages jami)> ($6 libjami)
> $7 = #<package [email-masked] guix/transformations.scm:1002 7f2ccc8386e0>
> scheme@(gnu packages jami)> (package-source $7)
> $8 = #<<downloaded-file> uri: "/home/maxim/src/jami/jami-20230220.0.tar.gz" recursive?: #t>
> scheme@(gnu packages jami)>
> --8<---------------cut here---------------end--------------->8---
>
> The downloaded-file resulting package source has lost the patch, and no
> error got produced, leaving the user to discover this limitation by
> themselves.

Well, it is probably unrelated because I guess the transformation makes
sense here but indeed you can have bad surprise if the transformation
does not make sense and then silently ignored.

Well, I have never finished my attempt to raise more information about
the transformation because the code about the transformation is hard to
follow, from my point of view.  Anyway!

Thanks for having open this ticket. :-)  Maybe with-source and
with-patch are the first incremental change. ;-)

Cheers,
simon