easybuilders / easybuild-framework

EasyBuild is a software installation framework in Python that allows you to install software in a structured and robust way.
https://easybuild.io
GNU General Public License v2.0
147 stars 200 forks source link

Patches do not accept a dictionary as patch #3980

Open mustafabar opened 2 years ago

mustafabar commented 2 years ago

In the online documentation of EB, it is mentioned that a patch can be "as string, tuple or dictionary", whereas if a dictionary is provided as a patch, the build crashes with the following error <function to_list_of_strings_and_tuples at 0x7fb089952268> failed: "Expected elements to be of type string, tuple or list" got {...} (<class 'dict'>)".

If no dictionary is allowed, there is no way one can reach other properties such as srcind, unless by creating a new easyblock and overriding the "patch_step", which is a bit of an overkill.

boegel commented 2 years ago

@mustafabar Do you have an example of a patch spec that's a dictionary?

ocaisa commented 2 years ago

@mustafabar Coincidentally I fix this in #3994 since I need to be able to use a dictonary to describe a patch there. However the list of valid keys (including my change) is ['name', 'copy', 'level', 'sourcepath', 'alt_location'] (i.e., no srcind). In fact I can't even find anywhere that adds source to the patch dict (srcind is set at https://github.com/easybuilders/easybuild-framework/blob/develop/easybuild/framework/easyblock.py#L2438). I could add support for it in my PR but I just need to understand the use case first (and also get a hint from @boegel whether I need to be careful there)