Subject: Re: bug#29723: 25.3; `compile' doesn't honor `tramp-methods', always uses "/bin/sh"

From: Michael Albinus <[email-masked]>
Date: Thu, 22 Feb 2018 11:39:37 +0100

"Matz, Daniel A. (JSC-EG511)" <[email-masked]> writes:

> Hello,

Hi Daniel,

> Starting with emacs -Q, execute the following:
>
> (require 'tramp)
> (let ((scpx-method (cdr (assoc "scpx" tramp-methods))))
>   (add-to-list 'scpx-method '(tramp-remote-shell "/bin/bash"))
>   (add-to-list 'tramp-methods (cons "scpx" scpx-method)))
>
> Then use the "scpx" connection type to find a file on a remote host.
> Then, use `shell-command' to run "echo $_".  I get an output of
> "/bin/bash".  Then, run the same command with `compile'.  I get an
> output of "/bin/sh".  I was expecting to again get "/bin/bash".

This is the same problem as bug#24338, I will mark your report as
duplicate.

In fact, "/bin/sh" is hardcoded for remote compilation in function
`compilation-start'. This shall be changed, using connection-local
variables, see (info "(elisp) Connection Local Variables")

It is on my todo list, but less prioritized. I would be happy if
somebody else takes the ball, and implements this in `compilation-start'.

> Thank you!
> Daniel

Best regards, Michael.