Open froody opened 1 week ago
For this kind of dependency, you could probably just use git_repository
via use_repo_rule
. Does that work for you? The advantage over making it a module is that your build file can directly reference any other deps of your root module.
In my case I have multiple "root" modules, and I want to have a shared set of third-party modules that are easy to access (e.g. via bazel_dep). I don't see how to make use_repo_rule work in a registry entry as it creates a new repo, whereas I want to populate the current module
Description of the feature request:
As defined in https://bazel.build/external/registry, the
git_repository
type doesn't support patches, onlyarchive
does.I am trying to migrate my project to use bazel modules, but I have a lot of third-party deps that don't support bazel at all. For most of these it's possible add a small
build_file_content
tonew_git_repository
, but it seems there's no analog for this with bazel modules. For example, I have this currently in my WORKSPACE file:To create a registry entry for this in my local registry, I can't use
archive
as there's no published release for this git hash, and I can't usegit_repository
because the repo doesn't have a BUILD or MODULE.bazel file. Thus my only option (if I want a registry) is to either make a release and host it somewhere myself, or fork the git repo and commit the BUILD/MODULE.bazel files to that fork. It would be much nicer if I could contain all the module-specific changes in a single location (my local registry).Even nicer would be some syntactic sugar allowing me to specify
build_file_content
in theMODULE.bazel
in the registry without having to add a BUILD or MODULE.bazel files to the repoWhich category does this issue belong to?
No response
What underlying problem are you trying to solve with this feature?
Represent third-party dependencies that don't natively support bazel as modules in my own local registry so I can use these modules from multiple repositories without having to copy-paste a lot of setup code
Which operating system are you running Bazel on?
ubuntu-22.04
What is the output of
bazel info release
?release 7.2.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response