diff --git a/src/lib.rs b/src/lib.rs index 41112630..b07ccf26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -750,7 +750,7 @@ pub fn sort_build_outputs_topologically( let output_idx = *name_to_index .get(output.name()) .expect("We just inserted it"); - for dep in output.recipe.requirements().all() { + for dep in output.recipe.requirements().run_build_host() { let dep_name = match dep { Dependency::Spec(spec) => spec .name @@ -759,6 +759,7 @@ pub fn sort_build_outputs_topologically( Dependency::PinSubpackage(pin) => pin.pin_value().name.clone(), Dependency::PinCompatible(pin) => pin.pin_value().name.clone(), }; + if let Some(&dep_idx) = name_to_index.get(&dep_name) { // do not point to self (circular dependency) - this can happen with // pin_subpackage in run_exports, for example. diff --git a/src/recipe/parser/requirements.rs b/src/recipe/parser/requirements.rs index acfb4c82..16e9cd8b 100644 --- a/src/recipe/parser/requirements.rs +++ b/src/recipe/parser/requirements.rs @@ -140,12 +140,11 @@ impl Requirements { } /// Get all requirements in one iterator. - pub fn all(&self) -> impl Iterator { + pub fn run_build_host(&self) -> impl Iterator { self.build .iter() .chain(self.host.iter()) .chain(self.run.iter()) - // .chain(self.run_constraints.iter()) } /// Check if all requirements are empty.