Skip to content

Commit

Permalink
Prepare release 1.6.0 (#496)
Browse files Browse the repository at this point in the history
And take the opportunity to reformat docs using a more modern Stardoc release
  • Loading branch information
tetromino committed Apr 24, 2024
1 parent 1969278 commit 99ffbbf
Show file tree
Hide file tree
Showing 29 changed files with 588 additions and 577 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Release 1.6.0

## What's Changed
* Add helper functions for module extensions as `modules` by @fmeum in https://github.com/bazelbuild/bazel-skylib/pull/457
* Make `out` on `native_binary` optional by @tpudlik in https://github.com/bazelbuild/bazel-skylib/pull/474
* Remove outdated rules_cc dependency @cpsauer in https://github.com/bazelbuild/bazel-skylib/pull/476
* Add toolchains argument to unittests.make by @jylinv0 in https://github.com/bazelbuild/bazel-skylib/pull/483
* Allow `bzl_library` to depend on non-`bzl_library` targets by @Wyverald in https://github.com/bazelbuild/bazel-skylib/pull/495

## New Contributors
* @jylinv0 made their first contribution in https://github.com/bazelbuild/bazel-skylib/pull/483
* @tpudlik made their first contribution in https://github.com/bazelbuild/bazel-skylib/pull/474

**Full Changelog**: https://github.com/bazelbuild/bazel-skylib/compare/1.5.0...1.6.0


Release 1.5.0

## What's Changed
Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module(
name = "bazel_skylib",
# Keep in sync with version.bzl and @bazel_skylib_gazelle_plugin//:MODULE.bazel
version = "1.5.0",
version = "1.6.0",
compatibility_level = 1,
)

Expand All @@ -15,7 +15,7 @@ bazel_dep(name = "platforms", version = "0.0.4")
### INTERNAL ONLY - lines after this are not included in the release packaging.

# Build-only / test-only dependencies
bazel_dep(name = "stardoc", version = "0.5.6", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "rules_pkg", version = "0.9.1", dev_dependency = True)

# Needed for bazelci and for building distribution tarballs.
Expand Down
22 changes: 19 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,33 @@ bazel_skylib_gazelle_plugin_setup()
maybe(
http_archive,
name = "io_bazel_stardoc",
sha256 = "dfbc364aaec143df5e6c52faf1f1166775a5b4408243f445f44b661cfdc3134f",
sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.6/stardoc-0.5.6.tar.gz",
"https://github.com/bazelbuild/stardoc/releases/download/0.5.6/stardoc-0.5.6.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz",
"https://github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz",
],
)

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

stardoc_repositories()

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

rules_jvm_external_setup()

load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps")

stardoc_external_deps()

load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install")

stardoc_pinned_maven_install()

