Respect required-features field from Cargo.toml#14379
Respect required-features field from Cargo.toml#14379FabianLars merged 7 commits intotauri-apps:devfrom
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.
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.