Subject: bug#76955: 30.1; php-ts-mode-php-executable default path may not match remote path

From: Morgan Willcock <[email-masked]>
Date: Sat, 15 Mar 2025 11:03:40 +0000

Eli Zaretskii <[email-masked]> writes:

>> Ciao Eli, the patch is attached.
>
> Thanks, but this is IMO worse than what I suggested, which was to call
> executable-find every time the program is invoked for remote systems.
> The idea is that the users can customize php-ts-mode-php-executable
> for their local setup, without affect the remote setup in any way.
> The change you posted doesn't allow that: users will have to make sure
> the same value is valid on both local and all of the remote systems,
> which is not always possible.

I don't think any other modes provide a separate value for remote binary
paths, and TRAMP provides multiple ways to modify where the search for
the remote binary would be done.  I think in the extreme case where
TRAMP does not provide what is required, someone could always just set a
buffer local value to the required path based on their own criteria.

But to fix the bug that I reported, I feel the patch is correct, since
in the majority of cases the correct binary would be located by default
by using the value "php".

The same would apply for other remote binaries like diff, find, grep,
and xargs - if you resolve the path to the binary locally you may break
calling it remotely.

What problem is introduced by not calling executable-find?  You pointed
out it is faster to resolve the binary path once rather than multiple
times, but I don't think that it can be considered a good optimisation
when it breaks calling the binary on remotes systems.

> So I conclude that expecting "php" to be on PATH on remote systems is
> a requirement, since nothing else will work reliably enough, and let's
> close this discussion at that.

I am not sure what you mean by "reliably", but being on PATH is not a
requirement to use it.  It will very likely be on PATH, but with some
additional configuration of the TRAMP connection it doesn't need to be.

-- 
Morgan Willcock