Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions mesonbuild/envconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@
'tricore'
)

known_systems = (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't it be better for this to be a (frozen)set?

@dcbaker dcbaker Jun 29, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should also be KNOWN_SYSTEMS, since it's a module constant.

'aix',
'android',
'cygwin',
'darwin',
'dragonfly',
'freebsd',
'gnu',
'haiku',
'linux',
'netbsd',
'openbsd',
'os/2',
'sunos',
'windows',
)

# It would feel more natural to call this "64_BIT_CPU_FAMILIES", but
# python identifiers cannot start with numbers
CPU_FAMILIES_64_BIT = [
Expand Down Expand Up @@ -302,6 +319,8 @@ def from_literal(cls, raw: T.Dict[str, ElementaryOptionValues]) -> 'MachineInfo'
mlog.warning(f'Unknown endian {endian}')

system = literal['system']
if system not in known_systems:
mlog.warning(f'Unknown system {system}, please report this at https://github.com/mesonbuild/meson/issues/new')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This probably also needs fatal=False.

kernel = literal.get('kernel', None)
subsystem = literal.get('subsystem', None)

Expand Down
Loading