Subject: [bug#75550] [PATCH] gnu: smartmontools: Fix PATH in smartd_warning.sh.

From: Tomas Volf <[email-masked]>
Date: Tue, 28 Jan 2025 23:11:48 +0100

Hilton Chain <[email-masked]> writes:

> On Fri, 24 Jan 2025 23:31:56 +0800,
> Tomas Volf wrote:
>> [...]
>> >> +                 (string-append "PATH="
>> >> +                                #$(file-append sed "/bin") ":"
>> >> +                                #$(file-append coreutils "/bin") ":"
>> >> +                                "$PATH\n"))))))))
>> >
>> > Please add sed and coreutils-minimal to inputs and use search-input-file or
>> > this-package-input instead.
>>
>> Why?  I will of course do so, but would first like to understand why.
>> The current way seems to work and keeps all the references in just one
>> place.  If I switch to the suggested approach, both `sed' and
>> `coreutils' will be referenced in two places (once in the `inputs' and
>> once here) and those will need to be kept in sync.  So, uh, why do it?
>
> The reason is to record dependency information at <package> level, since this is
> where the UI and most of the tools work.  (`guix show', `guix refresh', package
> transformation etc.)

Is there a technical reason it cannot inspect the gexps used or is it
just matter of "no one wrote the code yet"?

>
> For referencing dependencies from inputs in arguments, the benefit is mainly for
> transformations.  Maybe it doesn't make much sense in this case (sed and
> coreutils), but it's a good practice to follow.

I did not realize this at all.  That is very good to know.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.