WIP: update Python easyblock to use custom ctypes for shared libraries#3798
WIP: update Python easyblock to use custom ctypes for shared libraries#3798dagonzalezfo wants to merge 4 commits intoeasybuilders:developfrom
Conversation
|
@casparvl Can you help shepherd this contribution? |
|
Hi, as a way to fix the reported issue about system provided libs (reported here: https://gitlab.com/eessi/support/-/issues/154#note_2586123208) However, I did not manage to make it work. I try to fix it by using Alternatives:
I would really appreaciate any help/opinion Best, Danilo |
|
@dagonzalezfo so the key problem here is that using a regular expression to replace one regular expression by another is a pain? Who would have thought ;-) I know that we conventionally use I'm also trying to understand what fundamentally goes wrong here What were you trying to do/run? I see that this file is actually not a shared library: But the same is true for a regular But something must be calling it with the assumption that it is an ELF file? |
easybuild/easyblocks/p/python.py
Outdated
| orig_support_marker=r'if _sys.platform.startswith\(\"aix\"\):' | ||
| updated_support_marker=""" | ||
| if _os.name == "posix": | ||
| if name and name.endswith(".so"): |
There was a problem hiding this comment.
This may be too strict. E.g. someone might try to load a versioned library, e.g. libSDL2-2.0.so.0. That still fails, because we never enter this 'if'.
What case are you really trying to exclude here?
I did notice that I couldn't really find a find_library call that would work for libSDL2-2.0 either (e.g. python -c "import ctypes; print(ctypes.util.find_library('SDL2-2.0'))" returns None), maybe that's the case you were trying to exclude?
There was a problem hiding this comment.
The code should mimic this behaviour:
LD_LIBRARY_PATH=$LIBRARY_PATH python -c "import ctypes; print(ctypes.CDLL('libSDL2-2.0.so.0'))"
dagonzalezfo
left a comment
There was a problem hiding this comment.
Go back to the patch that should cover the usecases mentioned in the eeesi ticket.
At the end any call should return a fullpath that can be loaded by dlopen
|
Writing down some more things to help me understand what's going on, after some of it became clearer in a call today with @dagonzalezfo . We need to make sure that libraries from both the
Again, this is wrapped in a This, however, was not enough, because if someone calls What's needed in order to make that work, is that if I see two options:
The previous patch, strictly speaking, altered the documented behavior of In order to call where name is the so-name (i.e. without lib, and without where fullname is e.g. The safest way to implement this is probably to just add this as possible search method(s) to And then implement I think with that, we can remove the regular expressions that are currently needed to strip the |
|
Changes implemented easybuilders/easybuild-easyconfigs#23499 |
This was first exposed as a patch on easybuilders/easybuild-easyconfigs#23042
After reviewing it, @casparvl suggested that this should be integrated into the easyblock.