qtile / qtile

:cookie: A full-featured, hackable tiling window manager written and configured in Python (X11 + Wayland)
http://qtile.org
MIT License
4.83k stars 704 forks source link

Development environment does not get set up correctly #4858

Open bendi-github opened 6 months ago

bendi-github commented 6 months ago

Issue description

Steps to reproduce:

As far as I understand this should have set up my development environment. Expected behavior: The following commands do not fail.

Observed behavior:

(venv) [user@computer qtile]$ ./scripts/ffibuild -v
    Failed!
    This is optional and is needed for: Wayland backend
Traceback (most recent call last):
  File "/home/user/programming/qtile/./libqtile/backend/wayland/cffi/build.py", line 1, in <module>
    import wlroots.ffi_build as wlr
ModuleNotFoundError: No module named 'wlroots'
(venv) [user@computer qtile]$ ./scripts/ffibuild -v
    Failed!
    This is optional and is needed for: Wayland backend
Traceback (most recent call last):
  File "/home/user/programming/qtile/./libqtile/backend/wayland/cffi/build.py", line 1, in <module>
    import wlroots.ffi_build as wlr
ModuleNotFoundError: No module named 'wlroots'

When pywlroots is manually installed pip install pywlroots (in venv), the error changes to

(venv) [user@computer qtile]$ ./scripts/ffibuild -v
    Failed!
    This is optional and is needed for: Wayland backend
Traceback (most recent call last):
  File "/home/user/programming/qtile/./libqtile/backend/wayland/cffi/build.py", line 4, in <module>
    from libqtile.backend.wayland.cffi import cairo_buffer, libinput
ModuleNotFoundError: No module named 'libqtile'

As is evident from my prompt, I am running the scripts from the root directory of the project.

System: Arch Linux x86_64 Wayland compositor: Hyprland Kernel: 6.9.2-arch1-1 System python version: Python 3.12.3 Shell used for testing: bash

[user@computer ~] pacman -Qs "pytest|pre-commit"
local/pre-commit 3.7.1-1
    A framework for managing and maintaining multi-language pre-commit hooks
local/python-pytest 1:8.2.1-1
    Simple powerful testing with Python
local/texlive-binextra 2024.2-2 (texlive)
    TeX Live - TeX auxiliary programs
[user@computer ~] pacman -Qi wlroots
Name            : wlroots
Version         : 0.17.3-1
Description     : Modular Wayland compositor library
Architecture    : x86_64
URL             : https://gitlab.freedesktop.org/wlroots/wlroots
Licenses        : MIT
Groups          : None
Provides        : libwlroots.so=12-64

4225 also seems to have issues with the development environment

Version

N/A

Backend

Wayland (experimental)

Config

No response

Logs

No response

Required

tych0 commented 5 months ago

I think perhaps we could use a requirements-wayland.txt? Or perhaps just a hard coded list in dev.sh.

In terms of missing libqtile... that is strange. I guess virtualenv doesn't add PWD to the PYTHONPATH?

Sydiepus commented 3 months ago

virtualenv doesn't seem to add PWD to PYTHONPATH, I manually export PYTHONPATH to get around missing libqtile

Regarding this issue:

  1. ModuleNotFoundError: No module named 'wlroots':
    • Installing pywlroots in the venv does indeed solve this issue, however another issue will surface later on. (see here)
  2. ModuleNotFoundError: No module named 'libqtile':
    • To solve this error you have to update PYTHONPATH to contain the project root directory. You can do something like this export PYTHONPATH=$(pwd):$PYTHONPATH

Another issue you might encounter is missing headers when compiling the wayland backend, which currently can be solved by installing wlroots0.17 and updating the C and LD flags like so:

export CFLAGS="$CFLAGS -I/usr/include/wlroots0.17"
export LDFLAGS="$LDFLAGS -L/usr/lib/wlroots0.17"

The issue with using pywlroots from the venv is that sometimes it doesn't work and qtile won't start, I am not sure why but I fixed the issue by installing pywlroots from the package manager and creating the venv with --system-site-packages to allow the venv to access system site-packaged dir.

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open 90 days with no activity. Remove the status: stale label or comment, or this will be closed in 30 days.