Skip to content

Commit

Permalink
Remove gazelle and its deps from go_rules_dependencies (#1659)
Browse files Browse the repository at this point in the history
go_rules_dependencies no longer declares the following repositories:

* bazel_gazelle
* com_github_bazelbuild_buildtools
* com_github_pelletier_go_toml

The "gazelle" rule is removed from //go:def.bzl. It has been
deprecated for some time, and "gazelle fix" replaces it.
  • Loading branch information
jayconrod committed Aug 15, 2018
1 parent 7dc1d30 commit f6c1878
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 165 deletions.
8 changes: 1 addition & 7 deletions BUILD.bazel
@@ -1,4 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "gazelle", "go_path", "go_vet_test")
load("@io_bazel_rules_go//go:def.bzl", "go_path", "go_vet_test")
load("@io_bazel_rules_go//go/private:tools/lines_sorted_test.bzl", "lines_sorted_test")
load("@io_bazel_rules_go//go/private:rules/info.bzl", "go_info")
load("@io_bazel_rules_go//go/private:context.bzl", "go_context_data")
Expand All @@ -25,8 +25,6 @@ go_context_data(
visibility = ["//visibility:public"],
)

# gazelle:prefix github.com/bazelbuild/rules_go

lines_sorted_test(
name = "contributors_sorted_test",
size = "small",
Expand All @@ -43,10 +41,6 @@ lines_sorted_test(
file = "AUTHORS",
)

gazelle(
name = "gazelle",
)

# This could be any file, used as an anchor point for the directory in tests
exports_files(["AUTHORS"])

Expand Down
8 changes: 7 additions & 1 deletion WORKSPACE
@@ -1,14 +1,20 @@
workspace(name = "io_bazel_rules_go")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@io_bazel_rules_go//proto:def.bzl", "proto_register_toolchains")

go_rules_dependencies()

go_register_toolchains()

# Needed for tests
http_archive(
name = "bazel_gazelle",
sha256 = "c0a5739d12c6d05b6c1ad56f2200cb0b57c5a70e03ebd2f7b87ce88cabf09c7b",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.14.0/bazel-gazelle-0.14.0.tar.gz"],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

gazelle_dependencies()
Expand Down
28 changes: 14 additions & 14 deletions deprecation.rst
Expand Up @@ -8,12 +8,18 @@ Deprecation schedule
.. _bazelbuild/bazel-bazelle#186: https://github.com/bazelbuild/bazel-gazelle/issues/186

This document lists public interfaces and features that are deprecated and will
be removed soon. For each item in this document, the deprecation rationale is
listed, along with the last supported rules_go release and the release when the
functionality is scheduled to be removed.
be removed soon, as well as features that have already been removed. For each
item in this document, the deprecation rationale is listed, along with the last
supported rules_go release and the release when the functionality is scheduled
to be removed.

Go SDKs
-------
Deprecated features
-------------------

No major features are deprecated right now.

Removed features
----------------

| **Go 1.8**
| **Deprecated in:** 0.12.0
Expand All @@ -24,13 +30,10 @@ Go SDKs
symlinking before compiling.
| **Migration:** ``go_register_toolchains()`` automatically selects the newest
version of Go unless a version is explicitly specified.
Go rules
--------

|
| **rules_go gazelle rule**
| **Deprecated in:** 0.13.0
| **Removed in:** 0.14.0
| **Removed in:** 0.15.0
| **Rationale:** This lets us reduce coupling between rules_go and Gazelle.
With this change, we should be able to remove the automatic dependency
on ``@bazel_gazelle``.
Expand All @@ -47,10 +50,7 @@ Go rules
attributes for several releases. ``go_prefix`` will be removed and
``importpath`` will be mandatory for ``go_library`` and ``go_proto_library``.
| **Migration:** Gazelle_ sets ``importpath`` automatically.
Removed features
----------------

|
| **library attribute**
| **Deprecated in:** 0.9.0
| **Removed in:** 0.12.0
Expand Down
4 changes: 0 additions & 4 deletions go/def.bzl
Expand Up @@ -59,10 +59,6 @@ load(
"@io_bazel_rules_go//extras:embed_data.bzl",
"go_embed_data",
)
load(
"@io_bazel_rules_go//go/private:tools/gazelle.bzl",
"gazelle",
)
load(
"@io_bazel_rules_go//go/private:tools/path.bzl",
_go_path = "go_path",
Expand Down
33 changes: 2 additions & 31 deletions go/private/repositories.bzl
Expand Up @@ -26,28 +26,8 @@ def go_rules_dependencies():
"""See /go/workspace.rst#go-rules-dependencies for full documentation."""
versions.check(MINIMUM_BAZEL_VERSION)

# Gazelle and dependencies. These are needed for go_repository.
# TODO(jayconrod): delete all of these when we've migrated everyone to
# Gazelle's version of go_repository.
_maybe(
git_repository,
name = "bazel_gazelle",
remote = "https://github.com/bazelbuild/bazel-gazelle",
commit = "bfb9a4d2a5e6785c792f6fabd5238f8a33e60768", # master as of 2018-08-06
)

# Old version of buildtools, before breaking API changes. Old versions of
# gazelle (0.9) need this. Newer versions vendor this library, so it's only
# needed by old versions.
_maybe(
http_archive,
name = "com_github_bazelbuild_buildtools",
# master, as of 2017-08-14
urls = ["https://codeload.github.com/bazelbuild/buildtools/zip/799e530642bac55de7e76728fa0c3161484899f6"],
strip_prefix = "buildtools-799e530642bac55de7e76728fa0c3161484899f6",
type = "zip",
)

# Was needed by Gazelle in the past. Will likely be needed for go/packages
# and analysis in the future.
_maybe(
http_archive,
name = "org_golang_x_tools",
Expand All @@ -59,15 +39,6 @@ def go_rules_dependencies():
# importpath = "golang.org/x/tools",
)

_maybe(
git_repository,
name = "com_github_pelletier_go_toml",
remote = "https://github.com/pelletier/go-toml",
commit = "16398bac157da96aa88f98a2df640c7f32af1da2", # v1.0.1 as of 2017-12-19
overlay = manifest["com_github_pelletier_go_toml"],
)
# End of Gazelle dependencies.

# Proto dependencies
_maybe(
git_repository,
Expand Down
108 changes: 0 additions & 108 deletions go/private/tools/gazelle.bzl

This file was deleted.

0 comments on commit f6c1878

Please sign in to comment.