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

Allow splitting: gazelle_dependencies() into 2 phases by caller. #1583

Closed

Conversation

sfc-gh-ptabor
Copy link
Contributor

Allow splitting: gazelle_dependencies() into 2 phases by caller:

  • gazelle_init()
  • gazelle_go_repositories()

Thanks to it, the caller can call go_repository in between, loading their own (likely newer) version of the dependencies.

Currently go_repository cannot be called before gazelle_dependencies, as the bazel_gazelle_go_repository_cache is not yet initialized.

Fixes problems like:

What type of PR is this?

Uncomment one line below and remove others.

Bug fix
Feature
Documentation
Other

What package or component does this PR mostly affect?

For example:

language/go
cmd/gazelle
go_repository
all

What does this PR do? Why is it needed?

Which issues(s) does this PR fix?

Fixes #1305

Other notes for review

- gazelle_init()
- gazelle_go_repositories()

Thanks to it, the caller can call go_repository in between,
loading their own (likely newer) version of the dependencies.

Currently `go_repository` cannot be called before `gazelle_dependencies`,
as the `bazel_gazelle_go_repository_cache` is not yet initialized.

Fixes problems like:
  - bazel-contrib#1582
  - bazel-contrib#1468
  - bazel-contrib#1305
  -
@linzhp
Copy link
Contributor

linzhp commented Jul 21, 2023

Currently go_repository cannot be called before gazelle_dependencies, as the bazel_gazelle_go_repository_cache is not yet initialized.

Can you create a mini-repo for this? All of Uber's go_repositories are loaded before gazelle_dependencies and it works

@sfc-gh-ptabor
Copy link
Contributor Author

Couldn't repro. I'm sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Separate go_deps in gazelle_dependencies to gazelle_go_dependencies.
2 participants