modules/rust: Add support for autolib field in the Cargo.toml

This adds support for parsing the new `autolib` member
(https://github.com/rust-lang/cargo/pull/14591).

This is a quick and easy fix, suitable for backport. A larger more
involved fix will be to stop splatting out the cargo dictionaries, and
instead pass the fields we know about 1 by 1, and warning the user if we
come across unknown fields.

Fixes: #13826
pull/13831/head
Dylan Baker 4 weeks ago committed by Eli Schwartz
parent 8c5505c28a
commit b131b2dc76
  1. 1
      mesonbuild/cargo/interpreter.py
  2. 4
      mesonbuild/cargo/manifest.py

@ -146,6 +146,7 @@ class Package:
publish: bool = True publish: bool = True
metadata: T.Dict[str, T.Any] = dataclasses.field(default_factory=dict) metadata: T.Dict[str, T.Any] = dataclasses.field(default_factory=dict)
default_run: T.Optional[str] = None default_run: T.Optional[str] = None
autolib: bool = True
autobins: bool = True autobins: bool = True
autoexamples: bool = True autoexamples: bool = True
autotests: bool = True autotests: bool = True

@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Copyright © 2022-2023 Intel Corporation # Copyright © 2022-2024 Intel Corporation
"""Type definitions for cargo manifest files.""" """Type definitions for cargo manifest files."""
@ -33,6 +33,7 @@ Package = TypedDict(
'publish': bool, 'publish': bool,
'metadata': T.Dict[str, T.Dict[str, str]], 'metadata': T.Dict[str, T.Dict[str, str]],
'default-run': str, 'default-run': str,
'autolib': bool,
'autobins': bool, 'autobins': bool,
'autoexamples': bool, 'autoexamples': bool,
'autotests': bool, 'autotests': bool,
@ -65,6 +66,7 @@ class FixedPackage(TypedDict, total=False):
publish: bool publish: bool
metadata: T.Dict[str, T.Dict[str, str]] metadata: T.Dict[str, T.Dict[str, str]]
default_run: str default_run: str
autolib: bool
autobins: bool autobins: bool
autoexamples: bool autoexamples: bool
autotests: bool autotests: bool

Loading…
Cancel
Save