go-python / gopy

gopy generates a CPython extension module from a go package.
BSD 3-Clause "New" or "Revised" License
2.05k stars 113 forks source link

bind: reduce shared library count from 2 to 1 and use ABI version tagged extension #251

Closed justinfx closed 3 years ago

justinfx commented 3 years ago

This merge replaces the python extension linked against the go shared library with a single python extension module. The extension module is also named using the ABI version tagging reported by the python configuration to avoid clashes with other python minor version builds. Removes need/reference for LD_LIBRARY_PATH modification.

Fixes #249 If merged, replaces the need for #250 since we no longer need RPATH linking between 2 shared libraries.

Open question: I have not added anything in the exe build case and I am not really sure if this should be added.

sbinet commented 3 years ago

as for the exe case, I think @rcoreilly is the one with the best judgement call there :)

rcoreilly commented 3 years ago

The exe directly links in all the go-specific compiled code that would otherwise be in the shared library, so this should not be an issue for that case. As is the case with go programs in general, the go code is statically linked into the executable, so no shared lib of that code to deal with. It still does have to find the Python shared lib, but I guess this doesn't deal with that issue.