JoseExposito/touche

Unhandled python exception

yochananmarqos opened this issue · 5 comments

Describe the bug

Fails to build while executing subproject libtouche:

Logs

build log
Executing subproject libtouche 

libtouche| Project name: libtouche
libtouche| Project version: 2.0.0
libtouche| C++ compiler for the host machine: c++ (gcc 13.2.1 "c++ (GCC) 13.2.1 20230801")
libtouche| C++ linker for the host machine: c++ ld.bfd 2.41.0
libtouche| Found pkg-config: /usr/bin/pkg-config (1.8.1)
libtouche| Run-time dependency glib-2.0 found: YES 2.76.4
libtouche| Run-time dependency gobject-2.0 found: YES 2.76.4
libtouche| Run-time dependency x11 found: YES 1.8.6
libtouche| Run-time dependency gobject-introspection-1.0 found: YES 1.76.1
libtouche| Dependency gobject-introspection-1.0 found: YES 1.76.1 (cached)
libtouche| Program g-ir-scanner found: YES (/usr/bin/g-ir-scanner)
libtouche| Dependency gobject-introspection-1.0 found: YES 1.76.1 (cached)
libtouche| Program g-ir-compiler found: YES (/usr/bin/g-ir-compiler)
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py", line 194, in run
    return options.run_func(options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/msetup.py", line 358, in run
    app.generate()
  File "/usr/lib/python3.11/site-packages/mesonbuild/msetup.py", line 183, in generate
    return self._generate(env, capture, vslite_ctx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/msetup.py", line 228, in _generate
    intr.run()
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreter/interpreter.py", line 2997, in run
    super().run()
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 164, in run
    self.evaluate_codeblock(self.ast, start=1)
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 190, in evaluate_codeblock
    raise e
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 182, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 196, in evaluate_statement
    return self.function_call(cur)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 521, in function_call
    res = func(node, func_args, kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/decorators.py", line 277, in wrapper
    return f(*nargs, **wrapped_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/decorators.py", line 596, in wrapper
    return f(*wrapped_args, **wrapped_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreter/interpreter.py", line 878, in func_subproject
    return self.do_subproject(args[0], 'meson', kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreter/interpreter.py", line 959, in do_subproject
    raise e
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreter/interpreter.py", line 943, in do_subproject
    return self._do_subproject_meson(subp_name, subdir, default_options, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreter/interpreter.py", line 986, in _do_subproject_meson
    subi.run()
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreter/interpreter.py", line 2997, in run
    super().run()
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 164, in run
    self.evaluate_codeblock(self.ast, start=1)
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 190, in evaluate_codeblock
    raise e
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 182, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 200, in evaluate_statement
    return self.method_call(cur)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 550, in method_call
    res = obj.method_call(method_name, args, kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreter/interpreterobjects.py", line 811, in method_call
    ret = method(state, args, kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/decorators.py", line 277, in wrapper
    return f(*nargs, **wrapped_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/interpreterbase/decorators.py", line 596, in wrapper
    return f(*wrapped_args, **wrapped_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/modules/gnome.py", line 1204, in generate_gir
    scan_target = self._make_gir_target(
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mesonbuild/modules/gnome.py", line 972, in _make_gir_target
    cc_exelist = state.environment.coredata.compilers.host['c'].get_exelist()
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
KeyError: 'c'

subprojects/libtouche/meson.build:37:6: ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

meson-log.txt

Your environment

  • Touché version: 2.0.9
  • Touchégg version: 2.0.17
  • Operating System: Manjaro (unstable branch)
  • Desktop Environment: GNOME
  • Installation method: Meson

Can reproduce on EndeavourOS with KDE, build from the AUR with yay.

If you need more information/test feel free to ping me :)

snsrkn commented

I get the same error on Arch Linux. I try to build with Paru, but it fail.

This seems to be a Meson issue:

  File "/usr/lib/python3.11/site-packages/mesonbuild/modules/gnome.py", line 972, in _make_gir_target
    cc_exelist = state.environment.coredata.compilers.host['c'].get_exelist()
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
KeyError: 'c'

subprojects/libtouche/meson.build:37:6: ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

Looking at their code, the line that is crashing was introduced here: mesonbuild/meson@bf44120

And:

$ git tag --contains bf44120a4f272652f98c607bd05065e8a0492d3a
1.2.0
1.2.0rc1
1.2.0rc2
1.2.0rc3
1.2.1

I tested it and meson <= 1.1.1 works, but meson >= 1.2.0 fails, so I think that that is the culprit commit.

I opened a bug report in meson: mesonbuild/meson#12162
As a workaround, you can use a working version of meson (pip3 install --user meson==1.1.1) to compile it.

I added a workaround on my side to make the project build with any meson version.

I'm creating a new release that should fix the problems with AUR.