windows-core switch to minimal bindings#4605
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the windows-core / windows-bindgen pipeline to use minimal bindings, and removes the warnings-returning API so bindgen entrypoints now return () and callers no longer .unwrap().
Changes:
- Switch
windows-corebindings generation to--minimaland merge core/core_com inputs. - Remove the
Warnings/WarningBuilderAPI and updatebindgen()/write()call sites accordingly. - Update docs, samples, and tests to match the new bindgen API and warning behavior.
Reviewed changes
Copilot reviewed 66 out of 66 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/time.md | Update example to match bindgen() returning (). |
| docs/bindgen.md | Update examples/docs for new bindgen API and warning behavior. |
| crates/tools/reactor/src/main.rs | Stop assigning bindgen result (now ()). |
| crates/tools/package/src/main.rs | Stop assigning bindgen result (now ()). |
| crates/tools/bindings/src/main.rs | Remove .unwrap() and remove separate core_com run. |
| crates/tools/bindings/src/core.txt | Switch windows-core generation to --minimal and merge filters. |
| crates/tools/bindings/src/core_com.txt | Remove separate COM bindings input (merged into core.txt). |
| crates/tests/winrt/reference/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/reference_windows/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/reference_no_windows/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/reference_no_deps/build.rs | Stop assigning bindgen result (now ()). |
| crates/tests/winrt/reference_float/build.rs | Stop assigning bindgen result (now ()). |
| crates/tests/winrt/reference_custom/build.rs | Stop assigning bindgen result (now ()). |
| crates/tests/winrt/reference_client/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/ref_params/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/overloads/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/overloads_client/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/noexcept/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/events/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/events_client/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/constructors/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/constructors_client/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/composable/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/composable_client/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/composable_aggregation/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/collection_interop/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/activation/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/winrt/activation_client/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/misc/just_core/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/misc/component/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/misc/component_client/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/libs/reference/build.rs | Remove .unwrap() from bindgen call. |
| crates/tests/libs/rdl/tests/struct_values.rs | Remove .unwrap() from bindgen call. |
| crates/tests/libs/rdl/tests/struct_fields.rs | Remove .unwrap() from bindgen call. |
| crates/tests/libs/rdl/tests/fn_abi.rs | Remove .unwrap() from bindgen call. |
| crates/tests/libs/bindgen/tests/fixtures.rs | Update fixtures to new bindgen/write behavior (no warnings object). |
| crates/tests/libs/bindgen/data/error/bindgen_skip/fixture.toml | Remove warning-based error fixture (warnings removed). |
| crates/tests/libs/bindgen/data/error/bindgen_skip/expected.err | Remove warning-based expected output. |
| crates/tests/libs/bindgen/data/error/bindgen_skip_cpp/fixture.toml | Remove warning-based error fixture (warnings removed). |
| crates/tests/libs/bindgen/data/error/bindgen_skip_cpp/expected.err | Remove warning-based expected output. |
| crates/samples/windows/xaml_app/build.rs | Stop assigning builder result (now ()). |
| crates/samples/windows/webview/build.rs | Remove .unwrap() from .write(). |
| crates/samples/services/time/build.rs | Remove .unwrap() from .write(). |
| crates/samples/robot/component/build.rs | Remove .unwrap() from .write(). |
| crates/samples/robot/client/build.rs | Remove .unwrap() from .write(). |
| crates/samples/json/json_validator_winrt/build.rs | Remove .unwrap() from .write(). |
| crates/samples/json/json_validator_winrt_client/build.rs | Remove .unwrap() from .write(). |
| crates/samples/canvas/standalone/build.rs | Remove .unwrap() from .write(). |
| crates/libs/core/src/lib.rs | Adjust crate-level clippy expectations. |
| crates/libs/core/src/imp/mod.rs | Remove separate COM bindings module; re-export merged bindings. |
| crates/libs/core/src/imp/factory_cache.rs | Update to new minimal binding signatures/return handling. |
| crates/libs/core/src/imp/com_bindings.rs | Remove generated COM bindings file (merged into bindings.rs). |
| crates/libs/core/src/imp/bindings.rs | Update generated bindings output for --minimal. |
| crates/libs/core/src/imp/agile.rs | Update RoGetAgileReference call to match new signature/output handling. |
| crates/libs/core/src/guid.rs | Update UUID creation success handling for RPC_STATUS. |
| crates/libs/bindgen/src/winmd/mod.rs | Remove now-unused MemberRefParentExt. |
| crates/libs/bindgen/src/warnings.rs | Remove warnings implementation (API removed). |
| crates/libs/bindgen/src/types/interface.rs | Remove warning emission for skipped methods/impl-traits. |
| crates/libs/bindgen/src/types/cpp_interface.rs | Remove warning emission for skipped methods/impl-traits. |
| crates/libs/bindgen/src/type_map.rs | Remove unused TypeMap::remove. |
| crates/libs/bindgen/src/lib.rs | Remove warnings module; change write() to return (). |
| crates/libs/bindgen/src/format.rs | Change rustfmt failure handling (now panics). |
| crates/libs/bindgen/src/filter.rs | Remove filter warning collection. |
| crates/libs/bindgen/src/config.rs | Remove warnings handle from Config. |
| crates/libs/bindgen/src/cli.rs | Change bindgen() to return () and update docs. |
| crates/libs/bindgen/readme.md | Update README example for new bindgen API. |
Comment on lines
+6
to
+8
| let formatted = self | ||
| .rustfmt(tokens) | ||
| .unwrap_or_else(|| panic!("failed to format output with `rustfmt`")); |
|
|
||
| pub use agile::*; | ||
| pub(crate) use bindings::*; | ||
| pub use bindings::*; |
Comment on lines
+27
to
+29
| // RPC_S_UUID_LOCAL_ONLY (1824) indicates a locally-generated UUID, | ||
| // which is fine for our purposes. | ||
| if result.is_ok() || result == RPC_STATUS(1824) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.