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

Feature fqdn entrypoint #1610

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

tito
Copy link
Contributor

@tito tito commented Feb 21, 2017

This add a new option that allow changing the name of the python init symbol in order to bundle a bunch of cythonized python files into a single .so.

I explained the usage of this feature in the Initial post about it https://groups.google.com/forum/#!topic/cython-users/ZVrDYHAnMi8

To resume, this prevent the conflict between the same init name symbol between multiple cythonized files, when thoses files are within a single library (on android), or statically included into the final binary (on iOS, mandatory as dlopen is prohibed).

The option is named use_fqdn_entrypoint, default to False, and is handled as a compiler directive.

If i have a file at kivy/graphics/opengl.pyx, without the option, the entrypoint would be initopengl. With the option activated, it would be initkivy_graphics_opengl. Obviously a custom Python meta-importer is required, but it's up to the user to write it.

tito added 2 commits May 30, 2016 23:59
…ypoint that has the full qualified name instead of just the module name. This allow the developer to gather multiple .c into one single extension, and use a custom import mechanism to access all embedded modules.
@robertwb
Copy link
Contributor

I'd like to have a more principled approach to bundling modules into a single so (or executable), complete with injecting the right import hooks, but that'd take longer to design. As this is a blocker for some platforms, I'm willing to consider this intermediate suggestion.

The name "use_fqdn_entrypoint" isn't very suggestive to me. Perhaps, as it's specified as a directive, let the user choose the full name itself (e.g. initmodule_cname=XXX) I would be open to sentinel values that indicate that the module name or fully qualified module name should be used.

Also, tests?

@scoder
Copy link
Contributor

scoder commented Sep 1, 2017

PEP 489 has a section about multiple modules in one shared library. Since Cython now has support for PEP 489 module initialisation, we should build on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants