Subject: Re: bug#41702: `guix environment` performance issues

From: Ludovic Courtès <[email-masked]>
Date: Wed, 01 Jul 2020 12:49:51 +0200

Hi,

Ludovic Courtès <[email-masked]> skribis:

> +    (when open-connection
> +      (let* ((sock (open-connection host port)))
> +        ;; Since 'session-set!' doesn't increase the revealed count of SOCK
> +        ;; (as of Guile-SSH 0.12.0), do it ourselves.
> +        (set-port-revealed! sock 1)
> +        (session-set! session 'fd sock)))

The problem with this approach is that ‘open-connection’ is past the raw
host name; aliases, proxy commands, etc. from ~/.ssh/config are ignored.

So it cannot go in as is.  :-/

What we need is Guile-SSH bindings for ‘ssh_get_fd’, which would allow
us to get at the actual file descriptor after the connection has been
opened, and to set TCP_NODELAY there:

  http://api.libssh.org/stable/group__libssh__session.html#gafe509fcea47714b5cd277d1e35e83276

It’s not 100% clear though if it returns that “right” FD when there’s a
proxy command.

Ludo’.