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

wlroots/_build.py is installed/packaged only if no existing version is installed #132

Open
mgorny opened this issue Dec 3, 2023 · 1 comment

Comments

@mgorny
Copy link

mgorny commented Dec 3, 2023

try:
return importlib.import_module("wlroots._build").has_xwayland
except ModuleNotFoundError:
pass

This code means that the function won't be executed if wlroots._build can be imported from anywhere, including the previous version installed to the system. So if pywlroots are installed, the following bit won't ever be executed:

with (Path(__file__).parent / "_build.py").open("w") as f:
f.write(f"has_xwayland = {has_xwayland}\n")

and the newly created wheel (or install to --root) won't contain the file. As a result, the Gentoo ebuild produces an install without the file every second run; which in turns breaks building qtile.

Downstream bug report: https://bugs.gentoo.org/919097

@mgorny
Copy link
Author

mgorny commented Dec 5, 2023

Upon further investigation, this cache logic can't ever work properly!

Even if wlroots/_build.py exists in the source, wlroots._build cannot be imported because wlroots requires wlroots._ffi that doesn't exist yet!

 python3.11 -c 'import wlroots._build'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/portage/dev-python/pywlroots-0.16.6-r2/work/pywlroots-0.16.6/wlroots/__init__.py", line 8, in <module>
    from ._ffi import ffi, lib
ModuleNotFoundError: No module named 'wlroots._ffi'

So the only case when "caching" works is when it wrongly imports the earlier version…

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

1 participant