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

Add bzl_library targets to Gazelle #760

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

achew22
Copy link
Member

@achew22 achew22 commented Apr 16, 2020

What type of PR is this?

Other

What package or component does this PR mostly affect?

all

What does this PR do? Why is it needed?

This adds bzl_library targets for Gazelle. This is useful in generating skydocs.

@achew22 achew22 requested a review from jayconrod as a code owner April 16, 2020 04:04
@jayconrod
Copy link
Contributor

Please open an issue explaining how this is intended to work. I can't really evaluate this without knowing more.

It's likely this needs testing. I don't know whether these bzl_library rules are sufficient, and I won't know if they break in the future.

@achew22
Copy link
Member Author

achew22 commented Apr 16, 2020

It occurs to me that you already have skylib as a dependency in Gazelle, updated PR to reflect what it probably should have looked like in the first place.

Copy link
Contributor

@jayconrod jayconrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple comments and questions.

I've opened #763 and bazel-contrib/rules_go#2437 to track migrating documentation for those projects to Stardoc.

Sorry I don't have bandwidth to work on this now though.

BUILD.bazel Outdated
@@ -68,3 +69,15 @@ filegroup(
],
visibility = ["//visibility:public"],
)

bzl_library(
name = "bzl",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a naming convention for these rules? This doesn't seem descriptive, but I guess if it's just a set of all .bzl files in each package, then it's good to use the same name. Just want to make sure that's what other rulesets are doing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update this to match the convention from @bazel_skylib//gazelle/bzl.

"//internal:bzl",
"@bazel_skylib//lib:shell",
],
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay that this target isn't visible outside the workspace?

@@ -68,3 +69,15 @@ filegroup(
],
visibility = ["//visibility:public"],
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with merging this PR, but I don't understand this well enough to commit to maintaining it yet. So this might change or be removed in the future.

If that's okay with you, please add a TODO:

# TODO(#762): investigate generating stardoc documentation from these files.
# bzl_library targets in this repository may change in the future, so use with caution.

Copy link
Contributor

@jayconrod jayconrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gentle ping.

BUILD.bazel Outdated
@@ -68,3 +69,15 @@ filegroup(
],
visibility = ["//visibility:public"],
)

bzl_library(
name = "bzl",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update this to match the convention from @bazel_skylib//gazelle/bzl.

@achew22
Copy link
Member Author

achew22 commented Oct 20, 2020

@jayconrod, sorry this has become a huge yak shave. I don't know why I thought coordinating 6 CLs between 5 different repos would be easy. Clearly I'm an idiot 🤦 .

Here are my kafka-esque yaks:

Which will then culminate in me trying to get stardoc to generate documentation for rules_go that is as nice as the hand written docs that you've got.

My kingdom for a nicely formatted build encyclopedia...


WRT this PR, I've regenerated so we can inspect the generated output. I didn't realize that there were more places in Gazelle that depend on @io_bazel_rules_go//go/private:common 😦 . Maybe I can get around this by explicitly adding visibility for gazelle in the rules.

It's possible that we could advance on this by just cutting deps off, but in my experimentation with skydoc it requires ALL your dependencies to be available. We could definitely get many of them and start iterating on getting the rest as soon as possible, but it will leave that last hop of skydocifying as a todo.

@jayconrod
Copy link
Contributor

Expose the .bzl files in @bazel_tools so that these can actually be depended on by deps.bzl

Would this mean that Gazelle and rules_go wouldn't work with older versions of Bazel, since we'd reference bzl_library targets that aren't present? I'd like to maintain a decently long compatibility window.

WRT this PR, I've regenerated so we can inspect the generated output. I didn't realize that there were more places in Gazelle that depend on @io_bazel_rules_go//go/private:common 😦 . Maybe I can get around this by explicitly adding visibility for gazelle in the rules.

Probably better to just copy definitions from @io_bazel_rules_go//go/private instead of referencing them. I think that's just technical debt from when Gazelle was split out of rules_go.

It's possible that we could advance on this by just cutting deps off, but in my experimentation with skydoc it requires ALL your dependencies to be available. We could definitely get many of them and start iterating on getting the rest as soon as possible, but it will leave that last hop of skydocifying as a todo.

That seems like kind of unfortunate behavior. I don't know much about Skydoc, but is there any way around the all-or-nothing requirement?

@achew22
Copy link
Member Author

achew22 commented Oct 22, 2020

Would this mean that Gazelle and rules_go wouldn't work with older versions of Bazel, since we'd reference bzl_library targets that aren't present? I'd like to maintain a decently long compatibility window.

I believe this would restrict your ability to generate the docs, but would not restrict your ability to use Gazelle.

Probably better to just copy definitions from @io_bazel_rules_go//go/private instead of referencing them. I think that's just technical debt from when Gazelle was split out of rules_go.

I've expanded this CL to do just that.

That seems like kind of unfortunate behavior. I don't know much about Skydoc, but is there any way around the all-or-nothing requirement?

Unfortunately Stardoc basically starts up the same engine that does .bzl parsing in Bazel and asks it to print out the starlark function. Without adding a mode to Bazel where you can ignore dependencies, I don't think that's possible. There is a significant rewrite on the horizon, but it isn't yet scheduled, has no headcount, and doesn't appear to be on any OKRs. I think going this route will end up being less painful unfortunately.

I've got the repos in a much better state now. This CL now passes when I --override_repository rules_go, but I think we should hold off on submitting this until we can get a rules_go release that includes bazel-contrib/rules_go#2621 rather than try and shim things.

@achew22
Copy link
Member Author

achew22 commented Oct 22, 2020

Last bit of progress before bed. I've gotten quite a bit farther on getting stardoc to crash. bazelbuild/stardoc#76 if you would like to see the latest error.

Bedtime now.

achew22 added a commit to achew22/rules_cc that referenced this pull request Oct 29, 2020
This is to allow people who transitively depend on this repo to use
stardoc to generate documentation for their Bazel targets.

For the origin of this commit, please see
bazel-contrib/bazel-gazelle#760 (comment)
and the linked PRs in that thread.
@achew22
Copy link
Member Author

achew22 commented Oct 29, 2020

There is, in fact light at the end of this tunnel! With all the PRs linked above, a custom compiled bazel binary, about a hundred instances of --overrides_repository, exactly 1 line of code changed in rules_go to satisfy the parser, and many more hours of keyboard durability testing with my forehead I was able to generate some markdown for def.bzl in the rules_go package.

It's not perfect, but it's a damn good start. Also, it looks like doc inheritance is going to be a thing that needs to be fixed before the gazelle/rules_go docs can be migrated. I'll start putting something together on that front soon.

I've attached the .md file, renamed to .txt, that was generated in @io_bazel_rules_go//go/BUILD.bazel by:
def_doc.md.txt

load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")

stardoc(
    name = "def-docs",
    out = "def_doc.md",
    input = "def.bzl",
    deps = [
        "//extras:embed_data",
        "//go/private:context",
        "//go/private:go_toolchain",
        "//go/private:providers",
        "//go/private/rules:library",
        "//go/private/rules:nogo",
        "//go/private/rules:sdk",
        "//go/private/rules:source",
        "//go/private/rules:wrappers",
        "//go/private/tools:path",
    ],
)

@jayconrod
Copy link
Contributor

Cool! Looks like it's gotten pretty far.

Doesn't seem to be able to tunnel through macros like go_binary. I'm not sure how it could do that though without an explicit hint.

@achew22
Copy link
Member Author

achew22 commented Oct 29, 2020

Yeah, I think that's [doc inheritance] (bazelbuild/stardoc#27). In that bug they have a proposed syntax that looks basically like a docstring @inherit(symbol_name) which seems fine to me.

achew22 added a commit to achew22/rules_cc that referenced this pull request Oct 31, 2020
This is to allow people who transitively depend on this repo to use
stardoc to generate documentation for their Bazel targets.

For the origin of this commit, please see
bazel-contrib/bazel-gazelle#760 (comment)
and the linked PRs in that thread.
achew22 added a commit to achew22/rules_cc that referenced this pull request Nov 10, 2020
This is to allow people who transitively depend on this repo to use
stardoc to generate documentation for their Bazel targets.

For the origin of this commit, please see
bazel-contrib/bazel-gazelle#760 (comment)
and the linked PRs in that thread.
achew22 added a commit to achew22/rules_go that referenced this pull request Nov 10, 2020
This is a part of bazel-contrib/bazel-gazelle#760.

To update the copy in the bazel mirror:

```
cd $(mktemp -d)
wget https://github.com/bazelbuild/rules_cc/archive/7bd0e49cfb2237086df89dca9e6ba7a5a5dfb36d.zip
gsutil cp 02becfef8bc97bda4f9bb64e153f1b0671aec4ba.zip gs://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/02becfef8bc97bda4f9bb64e153f1b0671aec4ba.zip
```

Fixed: bazel-contrib#2711
@UebelAndre
Copy link

So with bazel-contrib/rules_go#2712 closed, is there still a lot of outstanding work to be done on this PR?

@achew22
Copy link
Member Author

achew22 commented Dec 3, 2020

If you look at #760 (comment) you can see a list of things to do. Unfortunately the changes that were merged into rules_cc are insufficient since they are not publicly visible so we need to fix that before Gazelle can get bzl_library targets.

@UebelAndre
Copy link

Hey, I have a hard time understanding what code is where exactly, but were the bzl_library targets added to rules_cc? And released? The release is the biggest mystery for me.

@achew22
Copy link
Member Author

achew22 commented Dec 23, 2020

The bzl_library targets can be found here https://github.com/bazelbuild/rules_cc/search?q=bzl_library. Check the blame layer to find the commit associated with them and see what tags that's a part of.

@UebelAndre
Copy link

Does rules_cc have tags? I looked at the blame and don't know how to pair it back to a version of Bazel. It's been in for 2 months now so I'm assuming it's available?

@achew22
Copy link
Member Author

achew22 commented Dec 23, 2020

I do not work on rules_cc so I have no information on the subject. Best of luck!

@UebelAndre
Copy link

I do not work on rules_cc so I have no information on the subject. Best of luck!

I'm thoroughly confused by your response. Did you not write #760 (comment) ? Is this PR forever blocked because you don't know how to tell if the next task is complete or not? Why even open bazelbuild/rules_cc#87 if you had no way to know whether or not the changes would be usable?

@UebelAndre
Copy link

Sorry, not tying to be obnoxious, this PR is blocking my ability to generate documentation through Stardoc. It seems like all the blockers are satisfied for completing this PR so I'd hugely appreciate seeing this go through 🙏 😅

@achew22
Copy link
Member Author

achew22 commented Jan 8, 2021

Unfortunately, there are still blockers. It is not possible to depend on rules_cc's targets because they are marked as private. They can not be depended upon by this repo, nor any other repo.

This allows external parties to use Gazelle to generate bzl_library
targets that depend on Gazelle and installs the `skylib` generator in
the Gazelle repo.

Co-authored-by: Nikolaos Georgiou <Nikolaos.Georgiou@gmail.com>
@google-cla
Copy link

google-cla bot commented Aug 19, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@UebelAndre
Copy link

UebelAndre commented Aug 19, 2021

Unfortunately, there are still blockers. It is not possible to depend on rules_cc's targets because they are marked as private. They can not be depended upon by this repo, nor any other repo.

The *.bzl sources of rules_cc now publicly visible as of bazelbuild/rules_cc@d66a13e

@ngeor
Copy link
Contributor

ngeor commented Aug 20, 2021

@googlebot I consent

@achew22 achew22 merged commit 3e83644 into bazel-contrib:master Aug 20, 2021
@achew22 achew22 deleted the bzl_library branch August 20, 2021 17:56
achew22 added a commit to achew22/rules_go that referenced this pull request Aug 20, 2021
With bazel-contrib/bazel-gazelle#760 submitted, it
should now be possible to use stardoc to generate documentation for
rules_go and gazelle.
achew22 added a commit to achew22/rules_go that referenced this pull request Aug 20, 2021
With bazel-contrib/bazel-gazelle#760 submitted, it
should now be possible to use stardoc to generate documentation for
rules_go and gazelle.
achew22 added a commit to achew22/rules_go that referenced this pull request Aug 20, 2021
With bazel-contrib/bazel-gazelle#760 submitted, it
should now be possible to use stardoc to generate documentation for
rules_go and gazelle.
gcf-merge-on-green bot referenced this pull request in googleapis/gapic-config-validator Oct 11, 2021
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bazel_gazelle](https://togithub.com/bazelbuild/bazel-gazelle) | http_archive | minor | `v0.22.2` -> `v0.24.0` |

---

### Release Notes

<details>
<summary>bazelbuild/bazel-gazelle</summary>

### [`v0.24.0`](https://togithub.com/bazelbuild/bazel-gazelle/releases/v0.24.0)

[Compare Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.23.0...v0.24.0)

This release requires [rules_go 0.29](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.29.0) to support the retirement of `go_tool_library`.

#### Changes

-   .netrc files are now supported for authenticated access for `go_repository` rules ([#&#8203;1090](https://togithub.com/bazelbuild/bazel-gazelle/issues/1090))
-   There is now a Gazelle extension for authoring BUILD files for the R language, using [rules_r](https://togithub.com/grailbio/rules_r).

#### Fixes

-   language/go: don't let 'go mod download' edit go.sum by [@&#8203;jayconrod](https://togithub.com/jayconrod) in [https://github.com/bazelbuild/bazel-gazelle/pull/1015](https://togithub.com/bazelbuild/bazel-gazelle/pull/1015)
-   Label fix: properly parse external references to the main repository by [@&#8203;tfrench-uber](https://togithub.com/tfrench-uber) in [https://github.com/bazelbuild/bazel-gazelle/pull/1006](https://togithub.com/bazelbuild/bazel-gazelle/pull/1006)
-   gazelle: add -e flag for go list 1.16 by [@&#8203;axelberardino](https://togithub.com/axelberardino) in [https://github.com/bazelbuild/bazel-gazelle/pull/1019](https://togithub.com/bazelbuild/bazel-gazelle/pull/1019)
-   Correctly propagate runfiles from gazelle_bin to gazelle by [@&#8203;HALtheWise](https://togithub.com/HALtheWise) in [https://github.com/bazelbuild/bazel-gazelle/pull/1008](https://togithub.com/bazelbuild/bazel-gazelle/pull/1008)
-   Support Label [@&#8203;repo](https://togithub.com/repo) -> @&#8203;repo//:repo shorthand by [@&#8203;wolfd](https://togithub.com/wolfd) in [https://github.com/bazelbuild/bazel-gazelle/pull/1023](https://togithub.com/bazelbuild/bazel-gazelle/pull/1023)
-   language/go: rewrite embedResolver to use a tree structure by [@&#8203;jayconrod](https://togithub.com/jayconrod) in [https://github.com/bazelbuild/bazel-gazelle/pull/1024](https://togithub.com/bazelbuild/bazel-gazelle/pull/1024)
-   Respect .bazelignore by [@&#8203;Michaelhobo](https://togithub.com/Michaelhobo) in [https://github.com/bazelbuild/bazel-gazelle/pull/1022](https://togithub.com/bazelbuild/bazel-gazelle/pull/1022)
-   Change merge behavior to remove attrs instead of panicking by [@&#8203;wolfd](https://togithub.com/wolfd) in [https://github.com/bazelbuild/bazel-gazelle/pull/1031](https://togithub.com/bazelbuild/bazel-gazelle/pull/1031)
-   Allow ListRepositories to load macros not in Workspace by [@&#8203;tfrench-uber](https://togithub.com/tfrench-uber) in [https://github.com/bazelbuild/bazel-gazelle/pull/1053](https://togithub.com/bazelbuild/bazel-gazelle/pull/1053)
-   Honor host GOMODCACHE when GO_REPOSITORY_USE_HOST_CACHE by [@&#8203;linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/bazel-gazelle/pull/1069](https://togithub.com/bazelbuild/bazel-gazelle/pull/1069)
-   language/go: add golang.org/x/tools/internal/typeparams to nogo deps list by [@&#8203;jayconrod](https://togithub.com/jayconrod) in [https://github.com/bazelbuild/bazel-gazelle/pull/1074](https://togithub.com/bazelbuild/bazel-gazelle/pull/1074)
-   Fix "exclude" token parsing by [@&#8203;gibfahn](https://togithub.com/gibfahn) in [https://github.com/bazelbuild/bazel-gazelle/pull/1073](https://togithub.com/bazelbuild/bazel-gazelle/pull/1073)
-   Have label properly resolve directives starting with "@&#8203;//" by [@&#8203;tfrench-uber](https://togithub.com/tfrench-uber) in [https://github.com/bazelbuild/bazel-gazelle/pull/1086](https://togithub.com/bazelbuild/bazel-gazelle/pull/1086)
-   Correctly propagate runfiles from data dependencies to gazelle by [@&#8203;alexeagle](https://togithub.com/alexeagle) in [https://github.com/bazelbuild/bazel-gazelle/pull/1094](https://togithub.com/bazelbuild/bazel-gazelle/pull/1094)
-   Add bzl_library targets to Gazelle by [@&#8203;achew22](https://togithub.com/achew22) in [https://github.com/bazelbuild/bazel-gazelle/pull/760](https://togithub.com/bazelbuild/bazel-gazelle/pull/760)
-   Escape vars in cgo flags with an extra $ by [@&#8203;dierksen](https://togithub.com/dierksen) in [https://github.com/bazelbuild/bazel-gazelle/pull/1107](https://togithub.com/bazelbuild/bazel-gazelle/pull/1107)
-   autogazelle can build on windows by [@&#8203;asuffield](https://togithub.com/asuffield) in [https://github.com/bazelbuild/bazel-gazelle/pull/1083](https://togithub.com/bazelbuild/bazel-gazelle/pull/1083)
-   and many documentation updates by [@&#8203;tanyabouman](https://togithub.com/tanyabouman)

**Full Changelog**: bazel-contrib/bazel-gazelle@v0.23.0...v0.24.0

#### `WORKSPACE` code

    load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

    http_archive(
        name = "bazel_gazelle",
        sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
            "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
        ],
    )

    load("@&#8203;bazel_gazelle//:deps.bzl", "gazelle_dependencies")

    gazelle_dependencies()

### [`v0.23.0`](https://togithub.com/bazelbuild/bazel-gazelle/releases/v0.23.0)

[Compare Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.22.3...v0.23.0)

#### Changes

-   Go
    -   `CXXFLAGS` and `CPPFLAGS` `#cgo` directives are separated into `cxxopts` and `cppopts` attributes, respectively. Thanks [@&#8203;otan](https://togithub.com/otan).
    -   Dependencies on mapped kinds are now supported. Thanks [@&#8203;robfig](https://togithub.com/robfig).
    -   The `gazelle` rule now supports the `update-repos` command.
    -   The `gazelle` rule now has a `data` attribute and expands `$(location)` within arguments.
    -   `go_repository`'s `build_naming_convention` is now considered when resolving external dependencies. If a repository already has build files, this attribute may be set to indicate which naming convention it follows.
    -   `embedsrcs` attributes are generated for packages that contain `//go:embed` directives.
-   Protobuf
    -   `proto_strip_import_prefix` may be set in the root build file. Thanks [@&#8203;linzhp](https://togithub.com/linzhp).

#### `WORKSPACE` code

    load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

    http_archive(
        name = "bazel_gazelle",
        sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
            "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
        ],
    )

    load("@&#8203;bazel_gazelle//:deps.bzl", "gazelle_dependencies")

    gazelle_dependencies()

### [`v0.22.3`](https://togithub.com/bazelbuild/bazel-gazelle/releases/v0.22.3)

[Compare Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.22.2...v0.22.3)

#### Bug fixes

-   `-mode=diff` treats empty build files correctly. (thanks [@&#8203;vpanta](https://togithub.com/vpanta))
-   Gazelle should walk subdirectories more quickly when indexing is disabled. (thanks [@&#8203;blico](https://togithub.com/blico))
-   Fixed dependency resolution with mapped kinds. (thanks [@&#8203;robfig](https://togithub.com/robfig))
-   Compatibility fixes for Go 1.16.

#### WORKSPACE code

    http_archive(
        name = "bazel_gazelle",
        sha256 = "222e49f034ca7a1d1231422cdb67066b885819885c356673cb1f72f748a3c9d4",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
            "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
        ],
    )

    load("@&#8203;bazel_gazelle//:deps.bzl", "gazelle_dependencies")
    gazelle_dependencies()

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-config-validator).
gcf-merge-on-green bot referenced this pull request in googleapis/gapic-generator-go Oct 11, 2021
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [bazel_gazelle](https://togithub.com/bazelbuild/bazel-gazelle) | http_archive | minor | `v0.22.2` -> `v0.24.0` |

---

### Release Notes

<details>
<summary>bazelbuild/bazel-gazelle</summary>

### [`v0.24.0`](https://togithub.com/bazelbuild/bazel-gazelle/releases/v0.24.0)

[Compare Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.23.0...v0.24.0)

This release requires [rules_go 0.29](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.29.0) to support the retirement of `go_tool_library`.

#### Changes

-   .netrc files are now supported for authenticated access for `go_repository` rules ([#&#8203;1090](https://togithub.com/bazelbuild/bazel-gazelle/issues/1090))
-   There is now a Gazelle extension for authoring BUILD files for the R language, using [rules_r](https://togithub.com/grailbio/rules_r).

#### Fixes

-   language/go: don't let 'go mod download' edit go.sum by [@&#8203;jayconrod](https://togithub.com/jayconrod) in [https://github.com/bazelbuild/bazel-gazelle/pull/1015](https://togithub.com/bazelbuild/bazel-gazelle/pull/1015)
-   Label fix: properly parse external references to the main repository by [@&#8203;tfrench-uber](https://togithub.com/tfrench-uber) in [https://github.com/bazelbuild/bazel-gazelle/pull/1006](https://togithub.com/bazelbuild/bazel-gazelle/pull/1006)
-   gazelle: add -e flag for go list 1.16 by [@&#8203;axelberardino](https://togithub.com/axelberardino) in [https://github.com/bazelbuild/bazel-gazelle/pull/1019](https://togithub.com/bazelbuild/bazel-gazelle/pull/1019)
-   Correctly propagate runfiles from gazelle_bin to gazelle by [@&#8203;HALtheWise](https://togithub.com/HALtheWise) in [https://github.com/bazelbuild/bazel-gazelle/pull/1008](https://togithub.com/bazelbuild/bazel-gazelle/pull/1008)
-   Support Label [@&#8203;repo](https://togithub.com/repo) -> @&#8203;repo//:repo shorthand by [@&#8203;wolfd](https://togithub.com/wolfd) in [https://github.com/bazelbuild/bazel-gazelle/pull/1023](https://togithub.com/bazelbuild/bazel-gazelle/pull/1023)
-   language/go: rewrite embedResolver to use a tree structure by [@&#8203;jayconrod](https://togithub.com/jayconrod) in [https://github.com/bazelbuild/bazel-gazelle/pull/1024](https://togithub.com/bazelbuild/bazel-gazelle/pull/1024)
-   Respect .bazelignore by [@&#8203;Michaelhobo](https://togithub.com/Michaelhobo) in [https://github.com/bazelbuild/bazel-gazelle/pull/1022](https://togithub.com/bazelbuild/bazel-gazelle/pull/1022)
-   Change merge behavior to remove attrs instead of panicking by [@&#8203;wolfd](https://togithub.com/wolfd) in [https://github.com/bazelbuild/bazel-gazelle/pull/1031](https://togithub.com/bazelbuild/bazel-gazelle/pull/1031)
-   Allow ListRepositories to load macros not in Workspace by [@&#8203;tfrench-uber](https://togithub.com/tfrench-uber) in [https://github.com/bazelbuild/bazel-gazelle/pull/1053](https://togithub.com/bazelbuild/bazel-gazelle/pull/1053)
-   Honor host GOMODCACHE when GO_REPOSITORY_USE_HOST_CACHE by [@&#8203;linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/bazel-gazelle/pull/1069](https://togithub.com/bazelbuild/bazel-gazelle/pull/1069)
-   language/go: add golang.org/x/tools/internal/typeparams to nogo deps list by [@&#8203;jayconrod](https://togithub.com/jayconrod) in [https://github.com/bazelbuild/bazel-gazelle/pull/1074](https://togithub.com/bazelbuild/bazel-gazelle/pull/1074)
-   Fix "exclude" token parsing by [@&#8203;gibfahn](https://togithub.com/gibfahn) in [https://github.com/bazelbuild/bazel-gazelle/pull/1073](https://togithub.com/bazelbuild/bazel-gazelle/pull/1073)
-   Have label properly resolve directives starting with "@&#8203;//" by [@&#8203;tfrench-uber](https://togithub.com/tfrench-uber) in [https://github.com/bazelbuild/bazel-gazelle/pull/1086](https://togithub.com/bazelbuild/bazel-gazelle/pull/1086)
-   Correctly propagate runfiles from data dependencies to gazelle by [@&#8203;alexeagle](https://togithub.com/alexeagle) in [https://github.com/bazelbuild/bazel-gazelle/pull/1094](https://togithub.com/bazelbuild/bazel-gazelle/pull/1094)
-   Add bzl_library targets to Gazelle by [@&#8203;achew22](https://togithub.com/achew22) in [https://github.com/bazelbuild/bazel-gazelle/pull/760](https://togithub.com/bazelbuild/bazel-gazelle/pull/760)
-   Escape vars in cgo flags with an extra $ by [@&#8203;dierksen](https://togithub.com/dierksen) in [https://github.com/bazelbuild/bazel-gazelle/pull/1107](https://togithub.com/bazelbuild/bazel-gazelle/pull/1107)
-   autogazelle can build on windows by [@&#8203;asuffield](https://togithub.com/asuffield) in [https://github.com/bazelbuild/bazel-gazelle/pull/1083](https://togithub.com/bazelbuild/bazel-gazelle/pull/1083)
-   and many documentation updates by [@&#8203;tanyabouman](https://togithub.com/tanyabouman)

**Full Changelog**: bazel-contrib/bazel-gazelle@v0.23.0...v0.24.0

#### `WORKSPACE` code

    load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

    http_archive(
        name = "bazel_gazelle",
        sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
            "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
        ],
    )

    load("@&#8203;bazel_gazelle//:deps.bzl", "gazelle_dependencies")

    gazelle_dependencies()

### [`v0.23.0`](https://togithub.com/bazelbuild/bazel-gazelle/releases/v0.23.0)

[Compare Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.22.3...v0.23.0)

#### Changes

-   Go
    -   `CXXFLAGS` and `CPPFLAGS` `#cgo` directives are separated into `cxxopts` and `cppopts` attributes, respectively. Thanks [@&#8203;otan](https://togithub.com/otan).
    -   Dependencies on mapped kinds are now supported. Thanks [@&#8203;robfig](https://togithub.com/robfig).
    -   The `gazelle` rule now supports the `update-repos` command.
    -   The `gazelle` rule now has a `data` attribute and expands `$(location)` within arguments.
    -   `go_repository`'s `build_naming_convention` is now considered when resolving external dependencies. If a repository already has build files, this attribute may be set to indicate which naming convention it follows.
    -   `embedsrcs` attributes are generated for packages that contain `//go:embed` directives.
-   Protobuf
    -   `proto_strip_import_prefix` may be set in the root build file. Thanks [@&#8203;linzhp](https://togithub.com/linzhp).

#### `WORKSPACE` code

    load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

    http_archive(
        name = "bazel_gazelle",
        sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
            "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
        ],
    )

    load("@&#8203;bazel_gazelle//:deps.bzl", "gazelle_dependencies")

    gazelle_dependencies()

### [`v0.22.3`](https://togithub.com/bazelbuild/bazel-gazelle/releases/v0.22.3)

[Compare Source](https://togithub.com/bazelbuild/bazel-gazelle/compare/v0.22.2...v0.22.3)

#### Bug fixes

-   `-mode=diff` treats empty build files correctly. (thanks [@&#8203;vpanta](https://togithub.com/vpanta))
-   Gazelle should walk subdirectories more quickly when indexing is disabled. (thanks [@&#8203;blico](https://togithub.com/blico))
-   Fixed dependency resolution with mapped kinds. (thanks [@&#8203;robfig](https://togithub.com/robfig))
-   Compatibility fixes for Go 1.16.

#### WORKSPACE code

    http_archive(
        name = "bazel_gazelle",
        sha256 = "222e49f034ca7a1d1231422cdb67066b885819885c356673cb1f72f748a3c9d4",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
            "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
        ],
    )

    load("@&#8203;bazel_gazelle//:deps.bzl", "gazelle_dependencies")
    gazelle_dependencies()

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-go).
achew22 added a commit to bazel-contrib/rules_go that referenced this pull request Oct 15, 2021
* Update `bzl_library` targets

With bazel-contrib/bazel-gazelle#760 submitted, it
should now be possible to use stardoc to generate documentation for
rules_go and gazelle.
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.

4 participants