Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support graceful continuation from failed dependent tasks #50

Open
cassaundra opened this issue Mar 17, 2024 · 0 comments
Open

Support graceful continuation from failed dependent tasks #50

cassaundra opened this issue Mar 17, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@cassaundra
Copy link
Collaborator

Motivating example

Consider the following build script:

def-task check-all --decl [] {
    depends check-test
    depends check-clippy
    depends check-rustfmt
}

Currently, if any preceding dependent tasks fail, then the process will be aborted altogether. In this example, if any tests fail, then check-clippy and check-rustfmt will never be run, which the user may desire.

Proposal

According to the unwritten rules of quake's dependency system, it would be permissible to run any of the subsequent dependent tasks after another has failed, so long as such a task does not also depend on the failed tasks. As such, the build runner algorithm could be reimplemented with a greedier approach, which attempts to run as many tasks as possible before exiting (or waiting, as in watch mode).

For when you're actually building something though, fast failure is generally preferred. As such, the choice of whether to fast fail should be left to individual tasks or dependency declarations. Ideally, this would be determinable based on arguments passed to the task, which leaves the choice of either:

  1. Adding a DSL command for task declaration blocks (e.g. no-fast-fail)
  2. Adding an equivalent flag to depends (e.g. depends --no-fast-fail(-F) <dep_id>, alternatively --fallible(-F)).
  3. Using a $task variable (planned for the future) to do $task.fast-fail = false

I prefer the second approach, turning the above build script into:

def-task check-all --decl [] {
    depends -F check-test
    depends -F check-clippy
    depends -F check-rustfmt
}

The final -F in this example is of course redundant, but is left in for aesthetic/practical reasons.

@cassaundra cassaundra added the enhancement New feature or request label Mar 17, 2024
@cassaundra cassaundra added this to the quake 0.2.0 milestone Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant