bazel-gazelle icon indicating copy to clipboard operation
bazel-gazelle copied to clipboard

Question: Any support for local repository?

Open prestonvanloon opened this issue 6 years ago • 4 comments

I have a go_repository remote dependency and I want to check it out locally and test some changes. The dependency is not a bazel project and does not have a WORKSPACE so local_repository does not work.

Is there any support for go_repository to reference a path on the host machine?

prestonvanloon avatar Jun 21 '19 14:06 prestonvanloon

#68 and #132 are feature requests to improve the experience with local repository a bit. They've been open a while, but I still think they should be implemented.

We can't generate build files for a local_repository in place. The best workflow here is probably to just cd into that directory, then run gazelle -repo_root=. -go_prefix=example.com/prefix.

I'd rather not support anything that copies a local directory, then generates build files. I can't find the issue, but that's been considered earlier. It's impractical to keep it up to date with local changes.

jayconrod avatar Jun 21 '19 14:06 jayconrod

I wonder if this can be solved with some sym links to the local repository.

go_local_repository(
   name = "localpkg",
   path = "/tmp/localpkg",
)

This could generate the BUILD files in a similar fashion to go_repository, and sym link to the actual files. However, it doesn't solve the issue with keeping things up to date...

Thanks for the quick response. I'll subscribe to those issues and close this out for now.

prestonvanloon avatar Jun 21 '19 17:06 prestonvanloon

I'd like this feature. Can this please be re-opened?

garymm avatar Aug 24 '22 18:08 garymm

Found myself needing this again and the workaround above is rather cumbersome. I'll reopen :smile:

prestonvanloon avatar Jun 12 '24 02:06 prestonvanloon