hundreds-breakfast-49010
11/23/2019, 12:06 AM@rule?aloof-angle-91616
11/23/2019, 12:07 AM<http://nodes.rs|nodes.rs>aloof-angle-91616
11/23/2019, 12:07 AMimpl WrappedNode for Task {
type Item = Value;
fn run(self, context: Context) -> NodeFuture<Value> {
let params = self.params;
let deps = {
let edges = &context
.core
.rule_graph
.edges_for_inner(&self.entry)
.expect("edges for task exist.");
future::join_all(
self
.task
.clause
.into_iter()
.map(|s| Select::new_from_edges(params.clone(), s.product, edges).run(context.clone()))
.collect::<Vec<_>>(),
)
};
let func = self.task.func;
let entry = self.entry;
let product = self.product;
deps
.then(move |deps_result| match deps_result {
Ok(deps) => externs::call(&externs::val_for(&func.0), &deps),
Err(failure) => Err(failure),
})
.then(move |task_result| match task_result {
Ok(val) => match externs::get_type_for(&val) {
t if t == context.core.types.coroutine => Self::generate(context, params, entry, val),
t if t == product => ok(val),
_ => err(throw(&format!(
"{:?} returned a result value that did not satisfy its constraints: {:?}",
func, val
))),
},
Err(failure) => err(failure),
})
.to_boxed()
}
}aloof-angle-91616
11/23/2019, 12:07 AMexterns::call(&externs::val_for(&func.0), &deps)aloof-angle-91616
11/23/2019, 12:07 AMaloof-angle-91616
11/23/2019, 12:08 AMasync def , that means it returns a coroutinealoof-angle-91616
11/23/2019, 12:09 AMSelf::generate() and keep sending it back things until it completesaloof-angle-91616
11/23/2019, 12:10 AMcontext.core.types.generator)hundreds-breakfast-49010
11/23/2019, 12:11 AMhundreds-breakfast-49010
11/23/2019, 12:16 AMdeps is computed from the static argument list of the python in source code, right?aloof-angle-91616
11/23/2019, 12:16 AMhundreds-breakfast-49010
11/23/2019, 12:16 AMaloof-angle-91616
11/23/2019, 12:18 AMaloof-angle-91616
11/23/2019, 12:18 AMaloof-angle-91616
11/23/2019, 12:19 AMhundreds-breakfast-49010
11/23/2019, 12:19 AMhundreds-breakfast-49010
11/23/2019, 12:19 AMaloof-angle-91616
11/23/2019, 12:20 AMhundreds-breakfast-49010
11/23/2019, 12:20 AMWorkunit just like any other typealoof-angle-91616
11/23/2019, 12:20 AMhundreds-breakfast-49010
11/23/2019, 12:20 AMhundreds-breakfast-49010
11/23/2019, 12:21 AMaloof-angle-91616
11/23/2019, 12:21 AMaloof-angle-91616
11/23/2019, 12:22 AMawait Get(Workunit, WorkUnitRequest(name='idk')). i’m aware that’s not what we currently have, but it’s just an ideaaloof-angle-91616
11/23/2019, 12:23 AMhundreds-breakfast-49010
11/23/2019, 12:24 AMaloof-angle-91616
11/23/2019, 12:24 AMhundreds-breakfast-49010
11/23/2019, 12:24 AMaloof-angle-91616
11/23/2019, 12:25 AMaloof-angle-91616
11/23/2019, 12:25 AMaloof-angle-91616
11/23/2019, 12:25 AMhundreds-breakfast-49010
11/23/2019, 12:25 AMrun for the impl Node for NodeKey blockaloof-angle-91616
11/23/2019, 12:25 AMhundreds-breakfast-49010
11/23/2019, 12:25 AMaloof-angle-91616
11/23/2019, 12:26 AMaloof-angle-91616
11/23/2019, 12:26 AMaloof-angle-91616
11/23/2019, 12:26 AMhundreds-breakfast-49010
11/23/2019, 12:27 AMrun impl, we'd need to have access to whatever metadata the rule-writer adds to this "magic" type, whether the rule gets it from a parameter from a Getaloof-angle-91616
11/23/2019, 12:29 AMaloof-angle-91616
11/23/2019, 12:44 AMaloof-angle-91616
11/23/2019, 12:46 AMGet if only because all we seem to need to do is to do this:
let workunit = WorkUnit {
name,
time_span: TimeSpan::since(&start_time),
span_id,
// TODO: set parent_id with the proper value, issue #7969
parent_id: None,
};
context2.session.workunit_store().add_workunit(workunit)aloof-angle-91616
11/23/2019, 12:46 AMhundreds-breakfast-49010
11/23/2019, 12:51 AMhundreds-breakfast-49010
11/23/2019, 12:51 AMaloof-angle-91616
11/23/2019, 12:52 AMhundreds-breakfast-49010
11/23/2019, 12:52 AMaloof-angle-91616
11/23/2019, 12:59 AMhundreds-breakfast-49010
11/23/2019, 1:24 AMaloof-angle-91616
11/23/2019, 1:24 AMhundreds-breakfast-49010
11/23/2019, 1:24 AMhundreds-breakfast-49010
11/23/2019, 1:25 AMaloof-angle-91616
11/25/2019, 2:38 AMaloof-angle-91616
11/25/2019, 2:38 AMaloof-angle-91616
11/25/2019, 2:38 AMaloof-angle-91616
11/25/2019, 2:38 AMaloof-angle-91616
11/25/2019, 3:27 AMaloof-angle-91616
11/25/2019, 3:27 AM./pants test tests/python/pants_test/engine:engine -- -vs -k test_async_reporting continued to passhundreds-breakfast-49010
11/25/2019, 5:51 PM