Closed ethindp closed 2 weeks ago
I can't reproduce this on Linux, could you provide the actual backtrace?
@dcbaker Sure, it's odd it can't be reproduced on Linux but here you go:
...\build>meson setup --reconfigure --wipe
The Meson build system
Version: 1.5.1
...
poco| CMake configuration: SUCCEEDED
Traceback (most recent call last):
File "...\mesonbuild\mesonmain.py", line 188, in run
return options.run_func(options)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\msetup.py", line 364, in run
app.generate()
File "...\mesonbuild\msetup.py", line 187, in generate
return self._generate(env, capture, vslite_ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\msetup.py", line 226, in _generate
intr.run()
File "...\mesonbuild\interpreter\interpreter.py", line 3032, in run
super().run()
File "...\mesonbuild\interpreterbase\interpreterbase.py", line 169, in run
self.evaluate_codeblock(self.ast, start=1)
File "...\mesonbuild\interpreterbase\interpreterbase.py", line 195, in evaluate_codeblock
raise e
File "...\mesonbuild\interpreterbase\interpreterbase.py", line 187, in evaluate_codeblock
self.evaluate_statement(cur)
File "...\mesonbuild\interpreterbase\interpreterbase.py", line 205, in evaluate_statement
self.assignment(cur)
File "...\mesonbuild\interpreterbase\interpreterbase.py", line 642, in assignment
value = self.evaluate_statement(node.value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\interpreterbase\interpreterbase.py", line 207, in evaluate_statement
return self.method_call(cur)
^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\interpreterbase\interpreterbase.py", line 557, in method_call
res = obj.method_call(method_name, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\interpreter\interpreterobjects.py", line 854, in method_call
ret = method(state, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\interpreterbase\decorators.py", line 663, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\interpreterbase\decorators.py", line 250, in wrapper
return f(*nargs, **wrapped_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\interpreterbase\decorators.py", line 569, in wrapper
return f(*wrapped_args, **wrapped_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\modules\cmake.py", line 429, in subproject
subp = self.interpreter.do_subproject(dirname, kw, force_method='cmake')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\interpreter\interpreter.py", line 948, in do_subproject
raise e
File "...\mesonbuild\interpreter\interpreter.py", line 936, in do_subproject
return methods_map[method](subp_name, subdir, default_options, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\interpreter\interpreter.py", line 1023, in _do_subproject_cmake
cm_int.analyse()
File "...\mesonbuild\cmake\interpreter.py", line 948, in analyse
tgt.postprocess(self.output_target_map, self.src_dir, self.subdir, self.install_prefix, self.trace)
File "...\mesonbuild\cmake\interpreter.py", line 425, in postprocess
ctgt = output_target_map.generated(gen_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\cmake\interpreter.py", line 181, in generated
res = self._return_first_valid_key([self._rel_generated_file_key(name), self._base_generated_file_key(name)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\cmake\interpreter.py", line 197, in _rel_generated_file_key
path = self._rel_path(fname)
^^^^^^^^^^^^^^^^^^^^^
File "...\mesonbuild\cmake\interpreter.py", line 188, in _rel_path
return fname.resolve().relative_to(self.build_dir)
^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'resolve'
..\meson.build:57:18: ERROR: Unhandled python exception
This is a Meson bug and should be reported!
Out of curiosity, what version of CMake do you have?
@dcbaker I'm on CMake 3.28.3 right now. It might change with VS upgrades though. I have yet to test it with absolute latest CMake (3.30+).
Okay, I have 3.29.2, so it's not like we have wildly different versions... hmmm. There's a lot of lose handling of None in the CMake convertor in Meson. unfortunately the actual place that the None is getting inserted is not in the stack trace, but I can look at the typing a bit more, it might pop out at me
I found some places were we can put an Optional[Path]
into the sources that we shouldn't, and it looks relevant. Could you try with https://github.com/mesonbuild/meson/pull/13579 and see if that fixes the issue?
@dcbaker Is there any more things I can do to give more data? I tried looking into it myself but it didn't really make much sense to me when I was trying to dig into it. Hopefully you'll have more luck than I did. It doesn't help that I'm not overly proficient with understanding Meson's source code so... Lol
@ethindp, yeah, and the CMake handling code is some of the most complicated code in Meson. Could you try the PR I mentioned?
@dcbaker I can confirm that this did solve the problem. Hopefully it doesn't break things on other platforms.
It shouldn't, this is really an internal variable type issue.
Ah, okay. It fixed it for me when I tried it.
Describe the bug When trying to integrate Poco as a dependency via the cmake module, this exception is thrown. At first I thought it was unable to find a CMake target, but I don't believe this is the case.
To Reproduce First, add this
wrap
:Then, use a
meson.build
like the following (a standardmeson init
without any changes other than dependencies will cause this bug):Expected behavior This should work fine. I don't think Poco is necessarily doing anything special.
system parameters