-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
options: process project options before machine options #14611
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
Conversation
Old code indeed used the same order as after the patch. From CoreData.set_default_options: options: T.MutableMapping[OptionKey, T.Any] = OrderedDict()
for k, v in default_options.items(): # process project default options
if not subproject or k.subproject == subproject:
options[k] = v
options.update(env.options) # override them with machine default and command line options
env.options = options |
@jpakkane can you confirm that this wasn't intentional? |
Needs a rebase after #14635. |
That was merged, a rebase should clear up most or all of the failing tests |
I'm going to say that even if it was intentional, it's a pretty big behavioral change that, IMHO, would be a breaking backwards incompatible change and require a Meson 2.0 with proper deprecation cycle |
The documentation says:
So no, the change was not intentional. The new unit test proves that this implementation is correct. |
unittests/optiontests.py
Outdated
proj_value = 'xcode' | ||
mfile_value = 'vs2010' | ||
k = OptionKey(name) | ||
prefix = UserStringOption('prefix', 'This is needed by OptionStroe', '/usr') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefix = UserStringOption('prefix', 'This is needed by OptionStroe', '/usr') | |
prefix = UserStringOption('prefix', 'This is needed by OptionStore', '/usr') |
With the typo fix + rebase, LGTM. |
Restore the behavior from before commit d37d649 ("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: mesonbuild#14608 Signed-off-by: Paolo Bonzini <[email protected]>
I'm not sure if this is the right fix or too big a hammer, but let's try.
Fixes: #14608