Skip to content

Commit

Permalink
[engine] model snapshots in validation, make root rules a dict instea…
Browse files Browse the repository at this point in the history
…d of a set (pantsbuild#4125)

### Problem
I'm working on porting my patch for pantsbuild#3580 to the native engine, (pantsbuild#3960). First, I'm updating the graph construction code with the changes there. It hadn't covered Snapshot processes, and it modeled root rules as a set rather than a graph, which caused problems.

### Solution

Include snapshot process' behavior in the rule graph construction used by the validator. Update tests to expect the new visualization format.

### List of changes
* rename NodeBuilder to RuleIndex
* rename RootRule to RootRuleGraphEntry
* support SnapshotProcess in validator
* Name snapshot process funcs so they are printable
* Include subject and product types in intrinsic rule repr
* Include graph generation methods that can construct new graphs from an existing one--these are currently unused
* Raise an error if a declared rule is not reachable from the declared root types.
* Unify naming for input selector for projection selectors
* If field of a SelectDependencies is the default value, don't include it in the repr
* Include a map of root rule to the rules that would fulfill it.
  • Loading branch information
baroquebobcat authored Dec 7, 2016
1 parent 896f63d commit 0dd2423
Show file tree
Hide file tree
Showing 6 changed files with 367 additions and 186 deletions.
8 changes: 6 additions & 2 deletions src/python/pants/engine/isolated_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ def ptree(func):

def create_snapshot_intrinsics(project_tree):
def ptree(func):
return functools.partial(func, project_tree, snapshot_directory(project_tree))
partial = functools.partial(func, project_tree, snapshot_directory(project_tree))
partial.__name__ = '{}_intrinsic'.format(func.__name__)
return partial
return [
(Snapshot, Files, ptree(create_snapshot_archive)),
]
Expand All @@ -213,7 +215,9 @@ def create_snapshot_tasks(project_tree):
uncacheable singleton.
"""
def ptree(func):
return functools.partial(func, project_tree, snapshot_directory(project_tree))
partial = functools.partial(func, project_tree, snapshot_directory(project_tree))
partial.__name__ = '{}_task'.format(func.__name__)
return partial
return [
(Snapshot, [Select(Files)], ptree(create_snapshot_archive)),
]
Loading

0 comments on commit 0dd2423

Please sign in to comment.