From 464e6b8d9ff5475851378ae8ac54137c9a2b7fbb Mon Sep 17 00:00:00 2001 From: Alexander Koz Date: Sun, 9 Jun 2024 12:15:18 +0400 Subject: [PATCH] fix missed assets for dev target --- cargo/src/assets/plan.rs | 8 ++++---- support/build/src/metadata/source.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cargo/src/assets/plan.rs b/cargo/src/assets/plan.rs index 9388fcee..f8fa9e05 100644 --- a/cargo/src/assets/plan.rs +++ b/cargo/src/assets/plan.rs @@ -96,7 +96,7 @@ pub mod proto { pub targets: BTreeMap>, } - #[derive(Debug, Hash, PartialEq, PartialOrd, Eq, Ord)] + #[derive(Debug, Clone, Copy, Hash, PartialEq, PartialOrd, Eq, Ord)] pub struct Key { pub id: PackageId, pub dev: bool, @@ -209,8 +209,8 @@ pub mod proto { let env = env(dep.package_id(), crate_root)?; + // dep_key is dev only if this it a primary target (root unit) and dev is requested: let with_dev = root_is_dev && dep.package_id() == root.package_id(); - let dep_key = Key::from(dep).with_dev(with_dev); @@ -275,9 +275,9 @@ pub mod proto { // else just build a plan plan_for(&mut plans, &mut indices, dep_key, false)?; - // TODO: it must be norm+dev assets, if dev needed - `with_dev` + // also for dev targets if needed if with_dev { - log::warn!(" TODO: WITH DEV") + plan_for(&mut plans, &mut indices, dep_key, true)?; } } } diff --git a/support/build/src/metadata/source.rs b/support/build/src/metadata/source.rs index 758ab74f..eba54572 100644 --- a/support/build/src/metadata/source.rs +++ b/support/build/src/metadata/source.rs @@ -112,13 +112,13 @@ pub trait PackageSource { if let Some(man) = root.example(target) { Some(base.override_with_extra(man).into_owned()) } else { - log::debug!("target not found: {}", target); + log::debug!("dev-target override not found for {target:?}"); None } } else if let Some(man) = root.bin(target) { Some(base.override_with_extra(man).into_owned()) } else { - log::debug!("target not found: {}", target); + log::debug!("target override not found for {target:?}"); None } } else {