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

From: Hilton Chain <[email-masked]>
Date: Sat, 25 Jan 2025 00:19:06 +0800

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.)

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.