This repository has been archived by the owner on Mar 6, 2020. It is now read-only.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- fix concurrent executor not waiting for all actions to exit - pass error back to caller in sync executor
Move the debugging output from the build to the top level action.
Now that permits are handled elsewhere, run and runOut don't need to live on the context any more.
Also integrated dot debugging into test
davecheney
added a commit
that referenced
this pull request
Aug 18, 2015
Actions, Tasks and Executors
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a proposal for a new method for scheduling work to be done in gb. The current method of
Target
interfaces works ok, but feels convoluted and is less testable than I would like because cause and effect are separated by a long distance.This PR will introduce three distinct phases in gb.
gb.Context
is populated with packages according to the rules of the context and the project.gb.Package
s loaded into a context is transformed into a graph of actions. At this point the set of work to be performed is fully formed, and can be visualised for correctness.This removes the complicated dance of
ctx.Run
which sometimes runs actions immediately, and sometimes stores a pointer to their result for later. In this new model, Task functions can always be executed immediately, andActions
are the handle to execute them later. Error handling is also improved. Errors produced during phases 1 and 2 are surfaced immediately, rather than being smuggled into phase 3.Actions and Tasks
Actions and Tasks allow gb to separate the role of describing the order in which work will be done, from describing that work itself. Actions are the former, they describe the graph of dependencies between actions, and thus the work to be done. By traversing the action graph, we can do the work, execute the Tasks in a sane order.
Tasks describe the work to be done, without being concerned with the order in which the work is done -- that is up to the code that places Tasks into actions. Tasks also know more intimate details about filesystems, processes, file lists, etc that Actions do not.
Action graphs (they are not strictly trees as branches converge on base actions) contain only work to be performed, there are no Actions with empty Tasks or Tasks which do no work.
Executors
Actions are executed by Executors, but can also be transformed, mutated, or even graphed.
Here is a sample -dotfile