Skip to content

Commit

Permalink
Update internal dependencies to modern versions. Bazel Federation rep…
Browse files Browse the repository at this point in the history
…o is deprecated. (#327)

See bazelbuild/bazel-federation#127

In particular, this allows us to use a modern Stardoc release to fix generated md docs.

And we can remove internal_deps.bzl/internal_setup.bzl - it's unnecessary complexity
needed only for deprecated Federation setup.
  • Loading branch information
tetromino authored Oct 27, 2021
1 parent 8e923ca commit 6e30a77
Show file tree
Hide file tree
Showing 24 changed files with 737 additions and 436 deletions.
2 changes: 0 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ licenses(["notice"])

package(default_visibility = ["//visibility:public"])

# gazelle:exclude internal_deps.bzl
# gazelle:exclude internal_setup.bzl
# buildifier: disable=skylark-comment
# gazelle:exclude skylark_library.bzl

Expand Down
81 changes: 43 additions & 38 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,78 @@ workspace(name = "bazel_skylib")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

http_archive(
name = "rules_pkg",
sha256 = "352c090cc3d3f9a6b4e676cf42a6047c16824959b438895a76c2989c6d7c246a",
urls = [
"https://github.com/bazelbuild/rules_pkg/releases/download/0.2.5/rules_pkg-0.2.5.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.2.5/rules_pkg-0.2.5.tar.gz",
],
)

load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()

maybe(
name = "bazel_federation",
name = "io_bazel_rules_go",
repo_rule = http_archive,
sha256 = "b10529fcf8a464591e845588348533981e948315b706183481e0d076afe2fa3c",
url = "https://github.com/bazelbuild/bazel-federation/releases/download/0.0.2/bazel_federation-0.0.2.tar.gz",
sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
],
)

load("@bazel_federation//:repositories.bzl", "bazel_skylib_deps", "rules_go")

bazel_skylib_deps()

rules_go()

load("@bazel_federation//setup:bazel_skylib.bzl", "bazel_skylib_setup")

bazel_skylib_setup()
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

load("@bazel_federation//setup:rules_go.bzl", "rules_go_setup")
go_rules_dependencies()

rules_go_setup()
go_register_toolchains(version = "1.17.1")

# Below this line is for documentation generation only,
# and should thus not be included by dependencies on
# bazel-skylib.

load("//:internal_deps.bzl", "bazel_skylib_internal_deps")
maybe(
http_archive,
name = "io_bazel_stardoc",
sha256 = "c9794dcc8026a30ff67cf7cf91ebe245ca294b20b071845d12c192afe243ad72",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz",
"https://github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz",
],
)

bazel_skylib_internal_deps()
load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

load("//:internal_setup.bzl", "bazel_skylib_internal_setup")
stardoc_repositories()

bazel_skylib_internal_setup()
maybe(
http_archive,
name = "rules_pkg",
sha256 = "a89e203d3cf264e564fcb96b6e06dd70bc0557356eb48400ce4b5d97c2c3720d",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
],
)

load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()

maybe(
name = "rules_cc",
repo_rule = http_archive,
sha256 = "b4b2a2078bdb7b8328d843e8de07d7c13c80e6c89e86a09d6c4b424cfd1aaa19",
strip_prefix = "rules_cc-cb2dfba6746bfa3c3705185981f3109f0ae1b893",
sha256 = "4dccbfd22c0def164c8f47458bd50e0c7148f3d92002cdb459c2a96a68498241",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/cb2dfba6746bfa3c3705185981f3109f0ae1b893.zip",
"https://github.com/bazelbuild/rules_cc/archive/cb2dfba6746bfa3c3705185981f3109f0ae1b893.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/releases/download/0.0.1/rules_cc-0.0.1.tar.gz",
"https://github.com/bazelbuild/rules_cc/releases/download/0.0.1/rules_cc-0.0.1.tar.gz",
],
)

load("//lib:unittest.bzl", "register_unittest_toolchains")

register_unittest_toolchains()

