| Age | Commit message (Collapse) | Author |
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Fixes: #15258
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This is a simple access, and there are already uses of COMPILER_BASE_OPTIONS
outside options.py.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The two methods are identical.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Boolean options need to be translated from string "true" to True and
so on, otherwise we will get an assertion later when trying to set the
value:
```
Traceback (most recent call last):
File "meson.git/mesonbuild/mesonmain.py", line 193, in run
return options.run_func(options)
~~~~~~~~~~~~~~~~^^^^^^^^^
File "meson.git/mesonbuild/msetup.py", line 395, in run
app.generate()
~~~~~~~~~~~~^^
File "meson.git/mesonbuild/msetup.py", line 194, in generate
return self._generate(env, capture, vslite_ctx)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "meson.git/mesonbuild/msetup.py", line 282, in _generate
captured_compile_args = intr.backend.generate(capture, vslite_ctx)
File "meson.git/mesonbuild/backend/ninjabackend.py", line 647, in generate
self.generate_target(t)
~~~~~~~~~~~~~~~~~~~~^^^
File "meson.git/mesonbuild/backend/ninjabackend.py", line 1099, in generate_target
elem = self.generate_link(target, outname, final_obj_list, linker, pch_objects, stdlib_args=stdlib_args)
File "meson.git/mesonbuild/backend/ninjabackend.py", line 3632, in generate_link
base_link_args = compilers.get_base_link_args(target,
linker,
self.environment)
File "meson.git/mesonbuild/compilers/compilers.py", line 405, in get_base_link_args
option_enabled(linker.base_options, target, env, 'b_lundef')):
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "meson.git/mesonbuild/compilers/compilers.py", line 234, in option_enabled
assert isinstance(ret, bool), 'must return bool' # could also be str
~~~~~~~~~~^^^^^^^^^^^
AssertionError: must return bool
```
This assertion is being hit because the vo-aacenc wrap sets
`b_lundef=true` in `default_options:` in `project()`, which ends up in
`self.augments` when the project is being invoked as a subproject.
The fix is to use set_option even for pending subproject options. This
will follow this path:
new_value = opt.validate_value(new_value)
old_value = self.augments.get(key, opt.value)
self.augments[key] = new_value
This regressed in 2bafe7dc403b92c7b1f7bbad62dd8533e90f8523.
First noticed at: https://github.com/mesonbuild/wrapdb/actions/runs/18123699172/job/51573947286?pr=2425
[Commit message by Nirbheek Chauhan <nirbheek@centricular.com>]
|
|
Fixes: #14956
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
OptionStore.get_value did not change build keys to host when not
cross-compiling. get_value_object_and_value_for also didn't when
accessing self.augments.
Make all accessors go through ensure_and_validate_key so that the
conversion is done early. Otherwise, when "native: true" targets look
up compiler options they do so with the "build.*" name, which does not
exist when not cross compiling.
This removes the distinction between get_value(), meant to be for global
options, and get_value_for() which would be for project-specific options.
While the distinction was added in commit d37d649b0 ("Make all Meson
level options overridable per subproject.", 2025-02-13), it is not
particularly useful and can be a source of bugs like the one in
test_build_to_host_subproject testcase (corresponding to issue #14869).
Fixes: #14869
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Ensure that valobj.yielding is cleared for options in the toplevel project.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This makes it possible to adjust the value of the option with a
subproject-specific augment. This was an undocumented change in 1.8
which was (voluntarily) undone in commit eae4efa72 ("options: resolve
yielding options at the time they are added", 2025-07-13), but is
useful. This reimplementation of yielding options makes it possible
to presreve the bugfix while restoring this new feature.
Reported-by: Nirbheek Chauhan <nirbheek@centricular.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Optional[str]]
As a side effect, this deduplicates -D and -U arguments passed
to meson configure, taking into account the relative ordering
of -D and -U options.
Fixes: #14754
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Go through the whole initialization and set_option process, and check that the
option value is unaffected by the creation of a subproject.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Restore behavior of 1.7.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Remove all the special casing and late validation now that early augments
are stored in pending_subproject_options until the subproject is found.
As a result, this makes the buildtype special case operate on subprojects
as well. It also simplifies set_from_configure_command(), which does not
have to treat various kinds of options in different ways.
Fixes: #14729
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Remove knowledge of the internal pending_options from msetup;
operate on the command line and check against the option store.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
As shown in the test, "-Dtests=true" should not override the
subproject() call because tests is a project options and those
do not share a namespace.
Fixes: #14728
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
They must be there when running re-configuring, because the backend cannot
be changed, but they can be pending on the first invocation.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Once unknown options will go through accept_as_pending_option, only system options
that really exist in Meson will be accepted. Adjust the unit tests.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Which doesn't give helpful error messages unless used with pytest
|
|
Restore the behavior from before commit d37d649b0 ("Make all Meson level
options overridable per subproject.", 2025-02-13). The old code was:
options: T.MutableMapping[OptionKey, T.Any] = OrderedDict()
# process project default options
for k, v in default_options.items():
if not subproject or k.subproject == subproject:
options[k] = v
# override them with machine default and command line options
options.update(env.options)
env.options = options
Fixes: #14608
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
configure"
Follow the same logic that is used at the end of the first invocation.
This fixes
meson setup --reconfigure -Db_ndebug=true
on a project that has no language that defines b_ndebug.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The check for unknown options is duplicated in OptionStore and MesonApp. Place the
better version of the two as a new method of OptionStore, and use it in
OptionStore.validate_cmd_line_options.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Since opt.deprecated is a dictionary with string keys, the lookup must use
str() around the user-provided value; with some care because booleans
will be the meson-ic 'true' and 'false' instead of Python's 'True' and
'False'.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Because system options apply to all subprojects, they need to be
present globally whenever a subproject needs them.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Machine files provide a `Mapping[OptionKey, ElementaryOptionValues]`,
but the expectation listed was that they provided options in the raw DSL
format.
|
|
|
|
|
|
|
|
|
|
We have the OptionKey in the one caller that exists already, and this
allows us to do a hash lookup instead of a linear walk.
|
|
|
|
It's only used for unittests, so define it as a helper in the unit test
module instead
|
|
Closes: #14255.
|
|
Closes #14281.
|
|
|