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

Should bazel_skylib_gazelle_plugin_setup() live elsewhere? #435

Open
cgrindel opened this issue Feb 9, 2023 · 4 comments
Open

Should bazel_skylib_gazelle_plugin_setup() live elsewhere? #435

cgrindel opened this issue Feb 9, 2023 · 4 comments

Comments

@cgrindel
Copy link
Contributor

cgrindel commented Feb 9, 2023

The instructions mention to call the following:

load("@bazel_skylib_gazelle_plugin//:setup.bzl", "bazel_skylib_gazelle_plugin_setup")

bazel_skylib_gazelle_plugin_setup()

This caused an error for me as I already had those same initialization calls in my WORKSPACE. I wonder if we should amend the instructions to only call that if you do not already have a Gazelle extension installed. Alternatively, I wonder if the boilerplate that bazel_skylib_gazelle_plugin_setup() includes should actually live in the bazel-gazelle repository.

@achew22
Copy link
Member

achew22 commented Feb 9, 2023

I think clearly indicating in this repo that it should be omitted would probably be the correct path forward. That said, I think most of this goes away with bzlmod which should solve all the worlds problems ™️

@sudoforge
Copy link

sudoforge commented Jun 22, 2023

sure, but --enable_bzlmod is False by default as of bazel 6.2.1, and even in the "common rules" category of rule libraries, isn't fully supported (e.g. rules_go and gazelle still warn that it is experimental). until those two statements can be inverted, i think leaving a note to avoid calling bazel_skylib_gazelle_plugin will save consumers of the plugin a good few minutes of confusion during initial setup, increasing in time and value proposition when considering less experienced users.

@fmeum
Copy link
Contributor

fmeum commented Jun 22, 2023

rules_go and gazelle both have proper support for Bzlmod by now.

The warnings you see are emitted by old versions that are still fetched during version resolution but not used. Getting rid of them is surprisingly difficult, but bazelbuild/bazel#18698 will realize this for Bazel 6.3.0.

@sudoforge
Copy link

The warnings you see are emitted by old versions that are still fetched during version resolution but not used

Good catch; further review confirms this. I only have bzlmod enabled in a secondary build+test pipeline; I'm not using it by default yet, so I hadn't looked deeper into this.

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

No branches or pull requests

4 participants