iustin / pyxattr

A python module for accessing filesystem Extended Attributes
https://pyxattr.k1024.org/
GNU Lesser General Public License v2.1
30 stars 15 forks source link

pip install requires Python.h and gcc #33

Closed bengland2 closed 1 year ago

bengland2 commented 2 years ago

pip install requires RHEL8 python3-devel package and gcc before it can install. Is there any way to make it more self-contained (i.e. you can install it without having to compile "C" code)?

What I don't understand: since xattr is basically just making system calls (right?), then why wasn't this functionality part of python's os module? And how does python's os module avoid having to compile "C" code?

iustin commented 2 years ago

pip install requires RHEL8 python3-devel package and gcc before it can install. Is there any way to make it more self-contained (i.e. you can install it without having to compile "C" code)?

No, it's not possible to make it more contained, since the way it is done requires compile-time access to system headers. Or rather, the way the code is written requires it. It could be possible to redo it, but it would be quite expensive as in developer time.

What I don't understand: since xattr is basically just making system calls (right?),

It does library calls, which do system calls themselves. It's not the pure syscall interface, as that's too detailed; the library used abstracts the changes in the syscall interface.

then why wasn't this functionality part of python's os module?

Getting something into os is expensive, and has to be pretty mature. I asked 15 years ago, and people said "only if it gets enough usage".

And how does python's os module avoid having to compile "C" code?

The python library is already compiled. So it doesn't avoid it, but it ships binaries directly.

I could provide binary blobs on pip as well, but since I personally never use the blobs, I didn't think people would prefer them. It's then a matter of whether your libc is compatible with the system I used to built it on, etc.

bengland2 commented 2 years ago

@iustin Thanks for explaining. Easy to ask, hard to do. To be philosophical about it, in a container image it's not really an issue since you can take all this into account when building the image, and the user doesn't have to deal with it to run the app.

But it might be good to point out what packages have to be installed first to pip install pyxattr, might save users some time. I didn't spot this in either the README.md or the pypi page on pyxattr here, had to resort to google.

iustin commented 1 year ago

I’ve just updated the documentation to note this, and closed the issue. Thanks!