Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 905743 - x11-wm/qtile: fails to install with sandbox violation (automagic dev-python/pywlroots dep on x11-base/xwayland?) (* ACCESS DENIED: open_wr: /usr/lib/python3.10/site-packages/wlroots/_build.py)
Summary: x11-wm/qtile: fails to install with sandbox violation (automagic dev-python/p...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Egor Martynov
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-05-05 07:50 UTC by Romel Salwi
Modified: 2023-12-03 04:07 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (x11-wm:qtile-0.22.1-r1:20230505-070605.log.gz,2.96 KB, application/gzip)
2023-05-05 07:50 UTC, Romel Salwi
Details
emerge --info from OP (file_905743.txt,7.62 KB, text/plain)
2023-05-05 08:00 UTC, Sam James
Details
Failed during rebuild (x11-wm:qtile-0.22.1-r1:20230506-092738.log,1.80 KB, text/plain)
2023-05-06 09:33 UTC, Romel Salwi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Romel Salwi 2023-05-05 07:50:05 UTC
Created attachment 861168 [details]
build log

While running emerge --verbose --emptytree @world,
Qtile failed to build
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-05 07:51:08 UTC
 * python3_10: running distutils-r1_run_phase python_compile
 *   Building the wheel for qtile-0.22.1 via setuptools.build_meta:__legacy__
gpep517 build-wheel --backend setuptools.build_meta:__legacy__ --output-fd 3 --wheel-dir /var/tmp/portage/x11-wm/qtile-0.22.1-r1/work/qtile-0.22.1-python3_10/wheel
2023-05-05 12:36:10,177 gpep517 INFO Building wheel via backend setuptools.build_meta:__legacy__
/usr/lib/python3.10/site-packages/setuptools/config/setupcfg.py:516: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
  warnings.warn(msg, warning_class)
 * ACCESS DENIED:  open_wr:       /usr/lib/python3.10/site-packages/wlroots/_build.py
Failed to find pulseaudio headers. PulseVolume widget will be unavailable
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.10/gpep517", line 4, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/gpep517/__main__.py", line 406, in main
    return func(args)
  File "/usr/lib/python3.10/site-packages/gpep517/__main__.py", line 202, in build_wheel
    print(build_wheel_impl(args, args.wheel_dir), file=out)
  File "/usr/lib/python3.10/site-packages/gpep517/__main__.py", line 194, in build_wheel_impl
    wheel_name = backend.build_wheel(str(wheel_dir), args.config_json)
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 413, in build_wheel
    return self._build_with_temp_dir(['bdist_wheel'], '.whl',
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 398, in _build_with_temp_dir
    self.run_setup()
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 484, in run_setup
    super(_BuildMetaLegacyBackend,
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
    exec(code, locals())
  File "<string>", line 105, in <module>
  File "<string>", line 89, in get_cffi_modules
  File "/usr/lib/python3.10/site-packages/wlroots/ffi_build.py", line 2643, in <module>
    if has_xwayland():
  File "/usr/lib/python3.10/site-packages/wlroots/ffi_build.py", line 87, in has_xwayland
    with (Path(__file__).parent / "_build.py").open("w") as f:
  File "/usr/lib/python3.10/pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.10/site-packages/wlroots/_build.py'
 * ERROR: x11-wm/qtile-0.22.1-r1::gentoo failed (compile phase):
 *   Wheel build failed
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-05 07:53:10 UTC
I have a feeling that this happens in the following situation:
1. install qtile (which includes pywlroots)
2. install xwayland
3. rebuild qtile (-> pywlroots in the import/config check tries to write to the file saying it has xwayland).

See https://github.com/flacjacket/pywlroots/blob/main/wlroots/ffi_build.py#L86.

It looks like there's two issues then:
1. pywlroots has an automagic xwayland dep? (It seems to affect the files it generates...)
2. It shouldn't ever try to write to its own site-packages dir anyway, just fail gracefully if it's not building itself (check __file__ I guess?)
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-05 08:00:42 UTC
Created attachment 861169 [details]
emerge --info from OP
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-05 08:07:17 UTC
(In reply to Sam James from comment #2)
> I have a feeling that this happens in the following situation:
> 1. install qtile (which includes pywlroots)
> 2. install xwayland
> 3. rebuild qtile (-> pywlroots in the import/config check tries to write to
> the file saying it has xwayland).
> 
> See
> https://github.com/flacjacket/pywlroots/blob/main/wlroots/ffi_build.py#L86.
> 
> It looks like there's two issues then:
> 1. pywlroots has an automagic xwayland dep? (It seems to affect the files it
> generates...)
> 2. It shouldn't ever try to write to its own site-packages dir anyway, just
> fail gracefully if it's not building itself (check __file__ I guess?)

OP confirms emerge -v1 xwayland, emerge -v1 pywlroots, then emerge -v1 qtile is a workaround, so I'm guessing my theory above is right.
Comment 5 Romel Salwi 2023-05-05 08:09:30 UTC
QA: install                                                                                  │
│QA Notice: setuptools warnings detected:                                                     │
│                                                                                             │
│        The license_file parameter is deprecated, use license_files instead.                 │
│Python extension modules (*.so) found installed. Please set:                                 │
│  DISTUTILS_EXT=1                                                                            │
│in the ebuild.
Comment 6 Romel Salwi 2023-05-06 09:33:09 UTC
Created attachment 861214 [details]
Failed during rebuild
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-06 09:36:55 UTC
(In reply to Romel Salwi from comment #6)
> Created attachment 861214 [details]
> Failed during rebuild

Please always include the full build.log as an attachment.
Comment 8 Larry the Git Cow gentoo-dev 2023-07-15 06:07:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc9e844b9ae10e88a2cbc24e3feadb779b0bd904

commit dc9e844b9ae10e88a2cbc24e3feadb779b0bd904
Author:     Egor Martynov <martynovegorOF@yandex.ru>
AuthorDate: 2023-07-14 13:48:31 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-07-15 06:02:59 +0000

    dev-python/pywlroots: depend on xwayland
    
    See https://github.com/gentoo/gentoo/pull/30880#issuecomment-1601992347
    
    Closes: https://bugs.gentoo.org/905743
    Signed-off-by: Egor Martynov <martynovegorOF@yandex.ru>
    Closes: https://github.com/gentoo/gentoo/pull/31879
    Signed-off-by: Sam James <sam@gentoo.org>

 .../{pywlroots-0.15.24-r1.ebuild => pywlroots-0.15.24-r2.ebuild}         | 1 +
 .../pywlroots/{pywlroots-0.16.4.ebuild => pywlroots-0.16.4-r1.ebuild}    | 1 +
 2 files changed, 2 insertions(+)