pyd icon indicating copy to clipboard operation
pyd copied to clipboard

dub support doesn't work for extensions

Open John-Colvin opened this issue 10 years ago • 3 comments

I get ImportError: dynamic module does not define init function

John-Colvin avatar Jun 30 '15 12:06 John-Colvin

cf D-Programming-Language/dub#571

ariovistus avatar Jul 05 '15 21:07 ariovistus

Yes, that does prevent a pyd extension being a dependency in dub, but that isn't the important usa-case really. What is more important is being able to build the extension itself as the main/root dub package. Dub has no problem with shared libraries in that setup.

John-Colvin avatar Jul 06 '15 07:07 John-Colvin

pyd has a little template file in infrastructure/d/pydmain_template.d looks like it just inserts the project name in some syntactically goofy places. is there anything in dub that can do the equivalent?

More important is the so_ctor.c file, which starts up druntime when the extension loads, etc. Don't know if we still need this, but assuming we do, can dub compile c files or does dmd have attribute((constructor)) type functionality now?

ariovistus avatar Jul 06 '15 23:07 ariovistus