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

Importing wlroots.ffi_build from system installation fails #76

Closed
m-col opened this issue Feb 13, 2022 · 2 comments
Closed

Importing wlroots.ffi_build from system installation fails #76

m-col opened this issue Feb 13, 2022 · 2 comments

Comments

@m-col
Copy link
Collaborator

m-col commented Feb 13, 2022

It seems the ffi.verify() call wants write access to neighbouring files, and so importing wlroots.ffi_build raises a PermissionError when a user does not havewrite permissions to /usr/lib. This is the stack trace:

>>> import wlroots.ffi_build
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/wlroots/ffi_build.py", line 2408, in <module>
    check_version()
  File "/usr/lib/python3.10/site-packages/wlroots/ffi_build.py", line 44, in check_version
    wlroots_version = load_wlroots_version()
  File "/usr/lib/python3.10/site-packages/wlroots/ffi_build.py", line 36, in load_wlroots_version
    lib = ffi.verify("#include <wlr/version.h>")
  File "/usr/lib/python3.10/site-packages/cffi/api.py", line 468, in verify
    lib = self.verifier.load_library()
  File "/usr/lib/python3.10/site-packages/cffi/verifier.py", line 104, in load_library
    self._write_source()
  File "/usr/lib/python3.10/site-packages/cffi/verifier.py", line 193, in _write_source
    with open(self.sourcefilename, "w") as fp:
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.10/site-packages/wlroots/__pycache__/_cffi__x58fcf130xd9c61baf.c'

This is coming from the check_version(). Perhaps we can have some kind of flag to disable the check? The use-case here is not building pywlroots per se, but building another CFFI module that depends on it.

@flacjacket
Copy link
Owner

Thanks for the report here. I just pushed a change that should let us skip the check if that error is hit.

@m-col
Copy link
Collaborator Author

m-col commented Feb 13, 2022

Brilliant, thanks!

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

No branches or pull requests

2 participants