gazelle

command
v0.0.0-...-5428336 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

README

cmd/gazelle

This is essentially a copy of the files in bazelbuild/bazel-gazelle/cmd/gazelle.

To upgrade gazelle, one must:

  • go get the correct version and update go.mod file
  • make tidy to propagate changes to go.sum and go_repositories.bzl.
  • update the version of @bazel_gazelle in deps/BUILD.bazel, then run make deps to regenerate the actual deps tree.
  • Compare changes in the source repo to the files here. It's easiest to just copy over each file and see where the diffs are. Make sure langs.go includes the github.com/stackb/rules_proto/language/protobuf. Internal packages referenced must also be copied over (ugh). There's probably a more elegant solution to keeping a modified copy of gazelle binary here.
  • Since the proto_gazelle.bzl rule uses @bazel_gazelle//internal:gazelle.bash.in, changes there must remain compatible with proto_gazelle. Look at the diff there and make sure the proto_gazelle_impl is satifying the needs of that template.
  • Remember that this cmd/gazelle must be buildable via the standard go toolchain (see proto_repository_tools.bzl):
    args = [
        go_tool,
        "install",
        "-ldflags",
        "-w -s",
        "-gcflags",
        "all=-trimpath=" + env["GOPATH"],
        "-asmflags",
        "all=-trimpath=" + env["GOPATH"],
        "github.com/stackb/rules_proto/cmd/gazelle",
    ]
    result = env_execute(ctx, args, environment = env)
    if result.return_code:
        fail("failed to build tools: " + result.stderr)

So any and all deps must be in the vendor tree.

Documentation

Overview

Command gazelle is a BUILD file generator for Go projects. See "gazelle --help" for more details.

Directories

Path Synopsis
internal
wspace
Package wspace provides functions to locate and modify a bazel WORKSPACE file.
Package wspace provides functions to locate and modify a bazel WORKSPACE file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL