Remote builds break when remote shell is not-POSIXy-enough #805

Closed
opened 2025-04-22 06:11:00 +00:00 by k900 · 3 comments
Member

Describe the bug

This was surfaced in my setup by a combination of nushell and f92235e1d2.

Lix runs ssh -x user@remote "echo started; nix-daemon --stdio", and then waits for "started" to be printed. However, on nushell, the semicolon operator swallows stdout, so it never is printed, and we wait forever.

This also has the potential to explode in other interesting ways on other non-POSIX shells, so we should probably think of a better solution (SSH subsystem? hello message in the daemon? rewrite the whole thing to use libssh? idk).

Steps To Reproduce

nix store ping --store ssh://user@host, where user@host's login shell is nushell.

Additional context

Fuck my life.

## Describe the bug This was surfaced in my setup by a combination of nushell and f92235e1d2ebe7f5fa8048543c4f59661d52f787. Lix runs `ssh -x user@remote "echo started; nix-daemon --stdio"`, and then waits for `"started"` to be printed. However, on nushell, the semicolon operator swallows stdout, so it never _is_ printed, and we wait forever. This also has the potential to explode in other interesting ways on other non-POSIX shells, so we should probably think of a better solution (SSH subsystem? hello message in the daemon? rewrite the whole thing to use libssh? idk). ## Steps To Reproduce `nix store ping --store ssh://user@host`, where `user@host`'s login shell is nushell. ## Additional context Fuck my life.
k900 added reference main 2025-04-22 06:11:05 +00:00
Author
Member

As a temporary workaround, I've created a new user that has its shell set to bash, and use it for remote builds only.

As a temporary workaround, I've created a new user that has its shell set to bash, and use it for remote builds only.
Author
Member

Never mind, that breaks nix-copy-closure. The new temporary workaround is https://gerrit.lix.systems/c/lix/+/3046 which is terrible and evil and I hate it.

Never mind, that breaks `nix-copy-closure`. The new temporary workaround is https://gerrit.lix.systems/c/lix/+/3046 which is terrible and evil and I hate it.
pennae added this to the 2.93 milestone 2025-04-25 17:26:03 +00:00
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/3046 ("libstore/ssh: fix the SSH connectivity check with non-POSIXy shells")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/3046", "number": 3046, "kind": "commit message"}], "cl_meta": {"3046": {"change_title": "libstore/ssh: fix the SSH connectivity check with non-POSIXy shells"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/3046](https://gerrit.lix.systems/c/lix/+/3046) ("libstore/ssh: fix the SSH connectivity check with non-POSIXy shells")
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#805
No description provided.