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

Building Python 2 packages with Meson might fail #167216

Closed
jtojnar opened this issue Apr 4, 2022 · 4 comments
Closed

Building Python 2 packages with Meson might fail #167216

jtojnar opened this issue Apr 4, 2022 · 4 comments
Labels
0.kind: bug Something is broken

Comments

@jtojnar
Copy link
Member

jtojnar commented Apr 4, 2022

Currently, python2.pkgs.pycairo, which is transitively depended on by GIMP, is failing on staging-next due to Meson crashing in configure step:

Traceback (most recent call last):
  File "/nix/store/xp66zc4w184hwipy6zljah1mzk7dprqg-meson-0.61.2/bin/meson", line 6, in <module>
    from mesonbuild.mesonmain import main
  File "/nix/store/xp66zc4w184hwipy6zljah1mzk7dprqg-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 27, in <module>
    from . import mesonlib
  File "/nix/store/xp66zc4w184hwipy6zljah1mzk7dprqg-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/mesonlib/__init__.py", line 21, in <module>
    from .universal import *
  File "/nix/store/xp66zc4w184hwipy6zljah1mzk7dprqg-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/mesonlib/universal.py", line 28, in <module>
    import typing as T
  File "/nix/store/sgk7zd1sqax5gh9avijwp3k7h8451b1g-python2.7-typing-3.10.0.0/lib/python2.7/site-packages/typing.py", line 782, in <module>
    AnyStr = TypeVar('AnyStr', bytes, unicode)
NameError: name 'unicode' is not defined

https://hydra.nixos.org/build/171372612/nixlog/31

It appears that Meson (a Python 3 app) is picking up python2.pkgs.typing from a transitive dependency in checkInputs (likely introduced in 58f6365), and we were just lucky that we did not encounter this sooner (thanks to Meson being largely self-contained).

cc @jonringer @FRidh

@jtojnar jtojnar added the 0.kind: bug Something is broken label Apr 4, 2022
@jtojnar
Copy link
Member Author

jtojnar commented Apr 4, 2022

Not really sure how to fix it, other than by wrapping Meson with --set PYTHONPATH "". That might break third party meson modules, thought I do not think we have any packaged.

@yu-re-ka
Copy link
Contributor

yu-re-ka commented Apr 4, 2022

Or maybe keep an old version of meson around that is itself using python 2?

@jtojnar
Copy link
Member Author

jtojnar commented Apr 4, 2022

I do not think there was a Python 2 version. And even if there were, it would be so ancient that it could not be used to build any ~current project.

@FRidh
Copy link
Member

FRidh commented Apr 4, 2022

This was bound to happen sometime. It's surprising really we did not see this any sooner with meson though. It's this issue #118452.

Workaround in 4f30fc6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants