Skip to content

fix(fleet): fleet-command Run step lacks the toolchain on PATH — dispatched cargo commands fail 127 #13170

Open

Description

@dezren39

What happened

A dispatched cargo command fails on the fleet-command runner with
exit 127 before doing any work:

Run command step (cwd $GITHUB_WORKSPACE/target):
  bash -euo pipefail -c "$FLEET_RUN_COMMAND"
  FLEET_RUN_COMMAND: cargo test --manifest-path pkgs/fleet/Cargo.toml -p fleet-queue --features client,queue-broker
  -> bash: line 1: cargo: command not found

Evidence: run 45150362527 on dezren39/fleet (job 137609977212),
dispatched 2026-11-23 for the #13146 verification; the identical
command with export PATH=$CARGO_HOME/bin:$PATH; prefixed runs
(run 45151395564).

Why

The workflow's Run command step executes on the runner host (not
in the fleet-build container) with CARGO_HOME / RUSTUP_HOME
pointed at the restored dependency cache — the rustup shims live
in $CARGO_HOME/bin — but the step never adds that directory to
PATH. Shell built-ins and git work, so trivial probe commands
(the only kind exercised in the first dispatch verifications)
pass; any cargo/go toolchain command fails 127. The runbook
(pkgs/fleet/doc/agents/remote-build-and-test.md) shows bare
--command 'cargo test --workspace', which hits this on its
first real use.

Fix shapes (either, or both)

  1. Workflow: in the Run command step of fleet-command.yml (all
    fleet runner repos), prepend $CARGO_HOME/bin (and the Go
    equivalent) to PATH before executing FLEET_RUN_COMMAND.
  2. Runbook: document the PATH prefix as part of the dispatched
    command until (1) lands everywhere.

Acceptance

  • A bare --command 'cargo --version' dispatch succeeds on each
    active surface without a caller-side PATH prefix.
  • Oracle: the dispatched run's log shows the cargo version line
    and exit 0.
{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T09:59:31Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Probe evidence (dispatch runs 45152996653 and 45153741326, 2026-11-23):

    • The Run command step executes INSIDE the fleet-build container with PATH=/home/vscode/.nix-profile/bin:/usr/local/go/bin:... — Go works out of the box; Rust does not.
    • /home/vscode/.nix-profile/bin contains only nix itself.
    • $CARGO_HOME/bin does not exist in the restored dependency cache (the cache CARGO_HOME holds registry/git data only, no shims) — so the caller-side PATH prefix does NOT fix it; run 45151395564 with the prefix failed 127 identically.
    • A rustup toolchain exists in the image only as a nix store path: /nix/store/mn67k9rqg1vkfvdhfim1x1dgvxqd9fai-cargo-1.99.1-x86_64-unknown-linux-gnu (bin/cargo under it), not linked from RUSTUP_HOME's cache dir in any way a command can rely on.

    So the fix has to put a stable cargo on PATH in the image or the workflow (e.g. link the toolchain bin into the nix profile, or export PATH with the toolchain dir in the Run step). Until then, dispatched cargo commands need a store-glob prefix, which is hash-dependent and brittle.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions