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
I searched open reports and couldn't find a duplicate
What happened?
Because of the regex used by conda-build, selectors will be detected in locations where users would likely not expect them to be.
Some examples:
package:
name: exampleversion: 1.0.0test:
commands:
- echo "An example of slicing an array is arr[1:None]neat right!"
(combining these last two lines or adding a comma results in a working recipe)
and
package:
name: exampleversion: 1.0.0test:
commands:
- echo "I told #user to slice the array with array[1:None] which worked"
Both of these recipes will fail to build because the selector is invalid:
CondaBuildUserError: Invalid selector in meta.yaml line 6:
offending selector:
[1:None]
exception:
SyntaxError: invalid syntax (<string>, line 1)
For clarity a selector will be detected on any line where
There are a pair of brackets [...] at the end of the line (after removing whitespace).
There are a pair of brackets [...] after a comment #.
I suspect this issue has been in conda-build for so long that is cannot be nicely addressed without breaking backwards compatibility. I would be happy to see this issue marked as wont-fix.
Similar issues have been reported in the past but are now closed. For example #4654.
Conda Info
active environment : base
active env location : /opt/conda
shell level : 1
user config file : /root/.condarc
populated config files :
conda version : 24.7.1
conda-build version : 24.7.1
python version : 3.12.4.final.0
solver : libmamba (default)
virtual packages : __archspec=1=x86_64
__conda=24.7.1=0
__glibc=2.36=0
__linux=6.6.16=0
__unix=0=0
base environment : /opt/conda (writable)
conda av data dir : /opt/conda/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /opt/conda/pkgs
/root/.conda/pkgs
envs directories : /opt/conda/envs
/root/.conda/envs
platform : linux-64
user-agent : conda/24.7.1 requests/2.32.2 CPython/3.12.4 Linux/6.6.16-linuxkit debian/12.5 glibc/2.36 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8 aau/0.4.4 c/. s/. e/.
UID:GID : 0:0
netrc file : None
I saw this error in the about/description section of the meta.yaml, where inside the string was a substring [repack of MINGW-packages libidn2 for UCRT64]. conda-build thinks that it's a selector, not a part of the YAML string.
It can be fixed manually by replacing square brackets with round brackets. But yeah, it's a conda-build bug.
Checklist
What happened?
Because of the regex used by conda-build, selectors will be detected in locations where users would likely not expect them to be.
Some examples:
(combining these last two lines or adding a comma results in a working recipe)
and
Both of these recipes will fail to build because the selector is invalid:
For clarity a selector will be detected on any line where
[...]
at the end of the line (after removing whitespace).[...]
after a comment#
.I suspect this issue has been in conda-build for so long that is cannot be nicely addressed without breaking backwards compatibility. I would be happy to see this issue marked as wont-fix.
Similar issues have been reported in the past but are now closed. For example #4654.
Conda Info
Conda Config
Conda list
Additional Context
No response
The text was updated successfully, but these errors were encountered: