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

convert can't handle conditional track_features: (in onednn-feedstock) #273

Closed
mgorny opened this issue Dec 17, 2024 · 3 comments
Closed
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@mgorny
Copy link

mgorny commented Dec 17, 2024

What happened?
When trying to convert conda-forge/onednn-feedstock@15fa3b7, I'm getting:

$ conda-recipe-manager  convert --debug recipe/meta.yaml  
EXCEPTION: An exception occurred while parsing the recipe file
list index out of range
0 errors and 0 warnings were found.

FWICS, the problem is:

      {% if dnnl_cpu_runtime != "omp" %}
      track_features:
        - onednn-{{ dnnl_cpu_runtime }}
      {% endif %}

https://github.com/conda-forge/onednn-feedstock/blob/15fa3b7a7108feb8eac4a9aee401956911e72580/recipe/meta.yaml#L24-L27

(I'm guessing that because changing it to:

      track_features:
        - onednn-{{ dnnl_cpu_runtime }}  # [dnnl_cpu_runtime != "omp"]

makes the problem go away)

To Reproduce

Steps to reproduce the behavior:

git clone https://github.com/conda-forge/onednn-feedstock
cd onednn-feedstock
git checkout 15fa3b7a7108feb8eac4a9aee401956911e72580
conda-recipe-manager convert recipe/meta.yaml

Additional Details (please complete the following information):

  • OS: Gentoo Linux amd64
  • Conda Recipe Manager version: 0.4.0, also reproduced with e2bf2cb
  • Any other context about the problem that was found.
@mgorny mgorny added bug Something isn't working to sort Needs additional investigation labels Dec 17, 2024
@schuylermartin45 schuylermartin45 added duplicate This issue or pull request already exists and removed to sort Needs additional investigation labels Dec 17, 2024
@schuylermartin45
Copy link
Collaborator

I am going to mark this as a duplicate of #258 and close the issue. But thank you so much for reporting this with such detail! I really appreciate it.

Parsing and handling these conditional and loop macros is a non trivial amount of work, especially given we are trying to move to a format that forbids them entirely. If I wasn't so resource constrained, I might feel differently.

The data I've collected also suggests that there really aren't that many recipes that use these kinds of macros. BUT I'm so glad you used a selector as a work around! I speculate that most of these ifdefs can be manually converted to a selector before running convert faster than it would take to implement full parsing support.

Now that I've said that out loud, maybe there's a hacky work around where we don't fully parse the macros. It'll likely be some nasty regex solution, but that might offer some middle ground solution. I'll make a note in the other ticket.

@mgorny
Copy link
Author

mgorny commented Dec 17, 2024

Ah, sorry, I really should have searched for if 🤦.

@schuylermartin45
Copy link
Collaborator

No worries, happens to me all the time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
Status: Done
Development

No branches or pull requests

2 participants