Closed youyuanwu closed 5 months ago
The first time executing windows-bindgen::bindgen creates the feature switches correctly in the cargo.toml:
[features] implement = [] Win32_Foundation = [] ServiceFabric = [] ServiceFabric_FabricCommon = ["ServiceFabric"] ServiceFabric_FabricCommon_FabricClient = ["ServiceFabric_FabricCommon"] ServiceFabric_FabricCommon_FabricRuntime = ["ServiceFabric_FabricCommon"] ServiceFabric_FabricCommon_FabricTransport = ["ServiceFabric_FabricCommon"]
If I run the bindgen again the feature switches are inserted again and the crate cannot compile:
[features] implement = [] Foundation = [] Win32_Foundation = [] ServiceFabric = ["Foundation"] ServiceFabric_FabricCommon = ["ServiceFabric"] ServiceFabric_FabricCommon_FabricClient = ["ServiceFabric_FabricCommon"] ServiceFabric_FabricCommon_FabricRuntime = ["ServiceFabric_FabricCommon"] ServiceFabric_FabricCommon_FabricTransport = ["ServiceFabric_FabricCommon"] ServiceFabric = ["Foundation"] ServiceFabric_FabricCommon = ["ServiceFabric"] ServiceFabric_FabricCommon_FabricClient = ["ServiceFabric_FabricCommon"] ServiceFabric_FabricCommon_FabricRuntime = ["ServiceFabric_FabricCommon"] ServiceFabric_FabricCommon_FabricTransport = ["ServiceFabric_FabricCommon"]
The bindgen tool should detect if the features are already present on the toml and only append missing ones. This is annoying in code regeneration and manual editing of the toml is required.
To reproduce, run the tools_api target in this repo: https://github.com/Azure/service-fabric-rs This issue is originally found in v0.51 and still present in v0.54
No response
That's what this line is for:
https://github.com/microsoft/windows-rs/blob/d9cc52e2a22c08aa0bda3e407b463e07a48a6137/crates/libs/sys/Cargo.toml#L29
Anything prior to this will be preserved. Anything after this line will be replaced.
Thanks for point that out. Adding the comment resolves this issue.
Summary
The first time executing windows-bindgen::bindgen creates the feature switches correctly in the cargo.toml:
If I run the bindgen again the feature switches are inserted again and the crate cannot compile:
The bindgen tool should detect if the features are already present on the toml and only append missing ones. This is annoying in code regeneration and manual editing of the toml is required.
To reproduce, run the tools_api target in this repo: https://github.com/Azure/service-fabric-rs This issue is originally found in v0.51 and still present in v0.54
Crate manifest
No response
Crate code
No response