all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
@ 2022-01-29 14:29 Michael Rohleder
  2022-01-29 21:02 ` Leo Famulari
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Rohleder @ 2022-01-29 14:29 UTC (permalink / raw)
  To: 53623; +Cc: Michael Rohleder

* gnu/packages/ssh.scm (mosh)[arguments]: Add substitution for mosh-server and
-client. Remove unneeded 'wrap phase.
---
For some reason setting $PATH in 'wrap phase doesn't work anymore, the perl
script doesn't find it's binaries, so I substitute them there.

 gnu/packages/ssh.scm | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index 4dd8bb6d96..c296029fc0 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2022 Michael Rohleder <mike@rohleder.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -478,19 +479,15 @@ (define-public mosh
      '(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-FHS-file-names
-           (lambda _
-             (substitute* "scripts/mosh.pl"
-               (("/bin/sh")
-                (which "sh")))
-             #t))
-         (add-after 'install 'wrap
            (lambda* (#:key outputs #:allow-other-keys)
-             ;; Make sure 'mosh' can find 'mosh-client' and
-             ;; 'mosh-server'.
              (let* ((out (assoc-ref outputs "out"))
                     (bin (string-append out "/bin")))
-               (wrap-program (string-append bin "/mosh")
-                             `("PATH" ":" prefix (,bin)))))))))
+               (substitute* "scripts/mosh.pl"
+                 (("/bin/sh") (which "sh"))
+                 (("\\$server = 'mosh-server'")
+                  (string-append "$server = '" bin "/mosh-server'"))
+                 (("\\$client = 'mosh-client'")
+                  (string-append "$client = '" bin "/mosh-client'")))))))))
     (native-inputs
      (list pkg-config))
     (inputs
-- 
2.34.0





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

* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
  2022-01-29 14:29 [bug#53623] [PATCH] gnu: mosh: Fix path to binaries Michael Rohleder
@ 2022-01-29 21:02 ` Leo Famulari
  2022-01-29 22:27   ` Thiago Jung Bauermann via Guix-patches via
  2022-01-30 10:14   ` Michael Rohleder
  0 siblings, 2 replies; 11+ messages in thread
From: Leo Famulari @ 2022-01-29 21:02 UTC (permalink / raw)
  To: Michael Rohleder; +Cc: 53623

On Sat, Jan 29, 2022 at 03:29:50PM +0100, Michael Rohleder wrote:
> * gnu/packages/ssh.scm (mosh)[arguments]: Add substitution for mosh-server and
> -client. Remove unneeded 'wrap phase.
> ---
> For some reason setting $PATH in 'wrap phase doesn't work anymore, the perl
> script doesn't find it's binaries, so I substitute them there.

Can you clarify the situation where it doesn't work? I'm using mosh as a
server on Guix System and it's working for me.




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

* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
  2022-01-29 21:02 ` Leo Famulari
@ 2022-01-29 22:27   ` Thiago Jung Bauermann via Guix-patches via
  2022-01-30 10:14   ` Michael Rohleder
  1 sibling, 0 replies; 11+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2022-01-29 22:27 UTC (permalink / raw)
  To: 53623; +Cc: Michael Rohleder, Leo Famulari

Hello,

Em sábado, 29 de janeiro de 2022, às 18:02:14 -03, Leo Famulari escreveu:
> On Sat, Jan 29, 2022 at 03:29:50PM +0100, Michael Rohleder wrote:
> > * gnu/packages/ssh.scm (mosh)[arguments]: Add substitution for
> > mosh-server and -client. Remove unneeded 'wrap phase.
> > ---
> > For some reason setting $PATH in 'wrap phase doesn't work anymore, the
> > perl script doesn't find it's binaries, so I substitute them there.
> 
> Can you clarify the situation where it doesn't work? I'm using mosh as a
> server on Guix System and it's working for me.

I’m also using it both as a client and a server and it’s working fine for 
me.

Both the client and the server are on foreign distros.

-- 
Thanks,
Thiago






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

* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
  2022-01-29 21:02 ` Leo Famulari
  2022-01-29 22:27   ` Thiago Jung Bauermann via Guix-patches via
@ 2022-01-30 10:14   ` Michael Rohleder
  2022-01-30 18:35     ` Leo Famulari
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Rohleder @ 2022-01-30 10:14 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 53623

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

Leo Famulari <leo@famulari.name> writes:
> Can you clarify the situation where it doesn't work? I'm using mosh as a
> server on Guix System and it's working for me.

Interesting. On my guix system it currently does this:

~$ mosh localhost
bash: line 1: mosh-server: command not found
Connection to localhost closed.
/gnu/store/8xfhfr75svf6lw3fl4pnj47f31hz04lr-mosh-1.3.2/bin/.mosh-real: Did not find mosh server startup message. (Have you installed mosh on your server?)

It's the same for remote guix systems.

Well, atleast the patch would save spawning a subshell ;)

-- 
On the eigth day, God started debugging

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

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

* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
  2022-01-30 10:14   ` Michael Rohleder
@ 2022-01-30 18:35     ` Leo Famulari
  2022-01-30 18:44       ` Michael Rohleder
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Famulari @ 2022-01-30 18:35 UTC (permalink / raw)
  To: Michael Rohleder; +Cc: 53623

On Sun, Jan 30, 2022 at 11:14:55AM +0100, Michael Rohleder wrote:
> Leo Famulari <leo@famulari.name> writes:
> > Can you clarify the situation where it doesn't work? I'm using mosh as a
> > server on Guix System and it's working for me.
> 
> Interesting. On my guix system it currently does this:
> 
> ~$ mosh localhost
> bash: line 1: mosh-server: command not found
> Connection to localhost closed.
> /gnu/store/8xfhfr75svf6lw3fl4pnj47f31hz04lr-mosh-1.3.2/bin/.mosh-real: Did not find mosh server startup message. (Have you installed mosh on your server?)

I wonder, did you install mosh via config.scm? Or with `guix install
mosh`?

> It's the same for remote guix systems.
> 
> Well, atleast the patch would save spawning a subshell ;)

True, I think there's no harm with your patch.




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

* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
  2022-01-30 18:35     ` Leo Famulari
@ 2022-01-30 18:44       ` Michael Rohleder
  2022-01-30 19:10         ` Leo Famulari
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Rohleder @ 2022-01-30 18:44 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 53623

[-- Attachment #1: Type: text/plain, Size: 282 bytes --]

Leo Famulari <leo@famulari.name> writes:
> I wonder, did you install mosh via config.scm? Or with `guix install
> mosh`?

mosh is installed in the user profile via `guix install`.
perl is installed via config.scm.

-- 
Old programmers never die, they just become managers.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

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

* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
  2022-01-30 18:44       ` Michael Rohleder
@ 2022-01-30 19:10         ` Leo Famulari
  2022-01-30 22:32           ` Thiago Jung Bauermann via Guix-patches via
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Famulari @ 2022-01-30 19:10 UTC (permalink / raw)
  To: Michael Rohleder; +Cc: 53623

On Sun, Jan 30, 2022 at 07:44:45PM +0100, Michael Rohleder wrote:
> Leo Famulari <leo@famulari.name> writes:
> > I wonder, did you install mosh via config.scm? Or with `guix install
> > mosh`?
> 
> mosh is installed in the user profile via `guix install`.
> perl is installed via config.scm.

Ah. I had to install mosh via config.scm, probably to work around this
issue.

The environment created when logging in over SSH to use a
non-interactive shell (such as for starting mosh) is not a complete
environment and doesn't really work for packages installed with Guix.

We arranged so that system-level packages would work correctly in this
enviroment, but it's not trivial to design a solution for user-level
packages:

https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/shadow.scm?id=43dd34c7777a212c99a97da7a2c237158faa9a1b#n135




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

* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
  2022-01-30 19:10         ` Leo Famulari
@ 2022-01-30 22:32           ` Thiago Jung Bauermann via Guix-patches via
  2022-03-06 21:39             ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Thiago Jung Bauermann via Guix-patches via @ 2022-01-30 22:32 UTC (permalink / raw)
  To: 53623; +Cc: Michael Rohleder, Leo Famulari

Hello,

Em domingo, 30 de janeiro de 2022, às 16:10:55 -03, Leo Famulari escreveu:
> On Sun, Jan 30, 2022 at 07:44:45PM +0100, Michael Rohleder wrote:
> > Leo Famulari <leo@famulari.name> writes:
> > > I wonder, did you install mosh via config.scm? Or with `guix install
> > > mosh`?
> > 
> > mosh is installed in the user profile via `guix install`.
> > perl is installed via config.scm.
> 
> Ah. I had to install mosh via config.scm, probably to work around this
> issue.
> 
> The environment created when logging in over SSH to use a
> non-interactive shell (such as for starting mosh) is not a complete
> environment and doesn't really work for packages installed with Guix.
> 
> We arranged so that system-level packages would work correctly in this
> enviroment, but it's not trivial to design a solution for user-level
> packages:
> 
> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/shadow.scm?id=
> 43dd34c7777a212c99a97da7a2c237158faa9a1b#n135

Ah, right. I ran into that when mosh’ing into the remote machine.

This is actually a bash limitation (or even bug, I’d argue), because it 
doesn’t have an initialization file to set the environment for both 
interactive and non-interactive shells.

zsh has ~/.zshenv, which is always read and is where I source
/etc/profile.d/*.sh (including guix.sh). So the solution was simply to 
change the login shell from bash to zsh.

-- 
Thanks,
Thiago






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

* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
  2022-01-30 22:32           ` Thiago Jung Bauermann via Guix-patches via
@ 2022-03-06 21:39             ` Ludovic Courtès
  2022-03-07  8:54               ` Michael Rohleder
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2022-03-06 21:39 UTC (permalink / raw)
  To: 53623, Michael Rohleder, Leo Famulari, Thiago Jung Bauermann

Hi there!

So what’s the status of this patch?  :-)

  https://issues.guix.gnu.org/53623

TIA,
Ludo’.




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

* [bug#53623] [PATCH] gnu: mosh: Fix path to binaries.
  2022-03-06 21:39             ` Ludovic Courtès
@ 2022-03-07  8:54               ` Michael Rohleder
  2022-03-07 20:23                 ` bug#53623: " Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Rohleder @ 2022-03-07  8:54 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 53623, Thiago Jung Bauermann, Leo Famulari

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

Hi Ludo,

Ludovic Courtès <ludo@gnu.org> writes:
> So what’s the status of this patch?  :-)

I can confirm that mosh(-server) works in a system profile.
This patch would only save us a bash exec, not sure if it's worth it.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

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

* bug#53623: [PATCH] gnu: mosh: Fix path to binaries.
  2022-03-07  8:54               ` Michael Rohleder
@ 2022-03-07 20:23                 ` Ludovic Courtès
  0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2022-03-07 20:23 UTC (permalink / raw)
  To: Michael Rohleder; +Cc: 53623-done, Leo Famulari, Thiago Jung Bauermann

Hi Michael,

Michael Rohleder <mike@rohleder.de> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>> So what’s the status of this patch?  :-)
>
> I can confirm that mosh(-server) works in a system profile.
> This patch would only save us a bash exec, not sure if it's worth it.

Alright, closing, but feel free to reopen if you change your mind.

Thanks,
Ludo’.




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

end of thread, other threads:[~2022-03-07 20:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29 14:29 [bug#53623] [PATCH] gnu: mosh: Fix path to binaries Michael Rohleder
2022-01-29 21:02 ` Leo Famulari
2022-01-29 22:27   ` Thiago Jung Bauermann via Guix-patches via
2022-01-30 10:14   ` Michael Rohleder
2022-01-30 18:35     ` Leo Famulari
2022-01-30 18:44       ` Michael Rohleder
2022-01-30 19:10         ` Leo Famulari
2022-01-30 22:32           ` Thiago Jung Bauermann via Guix-patches via
2022-03-06 21:39             ` Ludovic Courtès
2022-03-07  8:54               ` Michael Rohleder
2022-03-07 20:23                 ` bug#53623: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.