Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

cdt function does not respect variant cdt_name #284

Closed
mariusvniekerk opened this issue Jun 8, 2022 · 5 comments · Fixed by #357
Closed

cdt function does not respect variant cdt_name #284

mariusvniekerk opened this issue Jun 8, 2022 · 5 comments · Fixed by #357

Comments

@mariusvniekerk
Copy link
Contributor

When you have a build using a conda_build_config that is say something like

# conda-build-config.yaml
cdt_name:
  - cos7
# recipe.yaml
requirements:
  host:
     - "{{ cdt('numactl-devel') }}"

then boa will false try to use the cos6 version of the cdt and fail in this case since it does not exist.

@Tobias-Fischer
Copy link
Contributor

Hi @wolfv - I am just running into this with RoboStack. Is there any easy workaround that you know of?

@Tobias-Fischer
Copy link
Contributor

Kind reminder @wolfv - just running into this again

@Tobias-Fischer
Copy link
Contributor

See RoboStack/ros-humble#85

@anand-bala
Copy link
Contributor

So, I was debugging the linked issue locally, and it looks like boa doesn't update config (specifically, the field config.variant) with the cdt_name specified in the variant config files passed from the command line. This is needed for (find_all_recipes)[https://github.com/mamba-org/boa/blob/894e05cccf1c99de9e1ef927c6ae52c13a5f336a/boa/core/run_build.py#L502) to resolve the correct core dependencies.

A simple (maybe hack-ish) fix is to update the run_build function as follows (I can open a PR if you'd like):

--- a/boa/core/run_build.py
+++ b/boa/core/run_build.py
@@ -479,6 +479,9 @@ def run_build(args: argparse.Namespace) -> None:
         config.zstd_compression_level = args.zstd_compression_level
 
     cbc, config = get_config(folder, variant, args.variant_config_files, config=config)
+    if config.variant and "cdt_name" in cbc:
+        # HACK: ctd_name is a list
+        config.variant["cdt_name"] = cbc["cdt_name"][0]
 
     if hasattr(args, "output_folder") and args.output_folder:
         config.output_folder = args.output_folder

This solves the issue in RoboStack/ros-humble#85 (when I build locally), but I also noticed another line in the build output:

No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.22
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.22

This seems to imply that none of the variant files are used to update the config before passing it to find_all_recipes.

@Tobias-Fischer
Copy link
Contributor

Hi @anand-bala - great debugging, thanks for that! If you could Open a pull request, that would be amazing. Then @wolfv and others can review/comment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants