Skip to content

Task runner exits non-zero even when root task succeeds via @complete dependencies #2454

@schickling

Description

@schickling

Problem

Follow-up to #2435 — the @complete suffix works correctly for dependency propagation (the parent task doesn't fail), but the task runner process still exits non-zero if any task in the graph failed.

This means devenv shell / direnv reload reports error exit status 1 even though devenv:enterShell succeeded.

Reproduction

{
  tasks = {
    "will-fail" = {
      exec = "exit 1";
    };
    "devenv:enterShell" = {
      after = [ "will-fail@complete" ];
    };
  };
}
$ devenv shell -- echo ok
Running tasks     devenv:enterShell

Running           will-fail
Failed            will-fail (5.00ms)
Running           devenv:enterShell
Succeeded         devenv:enterShell (10.00ms)
1 Succeeded, 1 Failed

direnv: error exit status 1

devenv:enterShell succeeds (as expected with @complete), but the process exits 1 because will-fail is in the failure count.

Expected Behavior

When the requested root task (devenv:enterShell) succeeds, the runner should exit 0. Failed @complete dependencies were explicitly marked as non-blocking — their failure shouldn't affect the overall exit code.

Impact

This breaks direnv integration since direnv treats any non-zero exit as an error, preventing the shell environment from loading. It defeats the purpose of @complete for the shell-entry use case.

Related

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions