From 7f404ad72064d50b139f327c728033d6ec2ff8fd Mon Sep 17 00:00:00 2001 From: Jonathan Cammisuli Date: Mon, 27 Nov 2023 18:22:10 -0500 Subject: [PATCH] fix(core): handle local plugin executors when trying to hash targets (#20436) --- packages/nx/src/native/tasks/hash_planner.rs | 8 ++++++-- packages/nx/src/native/tasks/task_hasher.rs | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/nx/src/native/tasks/hash_planner.rs b/packages/nx/src/native/tasks/hash_planner.rs index e4b67fca17..58c4090ac3 100644 --- a/packages/nx/src/native/tasks/hash_planner.rs +++ b/packages/nx/src/native/tasks/hash_planner.rs @@ -138,9 +138,13 @@ impl HashPlanner { .split(':') .next() .expect("Executors should always have a ':'"); - let existing_package = + let Some(existing_package) = find_external_dependency_node_name(executor_package, &external_nodes_keys) - .unwrap_or(executor_package); + else { + // this usually happens because the executor was a local plugin. + // todo)) @Cammisuli: we need to gather the project's inputs and its dep inputs similar to how we do it in `self_and_deps_inputs` + return Ok(None); + }; Ok(Some(vec![HashInstruction::External( existing_package.to_string(), )])) diff --git a/packages/nx/src/native/tasks/task_hasher.rs b/packages/nx/src/native/tasks/task_hasher.rs index 21b337f7af..adf98458b0 100644 --- a/packages/nx/src/native/tasks/task_hasher.rs +++ b/packages/nx/src/native/tasks/task_hasher.rs @@ -82,8 +82,8 @@ impl TaskHasher { hash_plans: External>>, js_env: HashMap, ) -> anyhow::Result> { - debug!("{:?}", hash_plans.as_ref()); - trace!("hash_plans: {}", hash_plans.len()); + debug!("hashing plans {:?}", hash_plans.as_ref()); + trace!("plan length: {}", hash_plans.len()); trace!("all workspace files: {}", self.all_workspace_files.len()); trace!("project_file_map: {}", self.project_file_map.len()); @@ -103,7 +103,7 @@ impl TaskHasher { let hashes: NapiDashMap = NapiDashMap::new(); - let _ = hash_plans + hash_plans .iter() .flat_map(|(task_id, instructions)| { instructions @@ -133,7 +133,7 @@ impl TaskHasher { entry.details.insert(hash_detail.0, hash_detail.1); Ok::<(), anyhow::Error>(()) - }); + })?; hashes.iter_mut().for_each(|mut h| { let hash_details = h.value_mut();