-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Respect required-features field from Cargo.toml #14379
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
Conversation
Package Changes Through 095d43dThere are 3 changes which include tauri-bundler with patch, tauri-cli with patch, @tauri-apps/cli with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
|
thanks for the pr! would you mind adding a small changefile as well please? |
Done |
| if let (Some(req_features), Some(opt_features)) = | ||
| (&bin.required_features, &options.features) | ||
| { | ||
| // Check if all required features are enabled. | ||
| if !req_features.iter().all(|feat| opt_features.contains(feat)) { | ||
| continue; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this have the same code path if options.features == None vs options.features == Some(["a", "b"]) when req_features == Some(["c"])? The continue will be hit in the latter case, but not in the former.
Looking into this due to #14607
Cargo.tomlallows binary target definition to containrequired-featuresfield (see The Cargo Book). If defined, the binary is built only when a certain feature is activated.Tauri pulls the list of binaries from
Cargo.tomlregardless of the presence of therequired-featuresfield and tries to add them to the final package. But the binaries may not be there.This pull request addresses this problem.
Example excerpt from
Cargo.toml:Example build with
cargo-tauri:The above will exclude
defguard-servicefrom the final package, while this:will include all binaries.