-
Notifications
You must be signed in to change notification settings - Fork 166
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
The source for this tutorial is too complicated #388
Comments
Yeah I agree. For now, here is a more minimal example that might help: |
@jamesward do you have the same example for bazel? support for bzlmod with |
The examples in this repo have bazel builds. Let me know if that helps. |
@jamesward I have looked around all examples, but you use the rules but do not setup it up from scratch. I practice with Bzlmod, a new way to maintain the Bazel in the next release 7.0, can you help me to resolve it:
Then I got error while build:
|
Another setup is:
Then when we build:
|
I attempted to get this to work. It is very close but there is a problem with the external dependency name being mangled. This is what I have, in case anyone is able to get something working based on it: # grpc_kotlin.bzl
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def grpc_kotlin():
grpc_kotlin_version = "1.4.1"
http_archive(
name = "com_github_grpc_grpc_kotlin",
urls = ["https://github.com/grpc/grpc-kotlin/archive/refs/tags/v%s.tar.gz" % grpc_kotlin_version],
strip_prefix = "grpc-kotlin-%s" % grpc_kotlin_version,
)
grpc_java_version = "1.60.1"
http_archive(
name = "io_grpc_grpc_java",
urls = ["https://github.com/grpc/grpc-java/archive/refs/tags/v%s.tar.gz" % grpc_java_version],
strip_prefix = "grpc-java-%s" % grpc_java_version,
)
protobuf_version = "25.1"
http_archive(
name = "com_google_protobuf",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protobuf-%s.tar.gz" % protobuf_version],
strip_prefix = "protobuf-%s" % protobuf_version,
)
rules_ruby_version = "0.6.0"
http_archive(
name = "rules_ruby",
strip_prefix = "rules_ruby-%s" % rules_ruby_version,
urls = [
"https://github.com/protocolbuffers/rules_ruby/archive/v%s.zip" % rules_ruby_version,
],
)
def _grpc_kotlin_repositories(ctx):
grpc_kotlin()
grpc_kotlin_dependencies = module_extension(
implementation = _grpc_kotlin_repositories,
) # MODULE.bazel
maven.install(
artifacts = [
"com.google.errorprone:error_prone_annotations:2.3.2",
"com.squareup:kotlinpoet:1.15.3",
"com.google.guava:guava:31.1-jre",
"com.google.guava:failureaccess:1.0.2",
],
generate_compat_repositories = True,
)
use_repo(
maven,
"maven",
"com_google_guava_guava",
"com_google_j2objc_j2objc_annotations",
"com_google_code_findbugs_jsr305",
"com_google_errorprone_error_prone_annotations",
"com_google_guava_failureaccess",
) Fails with:
The output of the query command shows that the target name is mangled, matching the sub-repo naming conventions that bzlmod uses.
I created bazel-contrib/rules_jvm_external#1016 in the hopes that someone can look into the name mangling issue. |
What I needed at least was something more minimal that showed off the project structure that makes sense for a server and client stub. This has lots of dependent modules and it's hard to get your head around how to use it in real life.
The text was updated successfully, but these errors were encountered: