Skip to content

Commit

Permalink
restore previous behavior with pin_subpackage treatment
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Sep 2, 2024
1 parent 4e01e50 commit 04bb5d3
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions src/variant_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,22 @@ impl VariantConfig {
normalized_name.to_string().into()
})
}
Dependency::PinSubpackage(pin) => {
Some(pin.pin_value().name.as_normalized().to_string())
}
_ => None,
}
}));

used_vars.extend(
parsed_recipe
.requirements()
.all()
.filter_map(|dep| match dep {
Dependency::PinSubpackage(pin) => {
Some(pin.pin_value().name.as_normalized().to_string())
}
_ => None,
}),
);

let use_keys = &parsed_recipe.build().variant().use_keys;
used_vars.extend(use_keys.iter().cloned());

Expand Down Expand Up @@ -519,10 +528,8 @@ impl VariantConfig {
errs
})?;
let noarch_type = parsed_recipe.build().noarch();
let build_time_requirements = parsed_recipe
.build_time_requirements()
.cloned()
.filter_map(|dep| {
let build_time_requirements =
parsed_recipe.build_time_requirements().filter_map(|dep| {
// here we filter python as a variant and don't take it's passed variants
// when noarch is python
if let Dependency::Spec(spec) = &dep {
Expand All @@ -532,7 +539,7 @@ impl VariantConfig {
}
}
}
Some(dep)
Some(dep.clone())
});
all_build_dependencies.extend(build_time_requirements);
}
Expand Down Expand Up @@ -620,15 +627,19 @@ impl VariantConfig {
})?;

// find the variables that were actually used in the recipe and that count towards the hash
parsed_recipe.build_time_requirements().for_each(|dep| {
if let Dependency::Spec(spec) = dep {
if let Some(name) = &spec.name {
let val = name.as_normalized().to_owned();
used_variables.insert(val);
}
}
});

parsed_recipe
.build_time_requirements()
.requirements()
.all()
.for_each(|dep| match dep {
Dependency::Spec(spec) => {
if let Some(name) = &spec.name {
let val = name.as_normalized().to_owned();
used_variables.insert(val);
}
}
Dependency::PinSubpackage(pin_sub) => {
let pin = pin_sub.pin_value();
let val = pin.name.as_normalized().to_owned();
Expand All @@ -643,6 +654,7 @@ impl VariantConfig {
exact_pins.insert(val);
}
}
_ => {}
});

// actually used vars
Expand Down

0 comments on commit 04bb5d3

Please sign in to comment.