diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2024-10-26 20:05:35 -0700 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-10-27 02:18:33 -0400 |
| commit | b131b2dc76ff0b14d755b1a3bbf7ce9565f49b0d (patch) | |
| tree | 5daed5b1c69e894d2198a082366a7c1dbccc507a | |
| parent | 8c5505c28ad801c90af17d639e8bf3de8ca3143f (diff) | |
| download | meson-b131b2dc76ff0b14d755b1a3bbf7ce9565f49b0d.tar.gz | |
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
| -rw-r--r-- | mesonbuild/cargo/interpreter.py | 1 | ||||
| -rw-r--r-- | mesonbuild/cargo/manifest.py | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/cargo/interpreter.py b/mesonbuild/cargo/interpreter.py index 00e713622..2f67a781d 100644 --- a/mesonbuild/cargo/interpreter.py +++ b/mesonbuild/cargo/interpreter.py @@ -146,6 +146,7 @@ class Package: publish: bool = True metadata: T.Dict[str, T.Any] = dataclasses.field(default_factory=dict) default_run: T.Optional[str] = None + autolib: bool = True autobins: bool = True autoexamples: bool = True autotests: bool = True diff --git a/mesonbuild/cargo/manifest.py b/mesonbuild/cargo/manifest.py index 50c048991..95b0d4bb8 100644 --- a/mesonbuild/cargo/manifest.py +++ b/mesonbuild/cargo/manifest.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright © 2022-2023 Intel Corporation +# Copyright © 2022-2024 Intel Corporation """Type definitions for cargo manifest files.""" @@ -33,6 +33,7 @@ Package = TypedDict( 'publish': bool, 'metadata': T.Dict[str, T.Dict[str, str]], 'default-run': str, + 'autolib': bool, 'autobins': bool, 'autoexamples': bool, 'autotests': bool, @@ -65,6 +66,7 @@ class FixedPackage(TypedDict, total=False): publish: bool metadata: T.Dict[str, T.Dict[str, str]] default_run: str + autolib: bool autobins: bool autoexamples: bool autotests: bool |
