Subject: Re: [bug#63793] [PATCH] gnu: sbsigntools: Update to 0.9.5.

From: Josselin Poiret <[email-masked]>
Date: Sun, 04 Jun 2023 17:06:45 +0200

Hi kiasoc5,

kiasoc5 <[email-masked]> writes:

> What is the difference between this
>
>> -                 (lambda _
>> -                   (substitute* "lib/ccan.git/tools/create-ccan-tree"
>> -                     (("#!/bin/bash")
>> -                      (string-append "#!"
>> -                                     #$(this-package-native-input "bash")
>> -                                     "/bin/bash")))))
>
> and this?
>
>> +            (lambda* (#:key inputs native-inputs #:allow-other-keys)
>> +              (substitute* "lib/ccan.git/tools/create-ccan-tree"
>> +                (("#!/bin/bash")
>> +                 (string-append "#!"
>> +                                (search-input-file (or native-inputs inputs)
>> +                                                   "/bin/bash"))))))
>
> I meant to search for bash as a native input but I guess they are different.

In general, the first method doesn't compose well with package
transformations that replace inputs, since it will still refer to the
original bash input.  The bottom one will always search for a /bin/bash
binary among all the inputs, so will pick up a new one if the input is
replaced.  Also, in general, inside phases, if you're building natively,
native-inputs is always #f and inputs also contains the native inputs,
hence the need for that (or ...) form.

HTH,
-- 
Josselin Poiret