Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REGR: conda-build 24.7.1 fails on key in conda_build_config.yaml that's conditionally defined #5443

Closed
h-vetinari opened this issue Aug 6, 2024 · 4 comments
Milestone

Comments

@h-vetinari
Copy link
Contributor

As of conda-build 24.7.1, it became impossible to (re)render the recipe for one of our main compiler feedstocks in conda-forge (as of conda-forge/clang-compiler-activation-feedstock@0bf5cc9) with an error:

  File "E:\miniforge\envs\builder\Lib\site-packages\conda_smithy\configure_feedstock.py", line 885, in _conda_build_api_render_for_smithy
    metadata_tuples = render_recipe(
                      ^^^^^^^^^^^^^^
  File "E:\miniforge\envs\builder\Lib\site-packages\conda_build\render.py", line 994, in render_recipe
    return distribute_variants(
           ^^^^^^^^^^^^^^^^^^^^
  File "E:\miniforge\envs\builder\Lib\site-packages\conda_build\render.py", line 883, in distribute_variants
    mv.parse_until_resolved(
  File "E:\miniforge\envs\builder\Lib\site-packages\conda_build\metadata.py", line 1364, in parse_until_resolved
    self.parse_again(
  File "E:\miniforge\envs\builder\Lib\site-packages\conda_build\metadata.py", line 1273, in parse_again
    self._get_contents(
  File "E:\miniforge\envs\builder\Lib\site-packages\conda_build\metadata.py", line 2020, in _get_contents
    raise CondaBuildUserError(
conda_build.exceptions.CondaBuildUserError: Failed to render jinja template in E:\conda-forge\clang-compiler-activation-feedstock\recipe\meta.yaml:
'CBUILD' is undefined

If I comment out the use of {{ CBUILD }} in meta.yaml, it's possible to render again, so there's some relationship to that particular key. However, renames of that key (+ usage sites) to C_BUILD, CBUILDD, DBUILD, CBALD or cbuild still failed in the same way, so I don't know what particular combination of factors triggers this.

@h-vetinari
Copy link
Contributor Author

As it turns out, this could be solved by

{% if CBUILD is not defined %}
{% set CBUILD = "dummy" %}
{% endif %}

That's still weird because CBUILD should be specified for all relevant platforms (and it wasn't necessary before).

@jakirkham
Copy link
Member

Think this would be addressed by PR: #5458

@h-vetinari
Copy link
Contributor Author

Thanks @jakirkham, that sounds like exactly the same problem indeed

@h-vetinari h-vetinari mentioned this issue Aug 21, 2024
55 tasks
@h-vetinari h-vetinari changed the title REGR: conda-build 24.7.1 fails on key in conda_build_config.yaml containing BUILD REGR: conda-build 24.7.1 fails on key in conda_build_config.yaml that's conditionally defined Aug 21, 2024
@beeankha beeankha added this to the 24.7.x milestone Aug 22, 2024
@beeankha beeankha modified the milestones: 24.7.x, 24.9.x Sep 10, 2024
@beeankha
Copy link
Contributor

Closing this issue since #5458 has been merged! This change will be included in the upcoming 24.9.x release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏁 Done
Development

No branches or pull requests

3 participants