Subject: bug#71709: Fix recent change in tramp-sh-handle-make-process

From: Iurie Marian <[email-masked]>
Date: Fri, 21 Jun 2024 23:09:07 +0200

Hello Michael,

Yes, you are right, of course :) Okay, I didn't notice that `stderr'
is extracted earlier.
-----
After updating emacs today I got strange errors while running
consult-find in a remote container, for example:
```
/usr/bin/cat: /tmp/tramp.gBbQP1: No such file or directory
/usr/bin/cat: /tmp/tramp.SWKx2Y: No such file or directory
```

I checked the consult-find (which also points out to a "tramp bug"),
then I checked the tramp's latest changes and applied that one-line
from the patch, which fixed my issue.
(In fact that line `(stderr (plist-get args :stderr))' actually
nullifies the `stderr', so probably that's why it worked and I had a
feeling that it is a solution)

Please see below:
* consult-find: https://github.com/minad/consult/blob/main/consult.el#L4965
* consult--async-process:
https://github.com/minad/consult/blob/main/consult.el#L2287C1-L2296C69

I guess, to reproduce the issue, it's enough to invoke `make-process'
on a remote location and with a non-nil `:stderr' argument (a buffer
in `consult-find''s case).

Kind Regards,
Iurie

On Fri, 21 Jun 2024 at 21:21, Michael Albinus <[email-masked]> wrote:
>
> Iurie Marian <[email-masked]> writes:
>
> Hi,
>
> > tramp-sh-handle-make-process is failing when `:stderr' argument is
> > used.
> >
> > In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
> >  3.24.41, cairo version 1.18.0) of 2024-06-21 built on rrouwprlc0222
> > Repository revision: e7123edfe7f7abc9043429dfb3f84941f83d6565
> > Repository branch: master
> > System Description: Ubuntu 24.04 LTS
> >
> > diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
> > index bce7c323dad..68018298b68 100644
> > --- a/lisp/net/tramp-sh.el
> > +++ b/lisp/net/tramp-sh.el
> > @@ -2969,6 +2969,7 @@ tramp-sh-handle-make-process
> >        (let* ((program (car command))
> >            (args (cdr command))
> >            ;; STDERR can also be a file name.
> > +             (stderr (plist-get args :stderr))
> >            (tmpstderr
> >             (and stderr
> >                  (tramp-unquote-file-local-name
>
> Why that? stderr is extracted from args in tramp-skeleton-make-process.
>
> Do you get an error which shows the problem?
>
> Best regards, Michael.