Releases: bazel-contrib/bazel-gazelle
v0.33.0
What's Changed
- Generate BUILD files for grpc-gateway by default by @seh in #1578
- Remove temporary workaround after rules_go 0.41.0 release by @fmeum in #1577
- bzlmod: Use first host-compatible SDK to bootstrap Gazelle by @fmeum in #1581
- Update: golang.org/x/exp & golang.org/x/oauth2 deps. by @sfc-gh-ptabor in #1582
- [README.rst] Mention kotlin PoC by @kolloch in #1590
- Fix and let
# gazelle:follow
accept a glob by @shahms in #1596 - Add support for isolated
go_deps
usages by @fmeum in #1584 - feat(bzlmod): support archive_override in go_deps by @tyler-french in #1559
- fix: avoid updating
WORKSPACE
file when runningupdate-repos
when bzlmod is enabled by @cgrindel in #1589 - Make
go_deps.from_file
compatible with Go 1.21 by @fmeum in #1605 - go_repository: fix missing default GOPROXY by @sluongng in #1602
- fix: patch support for dir named workspace by @michaellzc in #1606
- Revert "go_repository: fix missing default GOPROXY (#1602)" by @sluongng in #1609
- Upgrade
golang.org/x/mod
Vendor to Support Go 1.21 by @alan910127 in #1611 - fix: go_repository: never shadow a module with a compatibility mapping for major versions. by @reltuk in #1608
- bug fix: don't generate invalid go_binary rules for empty main packages by @andyscott in #1618
- Fix wrong Kotlin Support link in README. by @duckladydinh in #1619
- bzlmod: Verify that the lockfile is platform-independent by @fmeum in #1617
- Add gazelle_rust under supported languages by @Calsign in #1620
- replace golang.org/x/tools with golang.org/x/tools/go/[email protected] by @malt3 in #1603
- Implement Merger interface by @Whoaa512 in #1569
- Improve Gazelle launcher's runfiles discovery on Windows by @fmeum in #1604
- Add an entry for "github.com/googleapis/gax-go/v2" to default_gazelle_overrides.bzl by @andrewmbenton in #1623
- add a go_test directive to enable generating go_test targets per _test.go file by @shahms in #1597
- Detect whether Gazelle itself is a Bazel module by @fmeum in #1624
- prepare release 0.33 by @tyler-french in #1615
New Contributors
- @sfc-gh-ptabor made their first contribution in #1582
- @kolloch made their first contribution in #1590
- @shahms made their first contribution in #1596
- @michaellzc made their first contribution in #1606
- @alan910127 made their first contribution in #1611
- @reltuk made their first contribution in #1608
- @andyscott made their first contribution in #1618
- @duckladydinh made their first contribution in #1619
- @Calsign made their first contribution in #1620
- @malt3 made their first contribution in #1603
- @andrewmbenton made their first contribution in #1623
Full Changelog: v0.32.0...v0.33.0
v0.32.0
Starting this release, Gazelle no longer resolves Go and proto imports of Google APIs to @go_googleapis
. Instead, Go packages from Google APIs will be treated as regular Go packages, and resolve to @org_golang_google_genproto
, which contains the pre-generated Go code, with its version determined by Go modules. For proto files importing Google APIs proto and generating Go code, users need to:
- Add an
http_archive
rule to download Google APIs, e.g.,
http_archive(
name = "googleapis",
sha256 = "9d1a930e767c93c825398b8f8692eca3fe353b9aaadedfbcf1fca2282c85df88",
strip_prefix = "googleapis-64926d52febbf298cb82a8f472ade4a3969ba922",
urls = [
"https://github.com/googleapis/googleapis/archive/64926d52febbf298cb82a8f472ade4a3969ba922.zip",
],
)
load("@googleapis//:repository_rules.bzl", "switched_rules_by_language")
switched_rules_by_language(
name = "com_google_googleapis_imports",
)
Note that the version of Google APIs archive needs to be compatible with the pre-generated code in @org_golang_google_genproto
.
- Resolve the proto manually. If Gazelle is being used, directives like the following need to be added to a parent directory of the proto files:
# gazelle:resolve proto proto google/rpc/status.proto @googleapis//google/rpc:status_proto
# gazelle:resolve proto go google/rpc/status.proto @org_golang_google_genproto//googleapis/rpc/status
# gazelle:resolve proto google/longrunning/operations.proto @googleapis//google/longrunning:operations_proto
# gazelle:resolve proto go google/longrunning/operations.proto @org_golang_google_genproto//googleapis/longrunning
What's Changed
- Decouple Google APIs by @linzhp in #1561
- resolve: Add a resolve_regexp directive by @DolceTriade in #1542
- Remove module dependency on go_googleapis by @linzhp in #1563
- Testing on macOS arm64 by @linzhp in #1568
- Stop resolving to @io_bazel_rules_go//proto/wkt by @linzhp in #1567
- Fix directive table in Readme file by @farhaven in #1571
New Contributors
- @DolceTriade made their first contribution in #1542
- @farhaven made their first contribution in #1571
Full Changelog: v0.31.1...v0.32.0
v0.31.1
What's Changed
- point sync.Once in walkConfig by @jmhodges in #1532
- add copylock vet to nogo by @jmhodges in #1534
- bzlmod: Remove deprecated override attributes on
go_deps.module
by @fmeum in #1548 - Add default directives for github.com/envoyproxy/protoc-gen-validate by @mortenmj in #1553
- cmd/gazelle: do not use the epoch as timestamp in diff output by @siddharthab in #1552
- fileinfo: fix not detecting 'unix' files to be OS specific by @sluongng in #1554
- language/go: Emit apparent repo name of rules_go in select keys by @fmeum in #1555
- Let
bazel_dep
s replace Go deps by @fmeum in #1526
New Contributors
Full Changelog: v0.31.0...v0.31.1
v0.31.0
What's Changed
- feat: allow passing GIT_CONFIG_COUNT and it's related configs by @manuelnaranjo in #1462
- feat(bzlmod): add
module_override
tag to allow patching in go_deps by @tyler-french in #1500 - fix typo
build_proto_file_mode
in message by @tyler-french in #1504 - fix: support running within a dir named workspace by @jbedard in #1498
- fix: check for gazelle command before adding -repo_config flag by @cgrindel in #1501
- language/go: Infer prefix from go.mod by @fmeum in #1497
- don't overwrite directives by @tyler-french in #1503
- Support Bzlmod for gazelle itself by @fmeum in #1509
- language/go: Add windows arm64 as a known platform. by @connyay in #1507
- Adding lifecycle manager by @linzhp in #1475
- Disable protobuf generation for more modules by @seh in #1514
- Support '~' in label repo by @mark-thm in #1518
- language/go: Handle
unix
build tag. by @connyay in #1512 - Pass data arg through to sh_binary if defined by @Preston4tw in #1483
- remove circular override hack by @tyler-french in #1515
- Add major version suffix download example by @kriswuollett in #1453
- Relax parsing of labels by @purkhusid in #1508
- bzlmod: Add
build_file_generation
togazelle_override
by @fmeum in #1522 - Fix incremental build of to bootstrap Gazelle by @fmeum in #1529
- Support macros/rules packed within bazel
struct
by @birunts in #1524 - Prefer non-proto over proto deps in external repos by @fmeum in #1537
- bzlmod: Return
extension_metadata
to automateuse_repo
fixes by @fmeum in #1511 - Fix
go:embed
failing to addembedsrcs
for subdirectories named build by @sgavinio in #1539 - Remove support for godep and dep by @sluongng in #1541
- Avoid putting -repo_config after directories by @linzhp in #1544
- Dropping -args by @linzhp in #1546
New Contributors
- @connyay made their first contribution in #1507
- @mark-thm made their first contribution in #1518
- @Preston4tw made their first contribution in #1483
- @kriswuollett made their first contribution in #1453
- @purkhusid made their first contribution in #1508
- @birunts made their first contribution in #1524
- @sgavinio made their first contribution in #1539
Full Changelog: v0.30.0...v0.31.0
v0.30.0
What's Changed
- fix: add missing Starlark dependency and introduce
bzl_test
by @cgrindel in #1413 - Upgrade rules_go and known imports by @linzhp in #1426
- Regenerate known imports from downgraded go_googleapis by @linzhp in #1429
- testdata with buildable Go pkg deep below by @linzhp in #1433
- language/go: add //go:embed all: support by @mbicz in #1432
- Fix
go mod download
output expectation for errors by @illicitonion in #1442 - Apply map_kind to existing rules as well as new ones by @illicitonion in #1425
- Ignore symlinks into Bazel output rather than relying on name by @cpsauer in #1384
- Use
short_path
forgo
in the wrapper by @fmeum in #1446 - feature: gazelle wrapper allows to pass environment variables by @manuelnaranjo in #1438
- Update directive documentation by @moisesvega in #1454
- Update gazelle directive documenmtation. by @moisesvega in #1455
- Default Visibility extension overwrite on descent (fixes #1467) by @dnathe4th in #1472
- Allow keep to be explained by @stevebarrau in #1447
- Respect repo_name in MODULE.bazel for load generation by @fmeum in #1463
- Add
.ijwb
to.gitignore
by @fmeum in #1478 - Use spaces instead of tabs in go_repositor_tools_srcs.bzl by @fmeum in #1479
- Run buildifier by @fmeum in #1480
- bzlmod: Test BCR test module on all platforms by @fmeum in #1481
- bzlmod: Allow overriding default Go module configuration by @seh in #1456
- fix(bzlmod): apply go.sum sums after version resolution by @tyler-french in #1477
- fix(bzlmod/go_deps): don't read go.sum for empty go.mod files by @tyler-french in #1484
- feat(bzlmod): support go.mod replace directives by @tyler-french in #1450
- README update mentioning gazelle-haskell-modules by @kczulko in #1439
- Exclude
.ijwb
from repository tools srcs by @fmeum in #1490 - bzlmod: Fix interaction between replace and implicit upgrade check by @fmeum in #1492
New Contributors
- @darist made their first contribution in #1410
- @mbicz made their first contribution in #1432
- @cpsauer made their first contribution in #1384
- @manuelnaranjo made their first contribution in #1438
- @moisesvega made their first contribution in #1454
- @stevebarrau made their first contribution in #1447
- @seh made their first contribution in #1456
- @kczulko made their first contribution in #1439
Full Changelog: v0.29.0...v0.30.0
v0.29.0
What's Changed
- bzlmod: Update Publish to BCR app config by @fmeum in #1363
- Fix: Skip default_visibility extension logic if no BUILD.bazel file present by @dnathe4th in #1364
- fix updateStmt makeslice panic by @pcj in #1371
- bzlmod: Add missing
strip_prefix
field tosource.template.json
by @fmeum in #1375 - feat: support common test args in
gazelle_generation_test
by @cgrindel in #1377 - Make the new facts pacakge public by @linzhp in #1378
- fix: add timeout message for
gazelle_generation_test
by @cgrindel in #1383 - bzlmod: Add missing repository metadata by @fmeum in #1387
- Replace
cfg = "host"
withcfg = "exec"
by @fmeum in #1395 - upgrade rules_go to 0.37.0 by @JamyDev in #1386
- Fix embed on windows by @st3veV in #1361
- Update bazel-skylib to 1.3.0. by @benjaminp in #1367
- Fix Directives anchor by @jmthvt in #1353
- Use
patch
from@bazel_tools//tools/build_defs/repo
by @tyler-french in #1381 - Add link to BenchSci's rules_nodejs_gazelle extension by @ColinHeathman in #1369
- bzlmod: Skip Go modules available as Bazel modules by @fmeum in #1403
- repo: opportunistically populate RemoteCache from go.mod by @jayconrod in #1396
- Fix Gazelle with
--incompatible_disallow_empty_glob
by @fmeum in #1405 - chore: remove experimental warning from bzlmod module by @alexeagle in #1406
- chore: add Swift extension to language list by @cgrindel in #1412
- Update everything for release prep, add releaser tool by @dnathe4th in #1373
- adding go version and std_package_list to releaser by @linzhp in #1415
New Contributors
- @damingerdai made their first contribution in #1362
- @st3veV made their first contribution in #1361
- @benjaminp made their first contribution in #1367
- @jmthvt made their first contribution in #1353
- @ColinHeathman made their first contribution in #1369
Full Changelog: v0.28.0...v0.29.0
v0.28.0
What's Changed
- language/proto: gen_known_imports creates structs instead of function calls by @eric-skydio in #1333
- Add DoneGeneratingRules language hook by @illicitonion in #1325
- Allow configuring timeout of generation tests by @illicitonion in #1324
- bug: Allow user-specified tags on gazelle rule by @Helcaraxan in #1308
- Replace _get_auth with Bazel's read_user_netrc by @linzhp in #1338
- language/go should consider default_visibility set by OtherGen (#783) by @dnathe4th in #1341
- fix: pass
visibility
attribute forgazelle
macro to resultingsh_binary
by @cgrindel in #1340 - Add additional bzlmod requirements to allow grpc protobufs to work by @shs96c in #1345
- bzlmod: Simplify go_grpc_library support by @fmeum in #1346
- bzlmod: Add support for custom
go_proto_library
compilers by @fmeum in #1348 - Add visibility extension to support recursive default_visibility (#783) by @dnathe4th in #1343
- Make
gazelle_generation_test
respect out suffix when generating golden files by @blorente in #1352 - Add size argument to
gazelle_generation_test
by @charlesoconor in #1351
New Contributors
- @eric-skydio made their first contribution in #1333
- @dnathe4th made their first contribution in #1341
- @cgrindel made their first contribution in #1340
- @shs96c made their first contribution in #1345
- @blorente made their first contribution in #1352
- @charlesoconor made their first contribution in #1351
Full Changelog: v0.27.0...v0.28.0
v0.27.0
What's Changed
- Use repo-relative labels everywhere by @fmeum in #1294
- Fix RST URL errors for rules_jvm by @qaisjp in #1296
- bzlmod prototype by @fmeum in #1266
- bzlmod: Do not create a repository with an invalid name by @fmeum in #1304
- language/go: Add support for //go:build tags by @thempatel in #1243
- Unwrap
go list -m -json
errors correctly by @fmeum in #1301 - Make one more label repo-relative by @fmeum in #1297
- bzlmod: Add go_deps.from_file by @fmeum in #1300
- language: add BaseLang by @sluongng in #1303
- Allow adding arguments to Rules by @illicitonion in #1310
- Register and parse flags before calling Kinds/Loads by @illicitonion in #1318
- SortMacro() should also sort the Loads by @tyler-french in #1321
- bzlmod: Fix canonical label literal after Bazel change by @fmeum in #1322
- update-repos: don't add repositories declared with gazelle:repository… by @tyler-french in #1326
- Look in call args for loadable symbols by @illicitonion in #1317
- SortMacro() should also sort rules by Kind() by @tyler-french in #1327
- bzlmod: Fix missing .format in go_deps by @fmeum in #1330
- bzlmod: Depend on rules_proto by @fmeum in #1331
New Contributors
Full Changelog: v0.26.0...v0.27.0
v0.26.0
What's Changed
- fix(tests): fix gazelle_generation_test expected stderr update by @jbedard in #1220
- Add an e2e test confirming no output on success by @achew22 in #1216
- Update extend.md with a practical languages example by @Anthony-Bible in #1222
- fix: Remove gazelle_binary import collision by @illicitonion in #1226
- Broaden label name regex by @illicitonion in #1229
- gazelle_generation_test: redact workspace path from output by @dr-dime in #1231
- Add -print0 to print names of rewritten files by @dr-dime in #1213
- Code Quality Improvements by @sluongng in #1197
- Add -strict to exit on build file and directive errors by @dr-dime in #1214
- fix(lang/proto): include imports from different targets by @nickgooding in #1237
- Update rules example in README to v0.25.0 by @yujunz in #1240
- Allow static dependency resolution for Gazelle rule by @uhthomas in #1242
- Handle wrapped errors by @illicitonion in #1234
- Go: Update tests to use cmp.Diff instead of reflect.DeepEqual by @thempatel in #1244
- Fix startup script manifest resolution with --nolegacy_external_runfiles by @jvolkman in #1247
- Label's package may contain @s by @illicitonion in #1249
- Trim runfiles prefix consistently by @uhthomas in #1257
- Respect .bazelignore by @Whoaa512 in #1245
- Implement very minimalistic support for go workspaces by @HakanSunay in #1250
- Fix typo in comment by @yujunz in #1270
- Use
patch
from@bazel_tools//tools/build_defs/repo:utils.bzl
by @bozaro in #1269 - Update rules_go to 0.33.0 by @fmeum in #1263
- Add support for auth_patterns in go_repository by @dmivankov in #1254
- Sluongng/revert patch by @sluongng in #1277
- Stop inferring import path for empty packages by @linzhp in #1280
- Don't exclude spaces from the label name regex by @illicitonion in #1271
New Contributors
- @Anthony-Bible made their first contribution in #1222
- @dr-dime made their first contribution in #1231
- @sluongng made their first contribution in #1197
- @nickgooding made their first contribution in #1237
- @yujunz made their first contribution in #1240
- @uhthomas made their first contribution in #1242
- @thempatel made their first contribution in #1244
- @Whoaa512 made their first contribution in #1245
- @HakanSunay made their first contribution in #1250
- @bozaro made their first contribution in #1269
- @fmeum made their first contribution in #1263
- @dmivankov made their first contribution in #1254
Full Changelog: v0.25.0...v0.26.0
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_gazelle",
sha256 = "501deb3d5695ab658e82f6f6f549ba681ea3ca2a5fb7911154b5aa45596183fa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.26.0/bazel-gazelle-v0.26.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.26.0/bazel-gazelle-v0.26.0.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
############################################################
# Define your own dependencies here using go_repository.
# Else, dependencies declared by rules_go/gazelle will be used.
# The first declaration of an external repository "wins".
############################################################
gazelle_dependencies()
v0.25.0
Go changes
- Introduce static dependency resolution mode which prevents Gazelle from calling out the network.
go_repository
rules now default to this mode, showing significant performance improvements for some repo rules by @blico in #1201 go_repository
rules no longer log Gazelle warnings, unlessdebug
mode is explictly set by @blico in #1205- Support
canonical_id
attribute forgo_repository
by @kmicklas in #1121
Proto changes
General changes
- gazelle_generation_test utility for running the gazelle binary on a set of test workspaces by @aptenodytes-forsteri in #1183
- Introduced
rule.AddAlias
func to support loading aliased symbols by @dorfire in #1127 FixLoad
now generatesload
statements for helper functions by @illicitonion in #1164- Many more bug fixes and documentation updates, thanks to everyone who helped out!
Full Changelog: v0.24.0...v0.25.0
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_gazelle",
sha256 = "5982e5463f171da99e3bdaeff8c0f48283a7a5f396ec5282910b9e8a49c0dd7e",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
############################################################
# Define your own dependencies here using go_repository.
# Else, dependencies declared by rules_go/gazelle will be used.
# The first declaration of an external repository "wins".
############################################################
gazelle_dependencies()