Don't emit CrateInfo from rust_static_library and rust_shared_library#1298
Merged
scentini merged 9 commits intoApr 28, 2022
Merged
Conversation
hlopko
approved these changes
Apr 28, 2022
This was referenced Apr 28, 2022
PiotrSikora
reviewed
May 3, 2022
| ), | ||
| ] | ||
|
|
||
| if crate_info.type in ["staticlib", "cdylib"]: |
Contributor
There was a problem hiding this comment.
This confuses rule type with crate_info.type, and breaks rust_binary(crate_type="cdylib") which we use when building WebAssembly targets (due to a missing first-class support for rust_wasm_binary()):
[...]
ERROR: /tmp/proxy-wasm-cpp-host/test/test_data/BUILD:45:17: in rust_binary rule //test/test_data:_wasm_env_wasm:
.../external/rules_rust/rust/private/rust.bzl:295:5: rule advertised the 'CrateInfo' provider, but this provider was not among those returned
ERROR: /tmp/proxy-wasm-cpp-host/test/test_data/BUILD:45:17: Analysis of target '//test/test_data:_wasm_env_wasm' failed
ERROR: Analysis of target '//test/test_data:env.wasm' failed; build aborted:
[...]
Collaborator
There was a problem hiding this comment.
@PiotrSikora Sorry about the breakage 😞
can you create a separate issue for this? It'd then be good if you could provide a local repro case or maybe just open a PR if you've already got a solution in mind.
Contributor
There was a problem hiding this comment.
I have a fix (#1315), but local repro is tricky due to a use of custom rule and transition to force build for Wasm.
PiotrSikora
added a commit
to PiotrSikora/rules_rust
that referenced
this pull request
May 3, 2022
Broken in bazelbuild#1298. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
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.
These rules emit a
staticlibandcdylibwhich are not meant for consumption by other rust targets.However, one should still be able to write a
rust_testforrust_shared_libraryandrust_static_librarytargets, which needs aCrateInfo. For this purpose we provide aCrateInfowrapped in aTestCrateInfoprovider, thatrust_testunderstands.