Skip to content

Commit

Permalink
Rename bazel_skylib default branch to main.
Browse files Browse the repository at this point in the history
See https://github.com/bazelbuild/bazel-skylib/branches and
bazelbuild/bazel-skylib#281.

RELNOTES: None.
PiperOrigin-RevId: 368882757
  • Loading branch information
tetromino authored and copybara-github committed Apr 16, 2021
1 parent d9837b7 commit 414f3c8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions site/docs/configurable-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,9 @@ For more direct support, use one of the following:
### <a name="selects-with-or"></a>`selects.with_or`
The
[with_or](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/selects_doc.md#selectswith_or)
[with_or](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md#selectswith_or)
macro in [Skylib](https://github.com/bazelbuild/bazel-skylib)'s
[`selects`](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/selects_doc.md)
[`selects`](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md)
module supports `OR`ing conditions directly inside a `select`:

```python
Expand All @@ -479,9 +479,9 @@ sh_binary(


The
[config_setting_group](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/selects_doc.md#selectsconfig_setting_group)
[config_setting_group](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md#selectsconfig_setting_group)
macro in [Skylib](https://github.com/bazelbuild/bazel-skylib)'s
[`selects`](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/selects_doc.md)
[`selects`](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md)
module supports `OR`ing multiple `config_setting`s:
```python
Expand Down Expand Up @@ -522,7 +522,7 @@ It's an error for multiple conditions to match unless one is an unambiguous

If you need a `select` branch to match when multiple conditions match, use the
[Skylib](https://github.com/bazelbuild/bazel-skylib) macro
[config_setting_group](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/selects_doc.md#selectsconfig_setting_group):
[config_setting_group](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md#selectsconfig_setting_group):

```python
config_setting(
Expand Down
2 changes: 1 addition & 1 deletion site/docs/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ The above can be interpreted as follows:

To make your constraints more readable, use
[skylib](https://github.com/bazelbuild/bazel-skylib)'s
[`selects.with_or()`](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/selects_doc.md#selectswith_or).
[`selects.with_or()`](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md#selectswith_or).

You can express inverse compatibility in a similar way. The following example
describes a library that is compatible with everything _except_ for ARM.
Expand Down
2 changes: 1 addition & 1 deletion site/docs/skylark/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ string_flag(
```

For a complete list, see
[Common build setting rules](https://github.com/bazelbuild/bazel-skylib/blob/master/rules/common_settings.bzl).
[Common build setting rules](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/common_settings.bzl).

### Using build settings

Expand Down
24 changes: 12 additions & 12 deletions site/docs/skylark/windows_tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,38 +172,38 @@ Solutions:
Build rule examples:

- `copy_file()`
([source](https://github.com/bazelbuild/bazel-skylib/blob/master/rules/copy_file.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/copy_file_doc.md)):
([source](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/copy_file.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/copy_file_doc.md)):
copies a file somewhere else, optionally making it executable

- `write_file()`
([source](https://github.com/bazelbuild/bazel-skylib/blob/master/rules/write_file.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/write_file_doc.md)):
([source](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/write_file.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/write_file_doc.md)):
writes a text file, with the desired line endings (`auto`, `unix`, or `windows`), optionally
making it executable (if it's a script)

- `run_binary()`
([source](https://github.com/bazelbuild/bazel-skylib/blob/master/rules/run_binary.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/run_binary_doc.md)):
([source](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/run_binary.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/run_binary_doc.md)):
runs a binary (or `*_binary` rule) with given inputs and expected outputs as a build action
(this is a build rule wrapper for `ctx.actions.run`)

- `native_binary()`
([source](https://github.com/bazelbuild/bazel-skylib/blob/master/rules/native_binary.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/native_binary_doc.md#native_binary)):
([source](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/native_binary.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/native_binary_doc.md#native_binary)):
wraps a native binary in a `*_binary` rule, which you can `bazel run` or use in `run_binary()`'s
`tool` attribute or `native.genrule()`'s `tools` attribute

Test rule examples:

- `diff_test()`
([source](https://github.com/bazelbuild/bazel-skylib/blob/master/rules/diff_test.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/diff_test_doc.md)):
([source](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/diff_test.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/diff_test_doc.md)):
test that compares contents of two files

- `native_test()`
([source](https://github.com/bazelbuild/bazel-skylib/blob/master/rules/native_binary.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/master/docs/native_binary_doc.md#native_test)):
([source](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/native_binary.bzl),
[documentation](https://github.com/bazelbuild/bazel-skylib/blob/main/docs/native_binary_doc.md#native_test)):
wraps a native binary in a `*_test` rule, which you can `bazel test`

- **On Windows, consider using `.bat` scripts for trivial things.**
Expand Down
6 changes: 3 additions & 3 deletions site/docs/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ Starting with Bazel 1.0, you can build any rule without Bash unless it is a:
- Starlark rule that uses `ctx.actions.run_shell()` or `ctx.resolve_command()`

However, `genrule` is often used for simple tasks like
[copying a file](https://github.com/bazelbuild/bazel-skylib/blob/master/rules/copy_file.bzl)
or [writing a text file](https://github.com/bazelbuild/bazel-skylib/blob/master/rules/write_file.bzl).
[copying a file](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/copy_file.bzl)
or [writing a text file](https://github.com/bazelbuild/bazel-skylib/blob/main/rules/write_file.bzl).
Instead of using `genrule` (and depending on Bash) you may find a suitable rule
in the
[bazel-skylib repository](https://github.com/bazelbuild/bazel-skylib/tree/master/rules).
[bazel-skylib repository](https://github.com/bazelbuild/bazel-skylib/tree/main/rules).
When built on Windows, **these rules do not require Bash**.

<a name="bazel-test-without-bash"></a>
Expand Down

0 comments on commit 414f3c8

Please sign in to comment.