Adds dependency injection rule for protobuf-java runtime#15006
Adds dependency injection rule for protobuf-java runtime#15006chrisjrn merged 10 commits intopantsbuild:mainfrom
protobuf-java runtime#15006Conversation
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
| def __init__(self, resolve_name: str) -> None: | ||
| super().__init__( | ||
| f"The JVM resolve `{resolve_name}` does not contain a requirement for the protobuf-java " | ||
| "runtime. Since at least one Scala target type in this repository consumes a " |
There was a problem hiding this comment.
Good catch, thanks :)
There was a problem hiding this comment.
Going to make this change over in Scala land too, since Java can consume scala protobuf generated sources
|
Needs category label too on PR. |
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
| "runtime. Since at least one Scala target type in this repository consumes a " | ||
| "runtime. Since at least one JVM target type in this repository consumes a " | ||
| "`protobuf_sources` target in this resolve, the resolve must contain a `jvm_artifact` " | ||
| "target for the protobuf-java` runtime.\n\n Please add the following `jvm_artifact` " |
There was a problem hiding this comment.
Missing leading ` character on "protobuf-java"
|
@tdyas I missed merging this; this would be a good candidate for the new |
Yes. That helper is intended for this exact use case. |
|
Great, I'll see what I can do about adopting that
…On Thu, Apr 7, 2022 at 9:50 AM Tom Dyas ***@***.***> wrote:
@tdyas <https://github.com/tdyas> I missed merging this; this would be a
good candidate for the new find_jvm_artifacts_or_raise method, right?
Yes. That helper is intended for this exact use case.
—
Reply to this email directly, view it on GitHub
<#15006 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEX5XHOICBOZCDW7O4OCZ3VD4G4XANCNFSM5STBEQYA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
| jvm_artifact_targets=jvm_artifact_targets, | ||
| jvm=jvm, | ||
| ) | ||
| return ProtobufJavaRuntimeForResolve(next(iter(addresses))) |
There was a problem hiding this comment.
I ended up switching types similar to ProtobufJavaRuntimeForResolve to take a collection of Address so as to not rely on assuming find_jvm_artifacts_or_raise will return one Address per coordinate provided. See #15110.
|
I removed this from 2.11 mile stone because we decided JVM codegen is not ready to publicize |
|
@chrisjrn : It would be useful to freshen this one up and land it: I've added it as a TODO in an example that a user opened over here: pantsbuild/example-jvm#18 |
# Conflicts: # src/python/pants/backend/codegen/protobuf/scala/dependency_inference.py # src/python/pants/jvm/target_types.py
|
@stuhood I've fixed the conflicts, hopefully will merge before too long. |
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
No description provided.