~atha/newm-atha#15: 
pywm build fail (importlib_metadata version?)

Hello,

I'm posting this here, because I couldn't find how to create an issue on pywm's repo... I didn't know sourcehut until now.

I ran into this compilation error when trying to build pywm-atha using my system-wide Python env:

  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      Traceback (most recent call last):
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-jm3m32tu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-jm3m32tu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-jm3m32tu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-jm3m32tu/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 9, in <module>
      Exception: Fatal: Error executing 'meson build':
      b''
      b'Traceback (most recent call last):\n  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 397, in from_name\n    return next(cls.discover(name=name))\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nStopIteration\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/usr/bin/meson", line 33, in <module>\n    sys.exit(load_entry_point(\'meson==1.3.0\', \'console_scripts\', \'meson\')())\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/usr/bin/meson", line 22, in importlib_load_entry_point\n    for entry_point in distribution(dist_name).entry_points\n                       ^^^^^^^^^^^^^^^^^^^^^^^\n  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 861, in distribution\n    return Distribution.from_name(distribution_name)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 399, in from_name\n    raise PackageNotFoundError(name)\nimportlib.metadata.PackageNotFoundError: No package metadata was found for meson\n'
      [end of output]

What is weird is that I managed to build successfully from an isolated (using --isolated) virtual env, but I don't think it's a good idea for a Wayland compositor to sit in a pyvenv. From what I've seen online, it looks like a recent bug introduced by the importlib_metadata package, but I'm not familiar enough with meson and Python packages to bring constructive help other than the issues I've found: https://github.com/facebookresearch/fairseq/issues/2546 https://github.com/Nuitka/Nuitka/issues/1793

Also, Void Linux's package manager manages the Python environment, so Python packages are installed through it rather than pip, so I guess the error I ran into came from a difference in importlib versions between XBPS's repo and pip's repo.

Other than that I must say I love newm, as far as I've tested it it seems great for laptop use. So thank you for maintaining it!

Goodbye, R. GAY

Status
RESOLVED CLOSED
Submitter
~rgay
Assigned to
No-one
Submitted
1 year, 1 month ago
Updated
8 months ago
Labels
No labels applied.

~rgay 1 year, 1 month ago

Actually it seems to come from my version of pip, so likely nothing to do with precisely newm or pywm. Sorry for the useless ticket!

~atha REPORTED CLOSED 1 year, 18 days ago

~cben 8 months ago*

I've also hit it. Running meson build && ninja -C build myself works, but pip3 install --user -e . --verbose fails on running meson build. The difference probably relates to outer pip setting some env vars pointing to an isolated tmp dir:

PATH=/tmp/pip-build-env-lbs34_we/overlay/bin:/tmp/pip-build-env-lbs34_we/normal/bin:/usr/sbin:/home/beni/.krew/bin:/home/beni/.cargo/bin:/home/beni/myenv/goenv/shims:/home/beni/.local/bin:/home/beni/myenv/rbenv/shims:/home/beni/myenv/node_modules/.bin:/home/beni/myenv/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
PEP517_BUILD_BACKEND=setuptools.build_meta:__legacy__
PIP_BUILD_TRACKER=/tmp/pip-build-tracker-rehl544j
PYTHONNOUSERSITE=1
PYTHONPATH=/tmp/pip-build-env-lbs34_we/site
  • Some googling suggested this happens when using system meson and pip-installed meson would be better. But at least with pip3 install --user meson it was even worse because PYTHONNOUSERSITE=1 interferes with accesing --user installed tools.
  • Workaround: I commented out the invocation of meson build in setup.py since I already run it myself and got a build/ dir. After that, the install worked!
Register here or Log in to comment, or comment via email.