-
-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds dependency injection rule for protobuf-java
runtime
#15006
Conversation
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Scala/JVM/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]
@@ -76,7 +76,7 @@ class MissingProtobufJavaRuntimeInResolveError(ValueError): | |||
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 " | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checks out
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.