Skip to content

Make configuration accept unknown-but-maybe-valid-in-the-future options #14624

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

Merged
merged 4 commits into from
May 22, 2025

Conversation

bonzini
Copy link
Collaborator

@bonzini bonzini commented May 19, 2025

This fixes #14615, which is reported as a 1.8.1 regression but was actually reproducible even before with meson configure (instead of meson setup --reconfigure).

It's not trivial fix, though in the end the code becomes almost simpler. The crux of the issue is the disagreement between OptionStore.validate_cmd_line_options, MesonApp.check_unused_options and OptionStore.set_option_from_string. Place the desired semantics (mostly those from check_unused_options) in a new function so that the three share the same logic.

Fixes: #14615

bonzini added 4 commits May 19, 2025 11:20
classify_D_arguments returns a list with OptionKeys in it.  Rename
the function so that the difference with set_option is clear.

Signed-off-by: Paolo Bonzini <[email protected]>
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 <[email protected]>
…eson 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 <[email protected]>
Make more of the first-invocation logic apply to subsequent configuration
of the build tree.

This also opens the door for using set_option_maybe_root for the
first invocation.  This is a huge cleanup but also a larger change,
and therefore not something for stable branches.  Leave it for later.

Signed-off-by: Paolo Bonzini <[email protected]>
@bonzini bonzini requested a review from jpakkane as a code owner May 19, 2025 17:33
@bonzini bonzini added this to the 1.8.1 milestone May 19, 2025
@bonzini bonzini added options Meson configuration options regression labels May 19, 2025
@bonzini bonzini requested review from dcbaker and removed request for jpakkane May 19, 2025 17:33
@eli-schwartz eli-schwartz merged commit 1ac86c1 into mesonbuild:master May 22, 2025
30 of 31 checks passed
@bonzini bonzini deleted the fix14615 branch May 23, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
options Meson configuration options regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

meson setup --reconfigure errors when setting base options
3 participants