gdabah / distorm

Powerful Disassembler Library For x86/AMD64
Other
1.26k stars 238 forks source link

extension should be in sitearch not in sitelib #124

Closed mcepl closed 4 years ago

mcepl commented 6 years ago

On platforms where it is distinguished distorm binary extension libdistorm3.so should be installed in sitearch disrectories (e.g., /usr/lib64/python*/site-packages/ on most Linuces), not sitelib ones which are for platform-independent libraries (e.g., /usr/lib/python*/site-packages/).

I was hoping to provide a patch to setup.py (one obvious error is that you use libraries instead ext_modules for installation the extension library), but it is too complicated and it would be better to left to you.

gdabah commented 6 years ago

@mcepl Can you explain please where it really matters? First time I'm hearing of this, though I'm not up to date on the matter.

mcepl commented 6 years ago

It is a strict policy for all Unix/Linux installations to keep arch-independent and arch-dependent modules separated.

There are many reasons for that. For starters, many current Linux distributions (e.g., RHEL/Fedora, SLES/openSUSE, and Ubuntu/Debian) are able to start both 64-bit and 32-bit Intel programs on the same system, which is very important, because many commercial and proprietary programs are still 32-bit-only.

Also, in the more complicated situations it is even possible to setup system, where it is possible to start programs for multiple different architectures from one shared drive (either over remote terminals, or shared over LAN).

gdabah commented 6 years ago

@mcepl Gotcha now. So you mentioned I need to use ext_modules for this and it will do it automatically? Any good references? I hate distutils to be honest, it's getting more and more complicated.

gdabah commented 5 years ago

@mcepl I committed some change to the setup.cfg file, not sure if it works since I don't have a linux box to check it out.

gdabah commented 5 years ago

Actually that won't work, so I reverted it, I'm afraid it will require writing some extra code for that logic for detecting the linux arch and the python arch, and if distutils doesn't do it automatically I will skip this myself.

mcepl commented 5 years ago

Wouldn't just packages field without any other ones be enough?

“Good artists copy; great artists steal” … take a look for example at https://github.com/lxml/lxml/blob/master/setup.py

gdabah commented 5 years ago

You still need logic of detecting the python arch and the linux arch, no? Am I missing anything?

gdabah commented 4 years ago

@mcepl This should be fixed with latest changes we had on setup.py.