Re: git: 1a8a9a832eb5 - main - devel/libvirt: depend on GNU grep(1) in a more robust way

From: Gleb Popov <arrowd_at_freebsd.org>
Date: Sat, 10 May 2025 10:19:46 UTC
On Sat, May 10, 2025 at 1:13 PM Alexey Dokuchaev <danfe@freebsd.org> wrote:
>
> On Sat, May 10, 2025 at 12:48:31PM +0300, Gleb Popov wrote:
> > On Sat, May 10, 2025 at 12:36???PM Alexey Dokuchaev wrote:
> > > commit 1a8a9a832eb52cb3bb7ea6453a88451d54ebc597
> > >
> > >   devel/libvirt: depend on GNU grep(1) in a more robust way
> > >
> > >   FreeBSD ships native grep(1) implementation in the base for
> > >   quite a while, so don't bother to check its origin and just
> > >   request GNU version explicitly like on Darwin (macOS).
> > >
> > >   Depending on `/usr/local/bin/grep' is also wrong because of
> > >   the hardcoded prefix and because compatibility symlinks are
> > >   optional (plans are to disable them in the future).
> >
> > This change doesn't make sense to me. Can you please elaborate
> > on the last paragraph?
>
> Ports could be installed into prefix other than `/usr/local', yet
> the path is hardcoded in the `build-aux/meson.build', meaning it's
> likely to break with custom-PREFIX'ed packages.  While not very
> common, we support this and IIRC there were occasional exp-runs in
> the past for custom values of PREFIX/LOCALBASE (with lots of fallout
> as one might expect).

If you're talking about putting *dependencies* into PREFIX !=
LOCALBASE, then this configuration is unsupported and isn't expected
to work.
Ports expect dependencies to be installed under ${LOCALBASE}, which
may not be /usr/local, but it should stay the same for all ports being
built.
There was nothing wrong with ${LOCALBASE} in the dependency line.

> However, more importantly is that `bin/grep' is guarded by the COMPAT
> option, hence it is not guaranteed to exist even under `/usr/local',
> while `bin/ggrep' is always there, similar to other GNU tools which
> are typically configured with `--program-prefix=g'.  People had been
> asking me to stop installing those compatibility symlinks by default,
> so one day I might make the option opt-in rather than opt-out.  HTH,

Then I'd prefer a one-liner, BINARY_ALIAS, rather than a whole new patch file.