Skip to content

Commit

Permalink
fix(core): handle local plugin executors when trying to hash targets (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli committed Nov 27, 2023
1 parent 21e952f commit 7f404ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions packages/nx/src/native/tasks/hash_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)]))
Expand Down
8 changes: 4 additions & 4 deletions packages/nx/src/native/tasks/task_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ impl TaskHasher {
hash_plans: External<HashMap<String, Vec<HashInstruction>>>,
js_env: HashMap<String, String>,
) -> anyhow::Result<NapiDashMap<String, HashDetails>> {
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());

Expand All @@ -103,7 +103,7 @@ impl TaskHasher {

let hashes: NapiDashMap<String, HashDetails> = NapiDashMap::new();

let _ = hash_plans
hash_plans
.iter()
.flat_map(|(task_id, instructions)| {
instructions
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 7f404ad

Please sign in to comment.