meson: Unhandled python exception: TypeError: can only concatenate str (not "NoneType") to str

Describe the bug I have an embedded target that I was attempting to get working with Clang today (works with GCC). I setup my cross file and attempting to setup gave me this.

    Cross files: arm-none-eabi-clang.txt

Found ninja-1.11.1.git.kitware.jobserver-1 at c:\users\rsmyth\.local\bin\ninja.EXE
Traceback (most recent call last):
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\mesonmain.py", line 194, in run
    return options.run_func(options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\msetup.py", line 358, in run
    app.generate()
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\msetup.py", line 181, in generate
    return self._generate(env, capture, vslite_ctx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\msetup.py", line 251, in _generate
    captured_compile_args = intr.backend.generate(capture, vslite_ctx)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\backend\ninjabackend.py", line 632, in generate
    self.generate_target(t)
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\backend\ninjabackend.py", line 1057, in generate_target
    elem = self.generate_link(target, outname, final_obj_list, linker, pch_objects, stdlib_args=stdlib_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\backend\ninjabackend.py", line 3385, in generate_link
    commands += self.get_link_debugfile_args(linker, target)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\backend\ninjabackend.py", line 2751, in get_link_debugfile_args
    return linker.get_link_debugfile_args(self.get_target_debug_filename(target))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\compilers\compilers.py", line 930, in get_link_debugfile_args
    return self.linker.get_debugfile_args(targetfile)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\rsmyth\AppData\Local\pipx\pipx\venvs\meson\Lib\site-packages\mesonbuild\linkers\linkers.py", line 1286, in get_debugfile_args
    return self._apply_prefix(['/DEBUG', '/PDB:' + self.get_debugfile_name(targetfile)])
                                         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

To Reproduce Sorry I cannot provide the meson files as it is company property 😦

But this is on Windows if it is not clear. I have LLVM resources in a folder in my appdata folder. My cross file uses ['-target', 'thumb', '-march=armv6m'] for the c_args. The host_machine is arm cortex-m0 little endian.

Expected behavior

system parameters

  • Is this a cross build or just a plain native build (for the same computer)?

Cross

  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)

Microsoft Windows 10 Pro 10.0.19045 Build 19045

  • what Python version are you using e.g. 3.8.0

3.11

  • what meson --version

1.4.0

  • what ninja --version if it’s a Ninja build

1.11.1.git.kitware.jobserver-1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Yup, that worked! Thanks!