Skip to content

Commit

Permalink
modules/rust: Add support for autolib field in the Cargo.toml
Browse files Browse the repository at this point in the history
This adds support for parsing the new `autolib` member
(rust-lang/cargo#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
  • Loading branch information
dcbaker authored and eli-schwartz committed Oct 27, 2024
1 parent 8c5505c commit b131b2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions mesonbuild/cargo/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion mesonbuild/cargo/manifest.py
Original file line number Diff line number Diff line change
@@ -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."""

Expand Down Expand Up @@ -33,6 +33,7 @@
'publish': bool,
'metadata': T.Dict[str, T.Dict[str, str]],
'default-run': str,
'autolib': bool,
'autobins': bool,
'autoexamples': bool,
'autotests': bool,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b131b2d

Please sign in to comment.