unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 61684@debbugs.gnu.org
Subject: bug#61684: can't compose 'with-patch' with 'with-source'
Date: Thu, 23 Feb 2023 17:27:41 -0500	[thread overview]
Message-ID: <87356whvaa.fsf@gmail.com> (raw)
In-Reply-To: <871qmg79u7.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 23 Feb 2023 15:08:48 +0100")

Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi Maxim,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> 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:
>>
>> scheme@(gnu packages jami)> (options->transformation 
>>                              `((with-source . "libjami@20230220.0=/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 libjami@20230220.0 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)>
>>
>> The downloaded-file resulting package source has lost the patch, and no
>> error got produced, leaving the user to discover this limitation by
>> themselves.
>
> The order of options matters; in this case, you need to do it the other
> way around:
>
> scheme@(guile-user)> (options->transformation '((with-patch . "jami=/tmp/t.patch")
> 						(with-source . "jami=http://example.org/foo.tar.gz")))
> $18 = #<procedure 7f7e6b1fd0c0 at guix/transformations.scm:1010:2 (obj)>
> scheme@(guile-user)> ($18 jami)
> $19 = #<package jami@20230206.0 guix/transformations.scm:1002 7f7e6b1602c0>
> scheme@(guile-user)> (package-source $19)
> $20 = #<<computed-file> name: "jami-20230206.0-source" gexp: #<gexp  guix/transformations.scm:688:19 7f7e6b6c8d50> guile: #f options: (#:local-build? #t)>
>
> The <computed-file> bit comes from the ‘with-patch’ transformation, to
> apply the patch to the <downloaded-file>.
>
> If you do it the other way around, the effect of ‘with-patch’ is
> canceled by that of ‘with-source’, which does not preserve patches.  So
> strictly speaking, both options had an effect, but they were
> contradictory.

Hm.  That seems sub-optimal; it seems to me that ideally, the
transformations would be additive, so that users would not need to care
about the ordering.  Or perhaps, alternatively, we could enforce such
ordering at the implementation level (sorting the transformations in the
order that is required).

> Note that ordering is “specified”, notably with the test added in
> 0f024554e63a49e20c2a7a67e928073c266bf5c5 (this is crucial for our HPC
> users, who routinely combine a whole bunch of options; you have no idea
> how far they go once you give them the tool :-)).  I don’t think the
> manual explicitly states it though.

It doesn't seem to be, indeed.  But I wish we wouldn't need to (see my
above suggestions/ideas).

-- 
Thanks,
Maxim




  reply	other threads:[~2023-02-23 22:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 18:08 bug#61684: can't compose 'with-patch' with 'with-source' Maxim Cournoyer
2023-02-21 19:05 ` Simon Tournier
2023-02-23 14:08 ` Ludovic Courtès
2023-02-23 22:27   ` Maxim Cournoyer [this message]
2023-02-24 12:02     ` Simon Tournier
2023-02-24 13:21       ` Maxim Cournoyer
2023-02-24 13:43         ` Simon Tournier
2023-02-24 13:52           ` Maxim Cournoyer
2023-02-25 12:29             ` Simon Tournier
2023-02-25 19:43               ` Maxim Cournoyer
2023-02-27 14:12             ` Ludovic Courtès
2023-02-27 16:29               ` Maxim Cournoyer
2023-02-27 14:09       ` Ludovic Courtès
2023-02-28 10:00         ` Simon Tournier
2023-03-01 15:49           ` Ludovic Courtès
2023-02-24 13:59   ` Maxim Cournoyer
2023-03-03  9:43     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87356whvaa.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=61684@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).