Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When compiling Rust project with meson, dependencies' features are not fully resolved #13404

Open
fre3dm4n opened this issue Jul 11, 2024 · 0 comments

Comments

@fre3dm4n
Copy link

Describe the bug
Rust project can have optional dependency, which will also declare a feature for this crate automatically.

For example, the Cargo.toml for a crate named dep can be like:

[package]
name = "dep"
version = "0.1.0"
edition = "2021"

[dependencies]
serde = { version = "1.0.204", optional = true }

[features]
# no need to declare serde as a feature cause cargo help us with it
# serde = ["serde"]

And for using the dep crate together the serde dependency of it, simply do:

dep = { path = "dep", features = ["serde"] }

However, currently in the meson build system, the serde won't be identified as a feature of the dep crate.

To Reproduce
The repository to reproduce

The toml feature for the figment crate is not identified.

Expected behavior
The feature can be automatically identified and exposed to meson build system.

system parameters

  • Is this a cross build or just a plain native build (for the same computer)?: plain native build.
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.): all platform
  • what Python version are you using e.g. 3.8.0: >3.11
  • what meson --version: from master branch, 1.5.99
  • what ninja --version if it's a Ninja build: 1.10.1
@fre3dm4n fre3dm4n changed the title When compiling Rust project with meson, feature of dependencies is not fully resolved When compiling Rust project with meson, dependencies' features are not fully resolved Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant