-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[prost] includes prost crate infos in rust_analyzer_aspect (#2232)
The change is fairly straightforward, but I did need to move prost providers up to `prost/providers.bzl` and out of `private/prost.bzl` to avoid a cyclic dependency. What we do is: * change `rust_prost_library` to return the `rust_proto_info` provider * in the `rust-analyzer` aspect we iterate over transitive dep infos and generate the appropriate `RustAnalyzerInfo` * lastly, we use the `crate_info` from `ProstProtoInfo` if we're processing a prost target as the "root" `crate_info` There are a couple of things I'm not sure are correct: 1. For every prost dep I set `deps` to `[]` - I think that's correct but I'm not sure-sure. 2. Similarly I set `proc_macro_dylib_path` to always `None` - again I think that's correct, but not sure-sure. Fixes #2121. --------- Co-authored-by: UebelAndre <[email protected]>
- Loading branch information
1 parent
4aafa0a
commit 25411ee
Showing
5 changed files
with
42 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""Module containing definitions of all Prost providers.""" | ||
|
||
ProstProtoInfo = provider( | ||
doc = "Rust Prost provider info", | ||
fields = { | ||
"dep_variant_info": "DepVariantInfo: For the compiled Rust gencode (also covers its " + | ||
"transitive dependencies)", | ||
"package_info": "File: A newline delimited file of `--extern_path` values for protoc.", | ||
"transitive_dep_infos": "depset[DepVariantInfo]: Transitive dependencies of the compiled crate.", | ||
}, | ||
) |
This file contains 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