Releases: bazel-contrib/bazel-gazelle
Releases · bazel-contrib/bazel-gazelle
v0.22.3
Bug fixes
-mode=difftreats empty build files correctly. (thanks @vpanta)- Gazelle should walk subdirectories more quickly when indexing is disabled. (thanks @blico)
- Fixed dependency resolution with mapped kinds. (thanks @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("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
v0.22.2
Compatibility
- Gazelle no longer depends on the deprecated
go_rulefunction from rules_go, which will be removed in 0.25. This should improve compatibility with future versions.
WORKSPACE code
http_archive(
name = "bazel_gazelle",
sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
v0.22.1
Bug fixes
Go
- The version of rules_go may now be inferred from
WORKSPACEif the repositoryio_bazel_rules_gohasn't been fetched yet. - The
gazelle_binaryrule should now work correctly with previous versions of rules_go. - In the
importandimport_aliasnaming conventions, dots will be replaced with underscores in generated test names. This avoids generating targets that have the same names as source files. update-repos -from_file=go.modshould no longer fail mysteriously whengo.modhas areplacedirective that uses a relative path. Local replacements are still not supported though. (thanks @dragonsinth)
WORKSPACE code
http_archive(
name = "bazel_gazelle",
sha256 = "72d339ff874a382f819aaea80669be049069f502d6c726a07759fdca99653c48",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.1/bazel-gazelle-v0.22.1.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.1/bazel-gazelle-v0.22.1.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
v0.22.0
Changes
- The Go extension can now generate targets with a new naming convention.
- In new projects, by default, a library will be named
fooif its import path ends withfooinstead ofgo_default_library. Similarly, a test will be namedfoo_testinstead ofgo_default_test. - Gazelle will attempt to detect the naming convention used in existing projects, so it shouldn't unexpectedly change the naming convention.
- To specify the naming convention explicitly, use the
# gazelle:go_naming_conventiondirective or the-go_naming_conventionflag. Valid values areimport,go_default_library, andimport_alias. Gazelle will rename existing targets the next time it runs after a change. go_repositoryuses theimport_aliasnaming convention by default, so either the old or new names may be used.- Thanks to @tomlu for implementing this.
- In new projects, by default, a library will be named
- Added
# gazelle:go_generate_protodirective, which instructs the Go extension whether to generatego_proto_libraryrules forproto_librarygenerated by the proto extension (thanks @linzhp). - Improved Windows compatibility (thanks @tomlu).
- Language extensions can now provide dependency resolution for other extensions by implementing the
resolve.CrossResolverinterface. This is now used for resolve proto imports in Go (thanks @blico). - In the
update-reposcommand, the-build_directivesflag may be used to set thebuild_directivesattribute on generated repositories (thanks @Helcaraxan). - In the
update-reposcommand, new rules and macros will be inserted higher inWORKSPACE, abovego_rules_dependenciesandgazelle_dependenciesif possible, to make it easier to override indirect dependencies.
Compatibility
gazelle_binaryno longer supports mode attributes such asgoos,race, andgotags. These depended on internal implementation details in rules_go. If you need to build agazelle_binaryfor a platform other than the host, use command-line flags such as--platformsand--@io_bazel_rules_go//go/config:raceor use a transition.
WORKSPACE code
http_archive(
name = "bazel_gazelle",
sha256 = "d4113967ab451dd4d2d767c3ca5f927fec4b30f3b2c6f8135a2033b9c05a5687",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.0/bazel-gazelle-v0.22.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.0/bazel-gazelle-v0.22.0.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
v0.21.1
Bug fixes
- Fixed visibility for Go libraries in
internaldirectories. Previously,
internal visibility was applied to packages in subdirectories ofinternal,
directories, notinternaldirectories themselves. Thanks to @robfig. go_repositoryno longer runscat, andgenrulesare replaced with native
rules to reduce dependence on msys2 on Windows. Thanks to @tomlu.- Cases in
selectexpressions are no longer emitted for platforms that aren't
supported by the current version of rules_go.
v0.21.0
# gazelle:excludedirectives now accept patterns with*and**wildcards. (thanks @kalbasit)- The
-langflag may now be used to select which language extensions should be run. By default, all extensions Gazelle was built with will run. (thanks @robfig) - Attribute matching now works on string slice attributes, not just strings. This is now used to match
proto_libraryrules with one or more sources in common with the generated rule, even if the rule has been renamed. (thanks @linzhp) - Many bugs have been fixed. Thanks to everyone who helped out!
v0.20.0
General changes
- When
update-reposis invoked with-to_macro, Gazelle will add a call to the macro and a# gazelle:repository_macrodirective to WORKSPACE if neither is present.
Go changes
- Gazelle will avoid generating duplicate
go_repositoryrules when two module paths differ only in case. Thanks to @linzhp. - When deriving a repository name from an import path, all non-word characters will be replaced with underscores, not just dots and slashes. Consecutive non-word characters will be collapsed to a single underscore. Thanks to @carnott-snap.
- Imported repository rules are now sorted.
Proto changes
v0.19.1
Changes
- Rule names are now included in
go_repositorystderr output. - Environment variables
SSL_CERT_FILEandSSL_CERT_DIRare passed through to tools used bygo_repository. - The list of standard packages is correctly updated for Go 1.13.
v0.19.0
General changes
- The
# gazelle:repositorydirective is now supported in WORKSPACE files. Gazelle will behave as if a repository rule were declared with the given kind and attributes. This may override other declared rules. This is useful for declaring rules that appear in other files and can't be managed with#gazelle:repository_macro. Thanks to @blico. - The
update-reposcommand now accepts versions for each argument, for example,update-repos github.com/sirupsen/[email protected]. For Go, the version suffixes follow the same format thatgo getaccepts in module mode. Thanks to @weixiao-huang.
Go changes
go_repositoryhas better support for visibility across submodules. For example,cloud.google.com/loggingmay now depend on internal packages incloud.google.com, when both modules are unmodifiedgo_repositoryrules. Previously, this requiredvisibilityattributes to be patched into the parent module.go_repositorynow handles WORKSPACE-based configuration more efficiently. A configuration file is derived from the relevant parts of WORKSPACE and any functions declared with# gazelle:repository_macro.go_repositoryrules are re-evaluated when the configuration file changes, not when WORKSPACE changes. Previously, non-Go-related changes to WORKSPACE would causego_repositoryto be re-evaluated. Thanks to @blico.go_repositorynow accepts abuild_directivesattribute, a list of directives to write into the root build file before running Gazelle. Thanks to @linzhp.- The
# gazelle:go_visibilitydirective may be used to add labels to visibility attributes of Go rules. Thanks to @linzhp. - Generated .go files are no longer included in
go_librarysrcsif they are consumed by another rule through thesrcorsrcsattributes. Thanks to @linzhp.
Proto changes
- Updated dependency resolution tables for know protos.