You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently have encountered the following bug when re-rendering with conda-smithy depending on the conda-build version used. This is very likely is a conda-build bug. However conda-build itself does not encounter the issue when building recipes. So it could be how conda-smithy and conda-build interact, which causes the issue
The core of the bug is involves Jinja variables that are conditionally defined (meaning there are cases where they are undefined). Previously if a Jinja variable would be undefined for a certain condition (like an OS), this was not an issue if that condition was skipped. However now the conditionally defined variable is a problem even in case where it is never used
Take this recipe (a boiled down example to show the core bug), version here is conditionally defined. It will only be defined on linux. Otherwise version is undefined. Previously the top-level skip, which limited the build to linux, would have been sufficient to ensure version was defined for the relevant condition. So the version would have been defined anywhere this recipe would build
{% set version = "1" %} # [linux]package:
name: undef_jinja_tst# Fails with conda-build 24.7 (works for conda-build 24.5)version: {{ version }}# Passes with conda-build 24.7#version: {{ version }} # [linux]build:
skip: true # [not linux]test:
commands:
- exit 0
Also when re-rendering this recipe using conda-build version 24.5, this would work ok. However starting with conda-build version 24.7, the following recipe fails to re-render
To workaround this with conda-build version 24.7, it seems one needs to do one of the following:
Add more version definitions for other conditions until it passes (so osx, win, etc.)
Define a fallback for version: Adding this to line 2 {% set version = version|default("") %}
Add selectors to all lines that use version (shown above)
Ideally none of this would be needed. However it appears something has changed about how conda-build renders recipes and where conda-smithy interacts with that rendering functionality. As a result this now produces errors for conditions the recipe cannot actually be built for anyways (because of the skip)
Recently have encountered the following bug when re-rendering with conda-smithy depending on the conda-build version used. This is very likely is a conda-build bug. However conda-build itself does not encounter the issue when building recipes. So it could be how conda-smithy and conda-build interact, which causes the issue
The core of the bug is involves Jinja variables that are conditionally defined (meaning there are cases where they are
undefined
). Previously if a Jinja variable would beundefined
for a certain condition (like an OS), this was not an issue if that condition wasskip
ped. However now the conditionally defined variable is a problem even in case where it is never usedTake this recipe (a boiled down example to show the core bug),
version
here is conditionally defined. It will only be defined onlinux
. Otherwiseversion
isundefined
. Previously the top-levelskip
, which limited the build tolinux
, would have been sufficient to ensureversion
was defined for the relevant condition. So theversion
would have been defined anywhere this recipe would buildAlso when re-rendering this recipe using
conda-build
version24.5
, this would work ok. However starting withconda-build
version24.7
, the following recipe fails to re-renderTo workaround this with
conda-build
version24.7
, it seems one needs to do one of the following:version
definitions for other conditions until it passes (soosx
,win
, etc.)version
: Adding this to line 2{% set version = version|default("") %}
version
(shown above)Ideally none of this would be needed. However it appears something has changed about how conda-build renders recipes and where conda-smithy interacts with that rendering functionality. As a result this now produces errors for conditions the recipe cannot actually be built for anyways (because of the
skip
)Edit - Also surfaced this upstream: conda/conda#13995 (comment)
The text was updated successfully, but these errors were encountered: