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

AssertionError with extra_files in shared_library #10933

Open
RossComputerGuy opened this issue Oct 19, 2022 · 2 comments
Open

AssertionError with extra_files in shared_library #10933

RossComputerGuy opened this issue Oct 19, 2022 · 2 comments

Comments

@RossComputerGuy
Copy link

Describe the bug

Traceback (most recent call last):
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 146, in run
    return options.run_func(options)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/msetup.py", line 294, in run
    app.generate()
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/msetup.py", line 185, in generate
    self._generate(env)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/msetup.py", line 229, in _generate
    intr.run()
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreter/interpreter.py", line 2549, in run
    super().run()
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 148, in run
    self.evaluate_codeblock(self.ast, start=1)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 173, in evaluate_codeblock
    raise e
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 166, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 179, in evaluate_statement
    return self.function_call(cur)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 454, in function_call
    res = func(node, func_args, kwargs)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/decorators.py", line 276, in wrapper
    return f(*nargs, **wrapped_kwargs)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/decorators.py", line 573, in wrapper
    return f(*wrapped_args, **wrapped_kwargs)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreter/interpreter.py", line 2039, in func_subdir
    self.evaluate_codeblock(codeblock)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 173, in evaluate_codeblock
    raise e
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 166, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 181, in evaluate_statement
    self.assignment(cur)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 566, in assignment
    value = self.evaluate_statement(node.value)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 179, in evaluate_statement
    return self.function_call(cur)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 454, in function_call
    res = func(node, func_args, kwargs)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreterbase/decorators.py", line 115, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreter/interpreter.py", line 1611, in func_shared_lib
    holder = self.build_target(node, args, kwargs, build.SharedLibrary)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/interpreter/interpreter.py", line 2759, in build_target
    target = targetclass(name, self.subdir, self.subproject, for_machine, sources, objs, self.environment, kwargs)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/build.py", line 1966, in __init__
    super().__init__(name, subdir, subproject, for_machine, sources, objects, environment, kwargs)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/build.py", line 727, in __init__
    self.process_kwargs(kwargs, environment)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/build.py", line 2146, in process_kwargs
    super().process_kwargs(kwargs, environment)
  File "/nix/store/yhcibgcjzajywj2wcbm2h6dm39nv1nlh-meson-0.61.2/lib/python3.9/site-packages/mesonbuild/build.py", line 1164, in process_kwargs
    assert isinstance(i, File)
AssertionError

core/meson.build:21:0: ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

I get this assertion when using extra_files in any "binary" build target.

To Reproduce

sources = ["a.c"]
headers = ["a.h"]

enums = gnome.mkenums('my-enums', sources: headers)
shared_library('my-lib', enums, sources,
  extra_files: enums)

It occurs in this case because I keep on getting missing header errors since my executable is built after the enums.

Expected behavior
enums should be recognized as being needed and add it in.

system parameters

  • Is this a cross build or just a plain native build (for the same computer)? Native
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) macOS Monterey 12.5.1
  • what Python version are you using e.g. 3.8.0: 3.10.8
  • what meson --version: 0.61.2
  • what ninja --version if it's a Ninja build: 1.10.2
@eli-schwartz
Copy link
Member

As far as I can tell, this has never ever been supported -- only strings and files() objects, not custom_target outputs such as the mkenums method produces.

This despite the fact that the YAML-based reference manual claims that it is supported, which seems to have been a faulty assumption while trying to fill in types once the reference manual first gained support for types.

@RossComputerGuy
Copy link
Author

Yeah, if it isn't supported then there needs to be type checking to prevent confusion and add clarification. Respectively, the documentation should be updated as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants