P3DModuleBuilder icon indicating copy to clipboard operation
P3DModuleBuilder copied to clipboard

fix panda3d.lui.__name__

Open pmp-p opened this issue 7 years ago • 5 comments

interrogate_module.cpp should contains :

PyObject *module = Dtool_PyModuleInitHelper(defs, "panda3d.lui");

actually is:

PyObject *module = Dtool_PyModuleInitHelper(defs, "lui");

pmp-p avatar Feb 22 '18 05:02 pmp-p

Hm, I don't think this works since the module builder is also used for other modules besides of LUI, so that this would break them. I believe there should be an option to add the panda3d prefix? So that modules which are supposed to be added to the panda3d installation have that prefix, and others don't

tobspr avatar Feb 22 '18 18:02 tobspr

maybe add a flag then, at least for LUI case ? i am currently modifying the cmake script to handle standalone python 3.7 and panda3d on android 4.4 ( linux cross build passed) i am about to test functionnality so not a problem to add specific force module name from env.

pmp-p avatar Feb 23 '18 20:02 pmp-p

Okay, so it seems this is android specifc? Or does this also affect windows / linux builds? Should the prefix appear on all platforms?

tobspr avatar Feb 24 '18 09:02 tobspr

i think the .__name__ of a module should be defined by an env e.g. "MODULE_FQN" for all platforms. the lui case is straightforward : as panda3d.core.__name__ == 'panda3d.core'

it should be settable so we'll have panda3d.lui.__name__ == 'panda3d.lui'

Actually P3DModuleBuilder can't do that.

and to comply with multi_lib specs of py3 you should allow an override of the soname ( because autodetect from python host could lead to arch triple error when cross compiling ) so you get for example : lui.cpython-34m-x86_64-linux-gnu.so

pmp-p avatar Feb 25 '18 09:02 pmp-p

Wouldn't it be better to make the module builder automatically prefix "panda3d." when it detects that this is required? I'd prefer if this could happen automatically instead of having to set an environment variable.

How would you like to be able to override the name of the generated binary? Maybe with a pattern string? E.g. output_name=%module%-%pythonver%-%platform%.so?

tobspr avatar Feb 26 '18 12:02 tobspr