Skip to content
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

Can cel-spec be a dev dependency #11929

Closed
honnix opened this issue Feb 28, 2025 · 10 comments
Closed

Can cel-spec be a dev dependency #11929

honnix opened this issue Feb 28, 2025 · 10 comments
Assignees
Labels

Comments

@honnix
Copy link

honnix commented Feb 28, 2025

Maybe stupid question. Can cel-spec added here https://github.com/grpc/grpc-java/pull/11417/files#diff-6136fc12446089c3db7360e923203dd114b6a1466252e71667c6791c20fe6bdcR51 be a dev dependency, so it doesn't get propagated. It's an old version which makes gazelle unhappy when a project has a later version of cel-spec as a go module: https://github.com/bazel-contrib/bazel-gazelle/blob/a8e48fd344cee0adbff2cc846da972c6d941e397/internal/bzlmod/go_deps.bzl#L612

@kannanjgithub
Copy link
Contributor

You need to add dependency on cel-spec to upgrade it to the version expected by gazelle.

Gazelle is complaining because the versions don't match so you need to make them match. This solely involves your own dependency tree.

@kannanjgithub kannanjgithub removed the bug label Mar 6, 2025
@kannanjgithub
Copy link
Contributor

I hope your concern is resolved. Feel free to comment to reopen the issue in the future if needed.

@honnix
Copy link
Author

honnix commented Mar 19, 2025

I'm not sure it is. My question is whether it is necessary for cel-spec to be a non-dev bazel dependency in grpc-java. I understand how to resolve the inconsistency.

@kannanjgithub kannanjgithub reopened this Mar 19, 2025
@kannanjgithub
Copy link
Contributor

We are using http_archive tool to add the cel-spec dependency and this tool doesn't provide a way of declaring a dependency as a dev dependency.

@honnix
Copy link
Author

honnix commented Mar 20, 2025

We are using http_archive tool to add the cel-spec dependency and this tool doesn't provide a way of declaring a dependency as a dev dependency.

It is defined here

bazel_dep(name = "cel-spec", repo_name = "dev_cel", version = "0.15.0")
, so that should be possible to do. Or maybe I'm looking at the wrong place.

@kannanjgithub
Copy link
Contributor

Thanks for pointing that out, I was going off of the repositories.bzl link in the first post.

@kannanjgithub
Copy link
Contributor

Cel-spec cannot be a dev dependency, it is a real dependency used in the generated code for envoy protos in Xds.

@honnix
Copy link
Author

honnix commented Mar 21, 2025

Thank you for explaining. Can it be left to users to pull in via go.mod and gazelle? The bundled version is pretty old now.

@kannanjgithub
Copy link
Contributor

Our users do not use gazelle. But we need it for both the protos and the non-generated code it has.

You should depend on the newer version of the dep in your own repo. If that doesn't work, then you should file a bug against gazelle, because "that is how bzlmod works".

There's no way we can avoid depending on all dependencies that also have go code.

@honnix
Copy link
Author

honnix commented Mar 25, 2025

Our users do not use gazelle. But we need it for both the protos and the non-generated code it has.

You should depend on the newer version of the dep in your own repo. If that doesn't work, then you should file a bug against gazelle, because "that is how bzlmod works".

There's no way we can avoid depending on all dependencies that also have go code.

Thank you for explaining. I think I understand it better now after working on #11980.

@honnix honnix closed this as completed Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants