unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* GuixSD and TRAMP
@ 2016-10-19 22:21 Christopher Allan Webber
  2016-10-19 22:52 ` Christopher Allan Webber
  0 siblings, 1 reply; 9+ messages in thread
From: Christopher Allan Webber @ 2016-10-19 22:21 UTC (permalink / raw)
  To: help-guix

Hello!

I've been trying to access a remote GuixSD server I have running using
TRAMP in emacs.  I figured out that in order for path resolution to
work I had to install perl in my remote user's path somehow.  So, that's
done.

I can open up directories in dired, but when I try to open an individual
file, I get:

  Tramp: Inserting ‘/ssh:kari:/home/cwebber/.emacs’...failed
  Wrong method specification for ‘ssh’

I see I'm not the only one!  ecraven reports the same here:
  https://gnunet.org/bot/log/guix/2016-06-10#T1053360

Does anyone know how to resolve this?
Thanks!
 - Chris

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GuixSD and TRAMP
  2016-10-19 22:21 GuixSD and TRAMP Christopher Allan Webber
@ 2016-10-19 22:52 ` Christopher Allan Webber
  2016-10-20 21:00   ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Christopher Allan Webber @ 2016-10-19 22:52 UTC (permalink / raw)
  To: help-guix

Christopher Allan Webber writes:

> Hello!
>
> I've been trying to access a remote GuixSD server I have running using
> TRAMP in emacs.  I figured out that in order for path resolution to
> work I had to install perl in my remote user's path somehow.  So, that's
> done.
>
> I can open up directories in dired, but when I try to open an individual
> file, I get:
>
>   Tramp: Inserting ‘/ssh:kari:/home/cwebber/.emacs’...failed
>   Wrong method specification for ‘ssh’
>
> I see I'm not the only one!  ecraven reports the same here:
>   https://gnunet.org/bot/log/guix/2016-06-10#T1053360
>
> Does anyone know how to resolve this?
> Thanks!
>  - Chris

Ho-ho, it turns out the snippet Ludo pasted me on IRC was the answer
after all:

  ;; Make sure we work on remote guixsd machines :)
  ;; probably only helps if you start on a guixsd machine..!
  (setq tramp-remote-path
        (append tramp-remote-path
                '(tramp-own-remote-path)))

There ya go!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GuixSD and TRAMP
  2016-10-19 22:52 ` Christopher Allan Webber
@ 2016-10-20 21:00   ` Ludovic Courtès
  2016-10-20 22:55     ` Christopher Allan Webber
  2016-10-21 12:27     ` Alex Kost
  0 siblings, 2 replies; 9+ messages in thread
From: Ludovic Courtès @ 2016-10-20 21:00 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: help-guix

Christopher Allan Webber <cwebber@dustycloud.org> skribis:

> Ho-ho, it turns out the snippet Ludo pasted me on IRC was the answer
> after all:
>
>   ;; Make sure we work on remote guixsd machines :)
>   ;; probably only helps if you start on a guixsd machine..!
>   (setq tramp-remote-path
>         (append tramp-remote-path
>                 '(tramp-own-remote-path)))

Good to know!

Should we patch Emacs or something so that it works by default?

IIRC Tramp invokes ‘getconf PATH’ on the remote machine, which is
totally useless on GuixSD and hardly fixable:

  $ getconf PATH
  /bin:/usr/bin

(For the record, it returns the value of libc’s ‘_PATH_DEFPATH’
constant, which doesn’t make much sense on non-FHS systems.)

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GuixSD and TRAMP
  2016-10-20 21:00   ` Ludovic Courtès
@ 2016-10-20 22:55     ` Christopher Allan Webber
  2016-10-21 12:27     ` Alex Kost
  1 sibling, 0 replies; 9+ messages in thread
From: Christopher Allan Webber @ 2016-10-20 22:55 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix

Ludovic Courtès writes:

> Christopher Allan Webber <cwebber@dustycloud.org> skribis:
>
>> Ho-ho, it turns out the snippet Ludo pasted me on IRC was the answer
>> after all:
>>
>>   ;; Make sure we work on remote guixsd machines :)
>>   ;; probably only helps if you start on a guixsd machine..!
>>   (setq tramp-remote-path
>>         (append tramp-remote-path
>>                 '(tramp-own-remote-path)))
>
> Good to know!
>
> Should we patch Emacs or something so that it works by default?

It seems like a good idea.  It wouldn't hurt anything... aside from
incurring the usual "cost to make a custom distro patch" :)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GuixSD and TRAMP
  2016-10-20 21:00   ` Ludovic Courtès
  2016-10-20 22:55     ` Christopher Allan Webber
@ 2016-10-21 12:27     ` Alex Kost
  2016-10-24 19:24       ` myglc2
  2016-10-25  8:16       ` Ludovic Courtès
  1 sibling, 2 replies; 9+ messages in thread
From: Alex Kost @ 2016-10-21 12:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix

Ludovic Courtès (2016-10-20 23:00 +0200) wrote:

> Christopher Allan Webber <cwebber@dustycloud.org> skribis:
>
>> Ho-ho, it turns out the snippet Ludo pasted me on IRC was the answer
>> after all:
>>
>>   ;; Make sure we work on remote guixsd machines :)
>>   ;; probably only helps if you start on a guixsd machine..!
>>   (setq tramp-remote-path
>>         (append tramp-remote-path
>>                 '(tramp-own-remote-path)))

I also add 'tramp-own-remote-path' to tramp-remote-path in my emacs
config; as well as Ricardo and David.

> Good to know!
>
> Should we patch Emacs or something so that it works by default?

Just to mention, a year ago David and I (and probably Ricardo) also
agreed that it would be good to patch our Emacs for this.  It's just
that no one have sent such a patch since then :-)

The conversation was happening from
<https://gnunet.org/bot/log/guix/2015-10-24#T788306> to
<https://gnunet.org/bot/log/guix/2015-10-24#T788410>

-- 
Alex

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GuixSD and TRAMP
  2016-10-21 12:27     ` Alex Kost
@ 2016-10-24 19:24       ` myglc2
  2016-10-25 14:51         ` Christopher Allan Webber
  2016-10-25  8:16       ` Ludovic Courtès
  1 sibling, 1 reply; 9+ messages in thread
From: myglc2 @ 2016-10-24 19:24 UTC (permalink / raw)
  To: Alex Kost; +Cc: help-guix

On 10/21/2016 at 15:27 Alex Kost writes:

> Ludovic Courtès (2016-10-20 23:00 +0200) wrote:
>
>> Christopher Allan Webber <cwebber@dustycloud.org> skribis:
>>
>>> Ho-ho, it turns out the snippet Ludo pasted me on IRC was the answer
>>> after all:
>>>
>>>   ;; Make sure we work on remote guixsd machines :)
>>>   ;; probably only helps if you start on a guixsd machine..!
>>>   (setq tramp-remote-path
>>>         (append tramp-remote-path
>>>                 '(tramp-own-remote-path)))
>
> I also add 'tramp-own-remote-path' to tramp-remote-path in my emacs
> config; as well as Ricardo and David.
>
>> Good to know!
>>
>> Should we patch Emacs or something so that it works by default?
>
> Just to mention, a year ago David and I (and probably Ricardo) also
> agreed that it would be good to patch our Emacs for this.  It's just
> that no one have sent such a patch since then :-)
>
> The conversation was happening from
> <https://gnunet.org/bot/log/guix/2015-10-24#T788306> to
> <https://gnunet.org/bot/log/guix/2015-10-24#T788410>


In the interest of stating problems next to the fix, this fixes the
error message ...

"Couldn't find a proper `ls' command"

... when tramping _in_ to GuixSD from another GuixSD machine.

Does it work when connecting from Guix on a Foreign distro?

Regarding the comment ";; probably only helps if you start on a guixsd
machine..!", I find that, if I apply this code after the initial attempt
to tramp in from a foreign distro fails, it rescues the tramp session.

So I wonder, can this be conditioned to run later in the tramp "scheme
of things" in order to provide a generic fix for tramping into GuixSD
from any distro?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GuixSD and TRAMP
  2016-10-21 12:27     ` Alex Kost
  2016-10-24 19:24       ` myglc2
@ 2016-10-25  8:16       ` Ludovic Courtès
  1 sibling, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2016-10-25  8:16 UTC (permalink / raw)
  To: Alex Kost; +Cc: help-guix

Alex Kost <alezost@gmail.com> skribis:

> Ludovic Courtès (2016-10-20 23:00 +0200) wrote:
>
>> Christopher Allan Webber <cwebber@dustycloud.org> skribis:
>>
>>> Ho-ho, it turns out the snippet Ludo pasted me on IRC was the answer
>>> after all:
>>>
>>>   ;; Make sure we work on remote guixsd machines :)
>>>   ;; probably only helps if you start on a guixsd machine..!
>>>   (setq tramp-remote-path
>>>         (append tramp-remote-path
>>>                 '(tramp-own-remote-path)))
>
> I also add 'tramp-own-remote-path' to tramp-remote-path in my emacs
> config; as well as Ricardo and David.
>
>> Good to know!
>>
>> Should we patch Emacs or something so that it works by default?
>
> Just to mention, a year ago David and I (and probably Ricardo) also
> agreed that it would be good to patch our Emacs for this.  It's just
> that no one have sent such a patch since then :-)

Good, let’s all add it to our to-do list then.  ;-)

Looks like it shouldn’t be hard to address and would save people a lot
of time.

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GuixSD and TRAMP
  2016-10-24 19:24       ` myglc2
@ 2016-10-25 14:51         ` Christopher Allan Webber
  2016-10-25 16:45           ` Christopher Allan Webber
  0 siblings, 1 reply; 9+ messages in thread
From: Christopher Allan Webber @ 2016-10-25 14:51 UTC (permalink / raw)
  To: myglc2; +Cc: Alex Kost, help-guix

myglc2 writes:

> In the interest of stating problems next to the fix, this fixes the
> error message ...
>
> "Couldn't find a proper `ls' command"
>
> ... when tramping _in_ to GuixSD from another GuixSD machine.
>
> Does it work when connecting from Guix on a Foreign distro?

I haven't tried but I doubt it... my understanding is the lisp code I
pasted only adds the paths you have locally to the paths it searches
remotely.  Unless you're searching similar profile paths remotely, it
might not find them.

I'm also not sure it will find the right paths if your username is
different on the remote host, and some of the binaries it's looking for
are in your user's profile there?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: GuixSD and TRAMP
  2016-10-25 14:51         ` Christopher Allan Webber
@ 2016-10-25 16:45           ` Christopher Allan Webber
  0 siblings, 0 replies; 9+ messages in thread
From: Christopher Allan Webber @ 2016-10-25 16:45 UTC (permalink / raw)
  To: myglc2; +Cc: Alex Kost, help-guix

Christopher Allan Webber writes:

> I'm also not sure it will find the right paths if your username is
> different on the remote host, and some of the binaries it's looking for
> are in your user's profile there?

Well, I just found in the `tramp-remote-path' docs:

  You can use ‘~’ in this list, but when searching for a shell which groks
  tilde expansion, all directory names starting with ‘~’ will be ignored.

Given that, I've updated the code I'm using to:

#+BEGIN_SRC emacs-lisp
  ;; Make sure we work on remote guixsd machines :)
  ;; probably only helps if you start on a guixsd machine..!
  (setq tramp-remote-path
        (append tramp-remote-path
                '(tramp-own-remote-path
                  "~/.guix-profile/bin" "~/.guix-profile/sbin")))
#+END_SRC

But maybe the best option would be:

#+BEGIN_SRC emacs-lisp
  ;; Make sure we work on remote guixsd machines :)
  ;; probably only helps if you start on a guixsd machine..!
  (setq tramp-remote-path
        (append tramp-remote-path
                '("~/.guix-profile/bin" "~/.guix-profile/sbin"
                  "/run/current-system/profile/bin" "/run/current-system/profile/sbin")))
#+END_SRC

That seems like the best general case route?  We could keep
tramp-own-remote-path in there too, I guess?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-10-25 16:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-19 22:21 GuixSD and TRAMP Christopher Allan Webber
2016-10-19 22:52 ` Christopher Allan Webber
2016-10-20 21:00   ` Ludovic Courtès
2016-10-20 22:55     ` Christopher Allan Webber
2016-10-21 12:27     ` Alex Kost
2016-10-24 19:24       ` myglc2
2016-10-25 14:51         ` Christopher Allan Webber
2016-10-25 16:45           ` Christopher Allan Webber
2016-10-25  8:16       ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).