# Provide a repository hint for Gazelle to inform it that the go package
# github.com/bazelbuild/rules_go is available from io_bazel_rules_go and it
# doesn't need to duplicatively fetch it.
# gazelle:repository go_repository name=io_bazel_rules_go importpath=github.com/bazelbuild/rules_go
http_archive(
name = "bazel_gazelle",
sha256 = "bfd86b3cbe855d6c16c6fce60d76bd51f5c8dbc9cfcaef7a2bb5c1aafd0710e8",
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.0/bazel-gazelle-v0.21.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.0/bazel-gazelle-v0.21.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
],
)
# Another Gazelle repository hint.
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_skydoc//stardoc:stardoc.bzl", "stardoc")
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")

licenses(["notice"])

Expand Down
10 changes: 6 additions & 4 deletions docs/analysis_test_doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->

<a name="#analysis_test"></a>
A test verifying other targets can be successfully analyzed as part of a `bazel test`

<a id="#analysis_test"></a>

## analysis_test

Expand Down Expand Up @@ -39,8 +41,8 @@ Test rule checking that other targets can be successfully analyzed.


| Name | Description | Type | Mandatory | Default |
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| targets | - | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | required | |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="analysis_test-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="analysis_test-targets"></a>targets | - | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | required | |


12 changes: 7 additions & 5 deletions docs/build_test_doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->

<a name="#build_test"></a>
A test verifying other targets build as part of a `bazel test`

<a id="#build_test"></a>

## build_test

Expand Down Expand Up @@ -31,9 +33,9 @@ Typical usage:


| Name | Description | Default Value |
| :-------------: | :-------------: | :-------------: |
| name | The name of the test rule. | none |
| targets | A list of targets to ensure build. | none |
| kwargs | The &lt;a href="https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-tests"&gt;common attributes for tests&lt;/a&gt;. | none |
| :------------- | :------------- | :------------- |
| <a id="build_test-name"></a>name | The name of the test rule. | none |
| <a id="build_test-targets"></a>targets | A list of targets to ensure build. | none |
| <a id="build_test-kwargs"></a>kwargs | The &lt;a href="https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-tests"&gt;common attributes for tests&lt;/a&gt;. | none |


36 changes: 25 additions & 11 deletions docs/collections_doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->

<a name="#collections.after_each"></a>
Skylib module containing functions that operate on collections.

<a id="#collections.after_each"></a>

## collections.after_each

Expand All @@ -14,12 +16,16 @@ Inserts `separator` after each item in `iterable`.


| Name | Description | Default Value |
| :-------------: | :-------------: | :-------------: |
| separator | The value to insert after each item in <code>iterable</code>. | none |
| iterable | The list into which to intersperse the separator. | none |
| :------------- | :------------- | :------------- |
| <a id="collections.after_each-separator"></a>separator | The value to insert after each item in <code>iterable</code>. | none |
| <a id="collections.after_each-iterable"></a>iterable | The list into which to intersperse the separator. | none |

**RETURNS**

A new list with `separator` after each item in `iterable`.

<a name="#collections.before_each"></a>

<a id="#collections.before_each"></a>

## collections.before_each

Expand All @@ -33,12 +39,16 @@ Inserts `separator` before each item in `iterable`.


| Name | Description | Default Value |
| :-------------: | :-------------: | :-------------: |
| separator | The value to insert before each item in <code>iterable</code>. | none |
| iterable | The list into which to intersperse the separator. | none |
| :------------- | :------------- | :------------- |
| <a id="collections.before_each-separator"></a>separator | The value to insert before each item in <code>iterable</code>. | none |
| <a id="collections.before_each-iterable"></a>iterable | The list into which to intersperse the separator. | none |

**RETURNS**

A new list with `separator` before each item in `iterable`.

<a name="#collections.uniq"></a>

<a id="#collections.uniq"></a>

## collections.uniq

Expand All @@ -55,7 +65,11 @@ Requires all the elements to be hashable.


| Name | Description | Default Value |
| :-------------: | :-------------: | :-------------: |
| iterable | An iterable to filter. | none |
| :------------- | :------------- | :------------- |
| <a id="collections.uniq-iterable"></a>iterable | An iterable to filter. | none |

**RETURNS**

A new list with all unique elements from `iterable`.


67 changes: 38 additions & 29 deletions docs/common_settings_doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->

<a name="#bool_flag"></a>
Common build setting rules

These rules return a BuildSettingInfo with the value of the build setting.
For label-typed settings, use the native label_flag and label_setting rules.

More documentation on how to use build settings at
https://docs.bazel.build/versions/main/skylark/config.html#user-defined-build-settings


<a id="#bool_flag"></a>

## bool_flag

Expand All @@ -14,11 +23,11 @@ A bool-typed build setting that can be set on the command line


| Name | Description | Type | Mandatory | Default |
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="bool_flag-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |


<a name="#bool_setting"></a>
<a id="#bool_setting"></a>

## bool_setting

Expand All @@ -32,11 +41,11 @@ A bool-typed build setting that cannot be set on the command line


| Name | Description | Type | Mandatory | Default |
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="bool_setting-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |


<a name="#int_flag"></a>
<a id="#int_flag"></a>

## int_flag

Expand All @@ -50,11 +59,11 @@ An int-typed build setting that can be set on the command line


| Name | Description | Type | Mandatory | Default |
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="int_flag-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |


<a name="#int_setting"></a>
<a id="#int_setting"></a>

## int_setting

Expand All @@ -68,11 +77,11 @@ An int-typed build setting that cannot be set on the command line


| Name | Description | Type | Mandatory | Default |
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="int_setting-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |


<a name="#string_flag"></a>
<a id="#string_flag"></a>

## string_flag

Expand All @@ -86,12 +95,12 @@ A string-typed build setting that can be set on the command line


| Name | Description | Type | Mandatory | Default |
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| values | The list of allowed values for this setting. An error is raised if any other value is given. | List of strings | optional | [] |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="string_flag-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="string_flag-values"></a>values | The list of allowed values for this setting. An error is raised if any other value is given. | List of strings | optional | [] |


<a name="#string_list_flag"></a>
<a id="#string_list_flag"></a>

## string_list_flag

Expand All @@ -105,11 +114,11 @@ A string list-typed build setting that can be set on the command line


| Name | Description | Type | Mandatory | Default |
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="string_list_flag-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |


<a name="#string_list_setting"></a>
<a id="#string_list_setting"></a>

## string_list_setting

Expand All @@ -123,11 +132,11 @@ A string list-typed build setting that cannot be set on the command line


| Name | Description | Type | Mandatory | Default |
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="string_list_setting-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |


<a name="#string_setting"></a>
<a id="#string_setting"></a>

## string_setting

Expand All @@ -141,12 +150,12 @@ A string-typed build setting that cannot be set on the command line


| Name | Description | Type | Mandatory | Default |
| :-------------: | :-------------: | :-------------: | :-------------: | :-------------: |
| name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| values | The list of allowed values for this setting. An error is raised if any other value is given. | List of strings | optional | [] |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="string_setting-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="string_setting-values"></a>values | The list of allowed values for this setting. An error is raised if any other value is given. | List of strings | optional | [] |


<a name="#BuildSettingInfo"></a>
<a id="#BuildSettingInfo"></a>

## BuildSettingInfo

Expand All @@ -160,7 +169,7 @@ A singleton provider that contains the raw value of a build setting


| Name | Description |
| :-------------: | :-------------: |
| value | The value of the build setting in the current configuration. This value may come from the command line or an upstream transition, or else it will be the build setting's default. |
| :------------- | :------------- |
| <a id="BuildSettingInfo-value"></a>value | The value of the build setting in the current configuration. This value may come from the command line or an upstream transition, or else it will be the build setting's default. |


Loading

0 comments on commit 6e30a77

Please sign in to comment.