Skip to content

dl-herdr-shell resolves dl by name with no fallback, so a herdr server with a bare PATH silently opens host shells #610

Description

@blooop

dl --install writes ~/.local/bin/dl-herdr-shell as:

command -v dl >/dev/null 2>&1 && exec dl --herdr-shell
exec "${SHELL:-/bin/sh}"

Resolving dl by name is the right call, and pane_shell.rs says why: an absolute
path goes stale the next time pixi global update replaces the env directory, and a
default_shell that has gone stale is a pane that will not open at all.

The gap is that there is no fallback between the two lines. By-name resolution needs
dl on the PATH the herdr server was spawned with, because the pane shell runs
before any shell startup file does — and nothing guarantees that PATH.

What it looks like when it misses

A herdr server spawned by the remote bootstrap (herdr machine add / a --remote
attach) inherits the PATH of a non-login ssh command. On this host that was:

PATH=/home/<user>/.pixi/envs/herdr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:
     /usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

The only pixi entry is envs/herdr/bin, prepended by pixi's own trampoline.
~/.pixi/bin — where a pixi global install devlaunch puts dl — is absent. So
command -v dl fails and every new pane silently execs a host /bin/bash instead of
entering the tab's DevPod workspace.

It is silent, and that is the expensive part: the pane opens, so nothing looks broken.
It just isn't the container. Interactive panes recover pixi on PATH a moment later
when bash reads its startup files, so everything typed in a pane works normally,
which makes the pane shell the one component that can't self-correct.

Suggested fix

Keep the by-name lookup first, and fall back to the standard pixi location before
giving up on dl entirely:

command -v dl >/dev/null 2>&1 && exec dl --herdr-shell
[ -x "${PIXI_HOME:-$HOME/.pixi}/bin/dl" ] && exec "${PIXI_HOME:-$HOME/.pixi}/bin/dl" --herdr-shell
exec "${SHELL:-/bin/sh}"

That keeps the pixi global update resilience the comment is protecting (the fallback
is the trampoline directory, not the versioned env directory, so an update does not
invalidate it) and only reaches for it when PATH has already come up empty.

A fallback is better than a louder failure here, because a pane that will not open is
the outcome the current design correctly refuses.

Version note

dl --install on this host wrote its pane shell from devlaunch 0.43.0, the current
pixi global build. 26433d7 — "fix: under pixi global the pane shell installed itself
where no pane could run it" — is in the repo but not in 0.43.0, so anyone diagnosing
this from a pixi-installed dl is looking at pre-26433d7 install behaviour while
reading post-26433d7 source. Worth naming in whatever release carries this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions