You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using @PRIVATE_DIR@ in a run_target() command array trigger an error.
$ meson setup builddir
The Meson build system
Version: 1.6.1
Source dir: /tmp/run_target_private_dir
Build dir: /tmp/run_target_private_dir/builddir
Build type: native build
Project name: run_target_private_dir
Project version: undefined
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 1
Found ninja-1.12.1 at /usr/bin/ninja
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/mesonbuild/mesonmain.py", line 193, in run
return options.run_func(options)
~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3.13/site-packages/mesonbuild/msetup.py", line 365, in run
app.generate()
~~~~~~~~~~~~^^
File "/usr/lib/python3.13/site-packages/mesonbuild/msetup.py", line 188, in generate
return self._generate(env, capture, vslite_ctx)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/mesonbuild/msetup.py", line 253, in _generate
captured_compile_args = intr.backend.generate(capture, vslite_ctx)
File "/usr/lib/python3.13/site-packages/mesonbuild/backend/ninjabackend.py", line 656, in generate
self.generate_target(t)
~~~~~~~~~~~~~~~~~~~~^^^
File "/usr/lib/python3.13/site-packages/mesonbuild/backend/ninjabackend.py", line 883, in generate_target
self.generate_run_target(target)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.13/site-packages/mesonbuild/backend/ninjabackend.py", line 1239, in generate_run_target
_, _, cmd = self.eval_custom_target_command(target)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.13/site-packages/mesonbuild/backend/backends.py", line 1586, in eval_custom_target_command
pdir = self.get_target_private_dir_abs(target)
File "/usr/lib/python3.13/site-packages/mesonbuild/backend/backends.py", line 395, in get_target_private_dir_abs
return os.path.join(self.environment.get_build_dir(), self.get_target_private_dir(target))
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.13/site-packages/mesonbuild/backend/backends.py", line 392, in get_target_private_dir
return os.path.join(self.get_target_filename(target, warn_multi_output=False) + '.p')
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/mesonbuild/backend/backends.py", line 304, in get_target_filename
assert isinstance(t, build.BuildTarget), t
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
AssertionError: <RunTarget private_dir_failure@run: /usr/bin/mkdir>
ERROR: Unhandled python exception
This is a Meson bug and should be reported!
Expected behavior
I initially expected Meson to adopt the same behavior than in custom_target() by allocating a directory path for private data.
Though after reading the documentation this substitution not listed among the supported ones.
In case this is not supported I expect Meson to catch to produce a clear error such as @PRIVATE_DIR@ substitutions are not supported in run_target() command.
I did more testing and found that @BUILD_ROOT@ and @OUTPUT@ substitution works, the later expanding to the target name in Ninja.build.
system parameters
Is this a cross build or just a plain native build (for the same computer)? native
what operating system : ArchLinux
what Python version : Python 3.13.1
what meson --version : 1.6.1
what ninja --version : 1.12.1
The text was updated successfully, but these errors were encountered:
Describe the bug
Using
@PRIVATE_DIR@
in arun_target()
command array trigger an error.To Reproduce
Use this
meson.build file
:Expected behavior
I initially expected Meson to adopt the same behavior than in
custom_target()
by allocating a directory path for private data.Though after reading the documentation this substitution not listed among the supported ones.
In case this is not supported I expect Meson to catch to produce a clear error such as
@PRIVATE_DIR@ substitutions are not supported in run_target() command
.I did more testing and found that
@BUILD_ROOT@
and@OUTPUT@
substitution works, the later expanding to the target name in Ninja.build.system parameters
meson --version
: 1.6.1ninja --version
: 1.12.1The text was updated successfully, but these errors were encountered: