diff --git a/conda_build/metadata.py b/conda_build/metadata.py index 0109f87686..60922b438c 100644 --- a/conda_build/metadata.py +++ b/conda_build/metadata.py @@ -2641,14 +2641,11 @@ def get_loop_vars(self): return variants.get_vars(_variants, loop_only=True) def get_used_loop_vars(self, force_top_level=False, force_global=False): - loop_vars = set(self.get_loop_vars()) - return { - var - for var in self.get_used_vars( - force_top_level=force_top_level, force_global=force_global - ) - if var in loop_vars - } + loop_vars = self.get_loop_vars() + used_vars = self.get_used_vars( + force_top_level=force_top_level, force_global=force_global + ) + return set(loop_vars).intersection(used_vars) def get_rendered_recipe_text( self, permit_undefined_jinja=False, extract_pattern=None diff --git a/conda_build/variants.py b/conda_build/variants.py index 593d44e694..076309fa4c 100644 --- a/conda_build/variants.py +++ b/conda_build/variants.py @@ -698,8 +698,12 @@ def get_vars(variants, loop_only=False): """For purposes of naming/identifying, provide a way of identifying which variables contribute to the matrix dimensionality""" first_variant, *other_variants = variants - special_keys = {"pin_run_as_build", "zip_keys", "ignore_version"} - special_keys.update(set(ensure_list(first_variant.get("extend_keys")))) + special_keys = { + "pin_run_as_build", + "zip_keys", + "ignore_version", + *ensure_list(first_variant.get("extend_keys")), + } loop_vars = [ k for k, v in first_variant.items()