maybe(
http_archive,
name = "rules_pkg",
Expand Down
48 changes: 24 additions & 24 deletions docs/analysis_test_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ analysis_test(<a href="#analysis_test-name">name</a>, <a href="#analysis_test-ta

Test rule checking that other targets can be successfully analyzed.

This rule essentially verifies that all targets under `targets` would
generate no errors when analyzed with `bazel build [targets] --nobuild`.
Action success/failure for the targets and their transitive dependencies
are not verified. An analysis test simply ensures that each target in the transitive
dependencies propagate providers appropriately and register actions for their outputs
appropriately.

NOTE: If the targets fail to analyze, instead of the analysis_test failing, the analysis_test
will fail to build. Ideally, it would instead result in a test failure. This is a current
infrastructure limitation that may be fixed in the future.

Typical usage:

load("@bazel_skylib//rules:analysis_test.bzl", "analysis_test")
analysis_test(
name = "my_analysis_test",
targets = [
"//some/package:rule",
],
)

Args:
name: The name of the test rule.
targets: A list of targets to ensure build.
This rule essentially verifies that all targets under `targets` would
generate no errors when analyzed with `bazel build [targets] --nobuild`.
Action success/failure for the targets and their transitive dependencies
are not verified. An analysis test simply ensures that each target in the transitive
dependencies propagate providers appropriately and register actions for their outputs
appropriately.

NOTE: If the targets fail to analyze, instead of the analysis_test failing, the analysis_test
will fail to build. Ideally, it would instead result in a test failure. This is a current
infrastructure limitation that may be fixed in the future.

Typical usage:

load("@bazel_skylib//rules:analysis_test.bzl", "analysis_test")
analysis_test(
name = "my_analysis_test",
targets = [
"//some/package:rule",
],
)

Args:
name: The name of the test rule.
targets: A list of targets to ensure build.

**ATTRIBUTES**

Expand Down
5 changes: 2 additions & 3 deletions docs/bzl_library.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ Example:
)
```


**ATTRIBUTES**


| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="bzl_library-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="bzl_library-deps"></a>deps | List of other <code>bzl_library</code> or <code>filegroup</code> targets that are required by the Starlark files listed in <code>srcs</code>. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | <code>[]</code> |
| <a id="bzl_library-srcs"></a>srcs | List of <code>.bzl</code> and <code>.scl</code> files that are processed to create this target. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | <code>[]</code> |
| <a id="bzl_library-deps"></a>deps | List of other `bzl_library` or `filegroup` targets that are required by the Starlark files listed in `srcs`. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
| <a id="bzl_library-srcs"></a>srcs | List of `.bzl` and `.scl` files that are processed to create this target. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |


<a id="StarlarkLibraryInfo"></a>
Expand Down
4 changes: 2 additions & 2 deletions docs/collections_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Inserts `separator` after each item in `iterable`.

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

**RETURNS**
Expand All @@ -40,7 +40,7 @@ Inserts `separator` before each item in `iterable`.

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

**RETURNS**
Expand Down
13 changes: 6 additions & 7 deletions docs/common_settings_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ For label-typed settings, use the native label_flag and label_setting rules.
More documentation on how to use build settings at
https://bazel.build/extending/config#user-defined-build-settings


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

## bool_flag
Expand Down Expand Up @@ -61,7 +60,7 @@ An int-typed build setting that can be set on the command line
| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="int_flag-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="int_flag-make_variable"></a>make_variable | If set, the build setting's value will be available as a Make variable with this name in the attributes of rules that list this build setting in their 'toolchains' attribute. | String | optional | <code>""</code> |
| <a id="int_flag-make_variable"></a>make_variable | If set, the build setting's value will be available as a Make variable with this name in the attributes of rules that list this build setting in their 'toolchains' attribute. | String | optional | `""` |


<a id="int_setting"></a>
Expand All @@ -80,7 +79,7 @@ An int-typed build setting that cannot be set on the command line
| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="int_setting-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="int_setting-make_variable"></a>make_variable | If set, the build setting's value will be available as a Make variable with this name in the attributes of rules that list this build setting in their 'toolchains' attribute. | String | optional | <code>""</code> |
| <a id="int_setting-make_variable"></a>make_variable | If set, the build setting's value will be available as a Make variable with this name in the attributes of rules that list this build setting in their 'toolchains' attribute. | String | optional | `""` |


<a id="string_flag"></a>
Expand All @@ -99,8 +98,8 @@ A string-typed build setting that can be set on the command line
| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="string_flag-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="string_flag-make_variable"></a>make_variable | If set, the build setting's value will be available as a Make variable with this name in the attributes of rules that list this build setting in their 'toolchains' attribute. | String | optional | <code>""</code> |
| <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 | <code>[]</code> |
| <a id="string_flag-make_variable"></a>make_variable | If set, the build setting's value will be available as a Make variable with this name in the attributes of rules that list this build setting in their 'toolchains' attribute. | String | optional | `""` |
| <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 id="string_list_flag"></a>
Expand Down Expand Up @@ -155,8 +154,8 @@ A string-typed build setting that cannot be set on the command line
| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="string_setting-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="string_setting-make_variable"></a>make_variable | If set, the build setting's value will be available as a Make variable with this name in the attributes of rules that list this build setting in their 'toolchains' attribute. | String | optional | <code>""</code> |
| <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 | <code>[]</code> |
| <a id="string_setting-make_variable"></a>make_variable | If set, the build setting's value will be available as a Make variable with this name in the attributes of rules that list this build setting in their 'toolchains' attribute. | String | optional | `""` |
| <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 id="BuildSettingInfo"></a>
Expand Down
5 changes: 2 additions & 3 deletions docs/copy_directory_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ A rule that copies a directory to another place.
The rule uses a Bash command on Linux/macOS/non-Windows, and a cmd.exe command
on Windows (no Bash is required).


<a id="copy_directory"></a>

## copy_directory
Expand Down Expand Up @@ -33,7 +32,7 @@ for more context.
| <a id="copy_directory-name"></a>name | Name of the rule. | none |
| <a id="copy_directory-src"></a>src | The directory to make a copy of. Can be a source directory or TreeArtifact. | none |
| <a id="copy_directory-out"></a>out | Path of the output directory, relative to this package. | none |
| <a id="copy_directory-kwargs"></a>kwargs | further keyword arguments, e.g. <code>visibility</code> | none |
| <a id="copy_directory-kwargs"></a>kwargs | further keyword arguments, e.g. `visibility` | none |


<a id="copy_directory_action"></a>
Expand All @@ -58,6 +57,6 @@ other rule implementations.
| <a id="copy_directory_action-ctx"></a>ctx | The rule context. | none |
| <a id="copy_directory_action-src"></a>src | The directory to make a copy of. Can be a source directory or TreeArtifact. | none |
| <a id="copy_directory_action-dst"></a>dst | The directory to copy to. Must be a TreeArtifact. | none |
| <a id="copy_directory_action-is_windows"></a>is_windows | If true, an cmd.exe action is created so there is no bash dependency. | <code>False</code> |
| <a id="copy_directory_action-is_windows"></a>is_windows | If true, an cmd.exe action is created so there is no bash dependency. | `False` |


7 changes: 3 additions & 4 deletions docs/copy_file_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ The 'copy_file' rule does this with a simpler interface than genrule.
The rule uses a Bash command on Linux/macOS/non-Windows, and a cmd.exe command
on Windows (no Bash is required).


<a id="copy_file"></a>

## copy_file
Expand All @@ -32,8 +31,8 @@ This rule uses a Bash command on Linux/macOS/non-Windows, and a cmd.exe command
| <a id="copy_file-name"></a>name | Name of the rule. | none |
| <a id="copy_file-src"></a>src | A Label. The file to make a copy of. (Can also be the label of a rule that generates a file.) | none |
| <a id="copy_file-out"></a>out | Path of the output file, relative to this package. | none |
| <a id="copy_file-is_executable"></a>is_executable | A boolean. Whether to make the output file executable. When True, the rule's output can be executed using <code>bazel run</code> and can be in the srcs of binary and test rules that require executable sources. WARNING: If <code>allow_symlink</code> is True, <code>src</code> must also be executable. | <code>False</code> |
| <a id="copy_file-allow_symlink"></a>allow_symlink | A boolean. Whether to allow symlinking instead of copying. When False, the output is always a hard copy. When True, the output *can* be a symlink, but there is no guarantee that a symlink is created (i.e., at the time of writing, we don't create symlinks on Windows). Set this to True if you need fast copying and your tools can handle symlinks (which most UNIX tools can). | <code>False</code> |
| <a id="copy_file-kwargs"></a>kwargs | further keyword arguments, e.g. <code>visibility</code> | none |
| <a id="copy_file-is_executable"></a>is_executable | A boolean. Whether to make the output file executable. When True, the rule's output can be executed using `bazel run` and can be in the srcs of binary and test rules that require executable sources. WARNING: If `allow_symlink` is True, `src` must also be executable. | `False` |
| <a id="copy_file-allow_symlink"></a>allow_symlink | A boolean. Whether to allow symlinking instead of copying. When False, the output is always a hard copy. When True, the output *can* be a symlink, but there is no guarantee that a symlink is created (i.e., at the time of writing, we don't create symlinks on Windows). Set this to True if you need fast copying and your tools can handle symlinks (which most UNIX tools can). | `False` |
| <a id="copy_file-kwargs"></a>kwargs | further keyword arguments, e.g. `visibility` | none |


4 changes: 2 additions & 2 deletions docs/dicts_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Returns a new `dict` that has all the entries of `dictionary` with keys not in `

| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="dicts.omit-dictionary"></a>dictionary | A <code>dict</code>. | none |
| <a id="dicts.omit-dictionary"></a>dictionary | A `dict`. | none |
| <a id="dicts.omit-keys"></a>keys | A sequence. | none |

**RETURNS**
Expand All @@ -72,7 +72,7 @@ Returns a new `dict` that has all the entries of `dictionary` with keys in `keys

| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="dicts.pick-dictionary"></a>dictionary | A <code>dict</code>. | none |
| <a id="dicts.pick-dictionary"></a>dictionary | A `dict`. | none |
| <a id="dicts.pick-keys"></a>keys | A sequence. | none |

**RETURNS**
Expand Down
7 changes: 3 additions & 4 deletions docs/diff_test_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ A test rule that compares two binary files.
The rule uses a Bash command (diff) on Linux/macOS/non-Windows, and a cmd.exe
command (fc.exe) on Windows (no Bash is required).


<a id="diff_test"></a>

## diff_test
Expand All @@ -25,9 +24,9 @@ The test succeeds if the files' contents match.
| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="diff_test-name"></a>name | The name of the test rule. | none |
| <a id="diff_test-file1"></a>file1 | Label of the file to compare to <code>file2</code>. | none |
| <a id="diff_test-file2"></a>file2 | Label of the file to compare to <code>file1</code>. | none |
| <a id="diff_test-failure_message"></a>failure_message | Additional message to log if the files' contents do not match. | <code>None</code> |
| <a id="diff_test-file1"></a>file1 | Label of the file to compare to `file2`. | none |
| <a id="diff_test-file2"></a>file2 | Label of the file to compare to `file1`. | none |
| <a id="diff_test-failure_message"></a>failure_message | Additional message to log if the files' contents do not match. | `None` |
| <a id="diff_test-kwargs"></a>kwargs | The [common attributes for tests](https://bazel.build/reference/be/common-definitions#common-attributes-tests). | none |


1 change: 0 additions & 1 deletion docs/expand_template_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

A rule that performs template expansion.


<a id="expand_template"></a>

## expand_template
Expand Down

0 comments on commit 99ffbbf

Please sign in to comment.