Open ktbarrett opened 3 years ago
Cannot work around this either since I can't seem to access kernel32?
Patch for find_library
is here. It doesn't seem to take LD_LIBRARY_PATH
into account? And it only considers investigating import libraries, returning their linked dynamic library instead of a file path. It doesn't seem like it was implemented correctly when compared against the documentation.
Here is the upstream patch: https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/python38.git;a=blob;f=3.7-ctypes-cygwin.patch;h=62e360cb4bced797afe8ea80d1524b4d38892e49;hb=HEAD
I guess the thing is that we have sys.platform == "msys", so we should adjust that patch. Can you try changing that file on your machine to check for "msys" there and see if it helps?
As installed I see the check is elif sys.platform in ["cygwin", "msys"]:
Not sure where that is coming from, it's not upstream. And the observed behavior follows the patch (same as what you posted as well), which is what doesn't seem correct.
ah, then there is probably another patch on top of that somewhere.
Should I take this issue upstream? Or should I replace the cygwin patch with something more correct? In the meantime is there an alternative way to get the full path to a library? If I had access to kernel32, I could use GetModuleFileName
to get the file path.
I tried using dladdr
to get the filename, with no luck. I don't think there is a way to solve this until the original patch is updated to also search for DLLs. I'll work on that soon.
Describe the issue
Attempting to get the path to the libpython, I try the following:
This seems a bit off...
find_library
doesn't seem to be doing anything useful here.On Linux, Mac, Windows, and MinGW environments it returns the full path to the library, if found.
Steps to Reproduce the Problem