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

Question: Any support for local repository? #557

Open
prestonvanloon opened this issue Jun 21, 2019 · 4 comments
Open

Question: Any support for local repository? #557

prestonvanloon opened this issue Jun 21, 2019 · 4 comments
Labels

Comments

@prestonvanloon
Copy link

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?

@jayconrod
Copy link
Contributor

#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.

@prestonvanloon
Copy link
Author

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.

@garymm
Copy link

garymm commented Aug 24, 2022

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

@prestonvanloon
Copy link
Author

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

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

3 participants