use exclusive config instead of variant configs
Otherwise, recipe/conda_build_config.yaml is always overridden.
@@ -106,22 +106,25 @@ def build_all(recipes_dir, arch):
def get_config(arch, channel_urls):
- exclusive_config_file = os.path.join(conda_build.conda_interface.root_dir,
- 'conda_build_config.yaml')
+ exclusive_config_files = [os.path.join(conda_build.conda_interface.root_dir,
+ 'conda_build_config.yaml')]
platform = get_host_platform()
script_dir = os.path.dirname(os.path.realpath(__file__))
- variant_config_files = []
- variant_config_file = os.path.join(script_dir, '{}.yaml'.format(
+ # since variant builds override recipe/conda_build_config.yaml, see
+ # https://github.com/conda/conda-build/blob/3.21.8/conda_build/variants.py#L175-L181
+ # we need to make sure not to use variant_configs here, otherwise
+ # staged-recipes PRs cannot override anything using the recipe-cbc.
+ exclusive_config_file = os.path.join(script_dir, '{}.yaml'.format(
get_config_name(arch)))
- if os.path.exists(variant_config_file):
- variant_config_files.append(variant_config_file)
+ if os.path.exists(exclusive_config_file):
+ exclusive_config_files.append(exclusive_config_file)
error_overlinking = (get_host_platform() != "win")
config = conda_build.api.Config(
- variant_config_files=variant_config_files, arch=arch,
- exclusive_config_file=exclusive_config_file, channel_urls=channel_urls,
- error_overlinking=error_overlinking)
+ arch=arch, exclusive_config_files=exclusive_config_files,
+ channel_urls=channel_urls, error_overlinking=error_overlinking,
+ )
return config
