tramp-devel
[Top][All Lists]
Advanced

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

Re: Question about remote path.


From: Michael Albinus
Subject: Re: Question about remote path.
Date: Wed, 27 Mar 2019 16:42:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Ergus <address@hidden> writes:

> Hi Michel:

Hi,

>>The canonical method would be to regard `tramp-remote-path' as
>>connection-local variable. I fear this doesn't work yet properly whith
>>`tramp-remote-path'; will check.
>
> Ohh good, thanks! maybe not for all users, but for me this will be very
> useful.

I've pushed a fix to master, which implements this. The Tramp manual has
been extended as well:

--8<---------------cut here---------------start------------->8---
   Starting with Emacs 26, ‘tramp-remote-path’ can be set per host via
connection-local variables, *Note (emacs)Connection Variables::.  You
could define your own search directories like this:

     (connection-local-set-profile-variables 'remote-path-with-bin
        '((tramp-remote-path . ("~/bin" tramp-default-remote-path))))

     (connection-local-set-profile-variables 'remote-path-with-apply-pub-bin
        '((tramp-remote-path . ("/appli/pub/bin" tramp-default-remote-path))))

     (connection-local-set-profiles
        '(:application tramp :machine "randomhost") 'remote-path-with-bin)

     (connection-local-set-profiles
        '(:application tramp :user "anotheruser" :machine "anotherhost")
          'remote-path-with-apply-pub-bin)
--8<---------------cut here---------------end--------------->8---

With this, you don't need the `tramp-own-remote-path' trick.

>>Hmm, I don't understand this completely. Could you pls give me an
>>example, especially what you mean by loading modules. A kernel module?
>>
> There is a program called lmod[1] for example and there are multiple
> versions and programs. When a user wants to use one of them he calls for
> example:
>
> module load gcc/7.2.1
>
> And the environment variables will be modified to add the locations
> preempted to the path, ld_library_path, include_path, and some
> environment variables are modified (or declared) like CC, CXX. This
> allows to have multiple programs/libraries/utilities and versions in the
> same machine and multiple users can access the ones they need. This is
> very typical in all the HPC clusters, but maybe it is too complex to
> support somehow in tramp.

Every process you call via Tramp keeps its own environment, but doesn't
export it to be reused by another process. So you must organize yourself
to have set up all your environment for every external process on the
remote side.

There is a TODO for Tramp to support process reuse, see tramp-sh.el:

--8<---------------cut here---------------start------------->8---
;; * Implement detaching/re-attaching remote sessions.  By this, a
;;   session could be reused after a connection loss.  Use dtach, or
;;   screen, or tmux, or mosh.
--8<---------------cut here---------------end--------------->8---

But this hasn't been implemented (yet).

> Very thanks,
> Ergus

Best regards, Michael.



reply via email to

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