-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Description of the feature request:
The git_override MODULE.bazel method does not support pulling data from an external git repo's subdirectory.
This issue came up as I was trying to use a fork of rules_python's rules_python_gazelle_plugin bazel module, which lives in a subdirectory of the repo https://github.com/bazelbuild/rules_python/blob/main/gazelle/MODULE.bazel.
git_override(
module_name = "rules_python_gazelle_plugin",
remote = "https://github.com/dougthor42/rules_python",
commit = "e1677949eca2abe4c37e5f5b2a69529deb44a3d4",
use_subdir = "gazelle", # or something.
)After chatting with @Wyverald about it, it looks like the feature request is to add support for strip_prefex to git_override. However, I haven't fully groked how that would work.
Which category does this issue belong to?
Configurability, Core
What underlying problem are you trying to solve with this feature?
rules_python's gazelle plugin resides in a subdirectory of the rules_python repo.
A naive first attempt at using git_override looks like so:
# MODULE.bazel
bazel_dep(name = "rules_python", version = "0.31.0")
bazel_dep(name = "gazelle", version = "0.35.0", repo_name = "bazel_gazelle")
bazel_dep(name = "rules_python_gazelle_plugin", version = "0.31.0")
git_override(
module_name = "rules_python",
remote = "https://github.com/dougthor42/rules_python",
commit = "e1677949eca2abe4c37e5f5b2a69529deb44a3d4",
)However, this does not update rules_python_gazelle_plugin. So we try adding that too:
git_override(
module_name = "rules_python_gazelle_plugin",
remote = "https://github.com/dougthor42/rules_python",
commit = "e1677949eca2abe4c37e5f5b2a69529deb44a3d4",
)But bazel rightly complains that the module_name provided does not match the module name of the git repo.
So lastly we try to point to the gazelle subdir:
git_override(
module_name = "rules_python_gazelle_plugin",
remote = "https://github.com/dougthor42/rules_python/gazelle",
commit = "e1677949eca2abe4c37e5f5b2a69529deb44a3d4",
)Obviously, this fails because https://github.com/dougthor42/rules_python/gazelle does not exist.
Which operating system are you running Bazel on?
gLinux
What is the output of bazel info release?
release 7.1.1
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
N/A
What's the output of git remote get-url origin; git rev-parse HEAD ?
N/A
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response