Skip to content

Commit

Permalink
use new optionkey.is_* methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dcbaker committed Jan 4, 2021
1 parent 30ec761 commit 615686f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mesonbuild/ast/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def func_project(self, node: BaseNode, args: T.List[TYPE_nvar], kwargs: T.Dict[s
self.do_subproject(i)

self.coredata.init_backend_options(self.backend)
options = {k: v for k, v in self.environment.options.items() if k.name.startswith('backend_')}
options = {k: v for k, v in self.environment.options.items() if k.is_backend()}

self.coredata.set_options(options)
self._add_languages(proj_langs, MachineChoice.HOST)
Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/coredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class OptionKey:
internally easier to reason about and produce.
"""

__slots__ = ['name', 'subproject', 'machine', 'lang', '_hash', '_type']
__slots__ = ['name', 'subproject', 'machine', 'lang', '_hash', 'type']

name: str
subproject: str
Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3142,7 +3142,7 @@ def set_backend(self):
if self.environment.first_invocation:
self.coredata.init_backend_options(backend)

options = {k: v for k, v in self.environment.options.items() if k.name.startswith('backend_')}
options = {k: v for k, v in self.environment.options.items() if k.is_backend()}
self.coredata.set_options(options)

@stringArgs
Expand Down

1 comment on commit 615686f

@jpakkane
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other failure is this:

C:\Users\IEUser\glib-2.67.4>python ..\meson\meson.py -Dbuild_tests=false -Dinstalled_tests=false -Dselinux=disabled -Diconv=external -Dinternal_pcre=false --buildtype plain --backend ninja --wrap-mode nodownload --native native.txt --native native-dbg.txt builddir glib-2.67.4
Traceback (most recent call last):
  File "C:\Users\IEUser\meson\mesonbuild\mesonmain.py", line 132, in run
    return options.run_func(options)
  File "C:\Users\IEUser\meson\mesonbuild\msetup.py", line 273, in run
    coredata.parse_cmd_line_options(options)
  File "C:\Users\IEUser\meson\mesonbuild\coredata.py", line 1224, in parse_cmd_line_options
    args.cmd_line_options = create_options_dict(args.projectoptions)
  File "C:\Users\IEUser\meson\mesonbuild\coredata.py", line 1217, in create_options_dict
    k = OptionKey.from_string(key)
  File "C:\Users\IEUser\meson\mesonbuild\coredata.py", line 191, in from_string
    return cls(opt, subproject, for_machine, lang)
  File "C:\Users\IEUser\meson\mesonbuild\coredata.py", line 115, in __init__
    object.__setattr__(self, 'type', _type)
AttributeError: 'OptionKey' object has no attribute 'type'

Please sign in to comment.