-
Notifications
You must be signed in to change notification settings - Fork 385
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
Export bzl files with bzl_library to be able to use stardoc #1092
Closed
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d51d2da
Export bzl files with bzl_library to be able to use stardoc
ngeor 523d49e
trying to add gazelle/bzl language
ngeor c9ef4cd
Move skylib definition into WORKSPACE
ngeor 658bd6d
manually removed some private deps added by gazelle/skylib plugin
ngeor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would guess the
1.0.3
tag (from > a year ago) doesn't contain the Gazelle plugin at all. I think you need to grab a more recent commit likedf3c9e2735f02a7fe8cd80db4db00fec8e13d25f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, it still fails with that commit, but also I see the Gazelle plugin existed even in the 1.0.3 tag, i.e. https://github.com/bazelbuild/bazel-skylib/blob/1.0.3/gazelle/bzl/BUILD
I'm a bit new to Bazel so maybe I'm doing something completely wrong.
Is there some possibility that this is causing a circular dependency? You are depending on skylib, they are depending on gazelle, maybe this is Bazel's way of telling me that this isn't going to work. After all, as you're already depending on skylib, why didn't you add support for bzl language inside gazelle to begin with? Maybe someone tried and failed because of this?
Thanks for your help and patience btw :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible but I don't think so (see below). When Bazel has circular deps it prints out a VERY specific error that says
circular dependency detected
and then it renders a graph that shows you the loop that you need to resolve.Truly, you're the one contributing here, you deserve all the praise. Thanks for helping out!
I think the issue is that the version of skylib in this PR doesn't have gazelle. I validated this by cloning your repo and querying for all the targets that live in
@bazel_skylib//...
(basically everything in there).Looking that makes me very suspicious because it looks just like the directory listing for a long time ago. With a little bit more digging I was able to confirm the directory listing is identical to what you get when you grab an old skylib.
Turns out that WORKSPACEs suck and have all kinds of footguns. For example, if you re-register an external workspace that differs from the one that's already been defined it silently ignores your request. I believe that's what is happening here. I can't find the transitive dependency that's wrong, but when I add to the head of the WORKSPACE file right after the
workspace(name = "bazel_gazelle")
line:Everything works immediately. Would you be willing to manually make that change to
WORKSPACE
and run Gazelle?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I would expect Bazel to complain about this... thanks for figuring it out!
So I guess now the question is should I leave the skylib plugin permanently in gazelle or revert it?