Releases: bazel-contrib/bazel-gazelle
v0.40.0
What's Changed
- do not generate an empty rule if a go_proto_library was already gener… by @davidbyttow in #1927
- Support MODULE.bazel test cases for gazelle_generation_test. by @gonzojive in #1948
- Don't call dict.pop() with named arguments by @EdSchouten in #1951
- go_deps should fail with a clear message when 2 modules that only differ in case are used by @Buzz-Lightyear in #1954
- feat: warn when it looks like you're using ignore instead of exclude directive by @alex-torok in #1955
- fix(repo): load repositories should fail on duplicates by @tyler-french in #1937
- Hard failing if module versions aren't aligned between bazel dep and go.mod for a given module by @Buzz-Lightyear in #1957
- Warning users when versions requested via bazel_dep and go.mod differ for the same go module by @Buzz-Lightyear in #1963
- perf: do not revalidate glob expressions on each invocation by @jbedard in #1964
- refactor: add rule.* type assertions by @jbedard in #1961
- Fix Bazel module resolution regression in go_deps by @fmeum in #1966
- go_deps: Support default naming convention override for Bazel modules by @fmeum in #1967
- Issue #1965 - Fix label resolution for non-captured regex by @alandonham in #1969
- Bump rules_go & Bazel deps by @fmeum in #1973
- refactor: change pathTrie per-file to per-directory by @jbedard in #1931
- Support load fixing on struct members (dotexpr) instead of just callexpr by @aaronsky in #1972
- Use rules_shell for shell targets by @ted-xie in #1960
- Remove explicit empty
version
argument by @fmeum in #1974 - Revert to empty version and update repo metadata by @fmeum in #1975
New Contributors
- @gonzojive made their first contribution in #1948
- @alex-torok made their first contribution in #1955
- @aaronsky made their first contribution in #1972
- @ted-xie made their first contribution in #1960
Full Changelog: v0.39.1...v0.40.0
v0.39.1
Updates rules_go
to fix this error:
ERROR: .../external/rules_go~/go/platform/BUILD.bazel: no such target '@@rules_go~//go/platform:qnx': target 'qnx' not declared in package 'go/platform' defined by .../external/rules_go~/go/platform/BUILD.bazel
What's Changed
- override-generator: allow users to specify default values by @tyler-french in #1910
- Update rules_go dep to v0.50.1 by @fmeum in #1943
- Let the Publish to BCR app maintain the module version by @fmeum in #1944
Full Changelog: v0.39.0...v0.39.1
v0.39.0
What's Changed
- Add QNX and OSX to known platforms by @hofbi in #1853
- Allow
+
in repo names by @fmeum in #1856 - go_repository_cache: set GOTOOLCHAIN to 'local' by @lbcjbb in #1859
- Fix Issue #1855: "All Bazel commands fail when changing a Go dependency when using Bzlmod extension" by @Buzz-Lightyear in #1861
- Add default directives for github.com/containerd by @mering in #1866
- Add gazelle-overrides for argo, grpcgateway by @udaya2899 in #1867
- refactor: remove file reference from ruleRecord by @jbedard in #1869
- refactor: compute transitive embeds during indexing by @jbedard in #1868
- refactor: compute labelMap when indexing by @jbedard in #1872
- refactor: remove reference to rule.Rule in mapResolver interface by @jbedard in #1873
- refactor: ensure rule index not modified after indexing by @jbedard in #1877
- docs: fix incorrect gazelle_generation_test param name by @jbedard in #1876
- refactor: embed gazelle generation_test_binary in gazelle_generation_test instead of recompiling by @jbedard in #1875
- refactor: make ruleRecord serializable by @jbedard in #1878
- Add package metadata to
go_repository
s by @fmeum in #1852 - refactor: process KindMap even when not indexing by @jbedard in #1882
- refactor: move walk util methods into struct by @jbedard in #1881
- refactor: add nil assignments to verify interface implementations by @jbedard in #1883
- perf: preload .bazelignore before configure, do not use globs by @jbedard in #1886
- refactor: remove nested walk function literal by @jbedard in #1884
- Preserve canonical labels as such by @fmeum in #1863
- perf: check if directory in .bazelignore before readdir by @jbedard in #1890
- revert #1873 by @tyler-french in #1897
- rename
main()
entrypoints tomain.go
by @tyler-french in #1901 - Support timeout and size in gazelle_test by @rockwotj in #1909
- feat: include package URL in package_info by @alexeagle in #1917
- perf: Improve rule.Kind by @dzbarsky in #1919
- Fix patch file creation using Gazelle in diff mode by @alandonham in #1915
- perf: Improve merger.Mergefile by @dzbarsky in #1920
- test: add bazelignore test by @jbedard in #1912
- perf: walk workspace directories in parallel by @jbedard in #1893
- refactor: reduce path.join while walking repo by @jbedard in #1913
- chore: upgrade go mod dependencies by @jbedard in #1911
- prepare gazelle release 0.39 by @tyler-french in #1925
- Add gazelle overrides to enable building rclone by @dmcardle in #1933
New Contributors
- @hofbi made their first contribution in #1853
- @Buzz-Lightyear made their first contribution in #1861
- @udaya2899 made their first contribution in #1867
- @rockwotj made their first contribution in #1909
- @alandonham made their first contribution in #1915
- @dmcardle made their first contribution in #1933
Full Changelog: v0.38.0...v0.39.0
v0.38.0
What's Changed
- Add support for
include()
inMODULE.bazel
by @fmeum in #1810 - feat: gazelle_test test rule by @hunshcn in #1785
- Handle arm64 host platform for MacOS by @smocherla-brex in #1817
- go_repository: add 'clean' build_file_generation by @TvdW in #1802
- fix: support leading ./ in .bazelignore by @jbedard in #1828
- Restore compatibility with Go 1.18 by @fmeum in #1833
- Remove reliance on specific canonical repo name scheme by @fmeum in #1835
- temporarily disable
//internal:bazel_test
on Mac to fix CI by @tyler-french in #1842 - update readmes for latest release by @tyler-french in #1840
- [Gazelle] Fix Duplicate Load Bug by @ckilian867 in #1841
- [Proto] Require space between 'service' and service name in regex matching by @ckilian867 in #1845
- [Proto] Keep track of the names of Services, Messages, and Enums by @ckilian867 in #1844
- Always check files in generation tests by @Whoaa512 in #1847
- Support label using regexp in directive
gazelle:resolve_regexp
by @lkassar-stripe in #1822 - Add
external/...
prefix to${SRCDIR}
in external repos by @fmeum in #1850 - feat(tools): add a tool to automate the generation of go_deps overrides by @tyler-french in #1677
- prepare release 0.38 by @tyler-french in #1849
New Contributors
- @smocherla-brex made their first contribution in #1817
- @TvdW made their first contribution in #1802
- @ckilian867 made their first contribution in #1841
- @lkassar-stripe made their first contribution in #1822
Full Changelog: v0.37.0...v0.38.0
v0.37.0
What's Changed
- Apply map_kind to args as well as rule kinds by @illicitonion in #1722
- Add a pointer to bzlmod guide by @sluongng in #1781
- [Extraction] prep for go.mod & go.work FilePath ReplaceDirective work by @stefanpenner in #1780
- [cmd/fetch_repo] make cache corruption failures more clear by @tyler-french in #1782
- Nit: pass -modcacherw in exec.Command. by @hauserx in #1784
- Mention JS extension in Aspect CLI by @alexeagle in #1646
- [Feature] bzlmod & go.work by @stefanpenner in #1731
- Add GIT_CONFIG_* env vars to go_repository allow-list by @mortenmj in #1791
- Reformat with latest buildifier by @fmeum in #1792
- [Feature] go.mod FilePath ReplaceDirective Support by @stefanpenner in #1776
- Fix README.rst by @AugustKarlstedt in #1795
- Update README.rst by @AugustKarlstedt in #1796
- Normalise newlines on Windows by @illicitonion in #1798
- Fix go.work use ROOT moddir by @hunshcn in #1800
- allow go_visibility directive to change command package's visibility by @hunshcn in #1794
- Ensure the Gazelle binary is built for the right platform by @EdSchouten in #1803
- Add support for
debug_mode
option togo_deps
by @davidbyttow in #1806 - Remove special resolution of go_proto imports by @linzhp in #1807
- address nogo complaints about variable shadowing by @pmenglund in #1808
- Make
# gazelle:proto file
work without needing to set differentoption go_package
in .proto files by @jeromep-stripe in #1765 - go_deps: ignore go.work toolchain directive by @malt3 in #1809
- prepare release 0.37.0 by @tyler-french in #1812
New Contributors
- @stefanpenner made their first contribution in #1780
- @AugustKarlstedt made their first contribution in #1795
- @hunshcn made their first contribution in #1800
- @EdSchouten made their first contribution in #1803
- @davidbyttow made their first contribution in #1806
- @pmenglund made their first contribution in #1808
- @jeromep-stripe made their first contribution in #1765
Full Changelog: v0.36.0...v0.37.0
v0.36.0
What's Changed
- Test with incompatible flags by @fmeum in #1696
- adding more default gazelle overrides by @linzhp in #1701
- rule: add accessor for attribute comments by @t-8ch in #1700
- rule: set update flag on Rule.AddArg by @t-8ch in #1702
- rule: rename GetAttrComments -> AttrComments by @t-8ch in #1703
- Remove some usage of deprecated ioutil by @dzbarsky in #1704
- Allow passing Gazelle binary as a file by @linzhp in #1706
- rule: allow usage of Label struct with Rule APIs by @t-8ch in #1705
- Remove ioutil usage by @dzbarsky in #1707
- doc: fix link to Swift gazelle plugin by @cgrindel in #1708
- Fix two shellcheck warnings in gazelle.bash.in by @mortenmj in #1710
- implement expression conversions via BzlExprValue interface by @t-8ch in #1714
- update documentation for 0.35 by @tyler-french in #1712
- Update circl to v1.3.7 in tests by @fmeum in #1718
- rule: make value sorting configurable (alternative implementation) by @t-8ch in #1719
- Add check in
update-repos
to omit readingWORKSPACE
on bzlmod only repos. by @Megakuul in #1727 - Add default gazelle override for github.com/cockroachdb/errors. by @fardream in #1728
- README: fix resolve_regexp doc by @sluongng in #1729
- feat(bzlmod): allow
default_gazelle_attributes
forgo_deps
extension by @tyler-french in #1716 - add new std_packages from go 1.22 by @tyler-french in #1740
- fix: wrap generation test labels with Label() by @pedrobarco in #1743
- proto: Add Bzlmod support for well-known types by @fmeum in #1741
- Test BCR with Bazel 6.5.0 and 7.0.2 by @fmeum in #1744
- Set go_naming_convention for cel-go by @riking in #1746
- nit: fix error message in go_repository by @hauserx in #1750
- Add
go_deps.config(env = ...)
as a replacement forgazelle_dependencies(go_env = ...)
by @fmeum in #1748 - Warn if integrity not specified for archive_override by @scaiper in #1753
- Use host module cache whithout build cache and verify it by @scaiper in #1755
- Update default_gazelle_overrides.bzl by @sluongng in #1758
- Mark
go_deps
extension as reproducible by @fmeum in #1761 - Ignore
purego
build constraint by @mattyclarkson in #1767 - Expose path to root
go.mod
to rules_go by @fmeum in #1762 - Fix and expand
reproducible
usage in extensions by @fmeum in #1763 - Add is_bazel_module to deps.bzl. by @spags-lacework in #1771
- prepare release 0.36 by @tyler-french in #1752
New Contributors
- @t-8ch made their first contribution in #1700
- @dzbarsky made their first contribution in #1704
- @Megakuul made their first contribution in #1727
- @fardream made their first contribution in #1728
- @pedrobarco made their first contribution in #1743
- @riking made their first contribution in #1746
- @hauserx made their first contribution in #1750
- @scaiper made their first contribution in #1753
- @mattyclarkson made their first contribution in #1767
- @spags-lacework made their first contribution in #1771
Full Changelog: v0.35.0...v0.36.0
v0.35.0
What's Changed
- Don't run on centos7 in BCR presubmit and add maintainers by @fmeum in #1663
- update readme for v0.34.0 by @tyler-french in #1662
- nit: doc
gazelle_generation_test
use ofarguments.txt
by @vpanta in #1660 - feat(bzlmod): allow patches in
archive_override
s by @tyler-french in #1665 - fix(bzlmod): fail on unused overrides by @tyler-french in #1669
- Annotate more globs with
allow_empty = True
by @fmeum in #1674 - Generate BUILD files for grpc compiler by @mering in #1672
- Disable lockfile check for BCR test module by @fmeum in #1673
- Make isolated extensions usable for Go tools by @fmeum in #1678
- bzlmod: support go.mod replace directives with a version qualifier on the left by @andyscott in #1679
- fix CI by running both WORKSPACE and Bzlmod on select packages by @tyler-french in #1690
- disable lockfile by default by @tyler-french in #1692
- feat(resolve): optimize applying overrides to be efficient by @tyler-french in #1687
- feat(fix-update): allow user to profile commands with
pprof
by @tyler-french in #1685 - Fix partial execution with mapped kinds by @HALtheWise in #1680
- prepare release 0.35.0 by @tyler-french in #1693
New Contributors
Full Changelog: v0.34.0...v0.35.0
v0.34.0
What's Changed
- update readme for v0.33.0 by @tyler-french in #1627
- Remove golang.org/x/crypto dep by @fmeum in #1631
- Fix map_kind with empty rules by @lbcjbb in #1441
- fix: add missing bzl_library declaration and dep by @cgrindel in #1633
- chore: add bzl_test to ensure that bzl_library declarations exist by @cgrindel in #1634
- Set runfiles environment variables for Gazelle by @fmeum in #1632
- address comments from #1597 by @shahms in #1628
- Fix kinds and stmt by @birunts in #1613
- Export workspace file in go_repository_config.bzl by @mortenmj in #1641
- Add github.com/google/gnostic-models to default_gazelle_overrides.bzl by @mortenmj in #1645
- Support parsing labels that begin '@@' by @mark-thm in #1651
- Fix path for google/gnostic-models by @mortenmj in #1652
- fix(bzlmod): allow passing build_extra_args in gazelle_override by @casuallyhostile in #1648
- prepare release 0.34.0 by @tyler-french in #1656
New Contributors
- @casuallyhostile made their first contribution in #1648
Full Changelog: v0.33.0...v0.34.0
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