tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tramp path-munging breaks remote compilation


From: Kevin Broadey
Subject: tramp path-munging breaks remote compilation
Date: Wed, 26 May 2021 11:57:41 -0000

I'm running emacs-27.2 under Cygwin64 on a Windows 10 laptop to access files on a CentOS-7 server over ssh. I've customized tramp-default-method to "ssh" and tramp-syntax to simplified so I can "C-x d /myhost: RET" to get a dired listing of my remote home directory.

My remote machine is set up to use the "devtoolset-7" package which installs gcc-7 in /opt/rh/devtoolset-7/root/usr/bin so, to get it in my PATH, my .bash_profile contains "source /opt/rh/devtoolset-7/enable" which makes the necessary environment changes, critically...

    export PATH=/opt/rh/devtoolset-7/root/usr/bin${PATH:+:${PATH}}

However, when I run "M-x compile RET env|sort RET" from emacs, it reports...

    PATH=/usr/bin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin

The only way I've been able to get Tramp to Do The Right Thing and leave my remote PATH the way I want it to be is to put this in my .emacs file...

    ;; tramp is overzealous about setting the remote PATH,
    ;; contrary to .profile, .bash_profile .bashrc etc
    (eval-after-load "tramp-sh" '(defun tramp-set-remote-path(vec)))

This is maybe an extreme reaction, but I've got a job to do, and when it comes to setting the remote PATH, I really do know better than my editor.

I can understand that you would want a "safe" path for poking around under the hood on the remote machine, but when you're executing commands on behalf of the user, you really ought to be doing so in the user's environment, not yours.

Thanks



reply via email to

[Prev in Thread] Current Thread [Next in Thread]