Skip to content

Commit 4c70b00

Browse files
authored
Merge branch 'main' into drop-exec-requirements
2 parents ecf8428 + ac4372f commit 4c70b00

File tree

16 files changed

+300
-159
lines changed

16 files changed

+300
-159
lines changed

.bcr/gazelle/presubmit.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
matrix:
22
platform:
3-
- centos7
3+
- rockylinux8
44
- debian10
55
- macos
6-
- ubuntu2004
6+
- macos_arm64
7+
- ubuntu2204
8+
- ubuntu2404
79
- windows
810
bazel:
11+
- 8.x
912
- 7.x
1013
- 6.x
1114
tasks:

.bcr/presubmit.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
matrix:
22
platform:
3-
- centos7
3+
- rockylinux8
44
- debian10
55
- macos
6-
- ubuntu2004
6+
- macos_arm64
7+
- ubuntu2204
8+
- ubuntu2404
79
- windows
810
bazel:
11+
- 8.x
912
- 7.x
1013
- 6.x
11-
- 5.x
1214
tasks:
1315
verify_build_targets:
1416
name: "Verify build targets"

.github/workflows/publish.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to BCR
2+
on:
3+
# Run the publish workflow after a successful release
4+
# Will be triggered from the release.yaml workflow
5+
workflow_call:
6+
inputs:
7+
tag_name:
8+
required: true
9+
type: string
10+
secrets:
11+
publish_token:
12+
required: true
13+
# In case of problems, let release engineers retry by manually dispatching
14+
# the workflow from the GitHub UI
15+
workflow_dispatch:
16+
inputs:
17+
tag_name:
18+
description: git tag being released
19+
required: true
20+
type: string
21+
jobs:
22+
publish:
23+
uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected]
24+
with:
25+
tag_name: ${{ inputs.tag_name }}
26+
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
27+
registry_fork: bazel-io/bazel-central-registry
28+
draft: false
29+
permissions:
30+
attestations: write
31+
contents: write
32+
id-token: write
33+
secrets:
34+
# Necessary to push to the BCR fork, and to open a pull request against a registry
35+
publish_token: ${{ secrets.publish_token || secrets.BCR_PUBLISH_TOKEN }}

.github/workflows/release.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
on:
3+
# Can be triggered from the tag.yaml workflow
4+
workflow_call:
5+
inputs:
6+
tag_name:
7+
required: true
8+
type: string
9+
secrets:
10+
publish_token:
11+
required: true
12+
# Or, developers can manually push a tag from their clone
13+
push:
14+
tags:
15+
- "*.*.*"
16+
permissions:
17+
id-token: write
18+
attestations: write
19+
contents: write
20+
jobs:
21+
release:
22+
uses: bazel-contrib/.github/.github/workflows/[email protected]
23+
with:
24+
# Matches both the main and Gazelle plugin archives
25+
release_files: bazel-skylib-*.tar.gz
26+
prerelease: false
27+
tag_name: ${{ inputs.tag_name || github.ref_name }}
28+
publish:
29+
needs: release
30+
uses: ./.github/workflows/publish.yaml
31+
with:
32+
tag_name: ${{ inputs.tag_name || github.ref_name }}
33+
secrets:
34+
publish_token: ${{ secrets.publish_token || secrets.BCR_PUBLISH_TOKEN }}

.github/workflows/release_prep.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit -o nounset -o pipefail
4+
5+
# Argument provided by reusable workflow caller, see
6+
# https://github.com/bazel-contrib/.github/blob/d197a6427c5435ac22e56e33340dff912bc9334e/.github/workflows/release_ruleset.yaml#L72
7+
VERSION=$1
8+
9+
bazel build //distribution:bazel-skylib
10+
ARCHIVE="$(bazel cquery --output=files //distribution:bazel-skylib)"
11+
SHA256SUM=$(shasum -a 256 "$ARCHIVE" | awk '{print $1}')
12+
13+
bazel build //distribution:bazel-skylib-gazelle-plugin
14+
ARCHIVE_GAZELLE_PLUGIN="$(bazel cquery --output=files //distribution:bazel-skylib-gazelle-plugin)"
15+
SHA256SUM_GAZELLE_PLUGIN=$(shasum -a 256 "$ARCHIVE_GAZELLE_PLUGIN" | awk '{print $1}')
16+
17+
# Move the archives to the root so that they are discoverable for upload
18+
mv "$ARCHIVE" .
19+
mv "$ARCHIVE_GAZELLE_PLUGIN" .
20+
21+
cat << EOF
22+
**MODULE.bazel setup**
23+
24+
\`\`\`starlark
25+
bazel_dep(name = "bazel_skylib", version = "$VERSION")
26+
\`\`\`
27+
28+
And for the Gazelle plugin:
29+
30+
\`\`\`starlark
31+
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "$VERSION", dev_dependency = True)
32+
\`\`\`
33+
34+
**WORKSPACE setup**
35+
36+
\`\`\`starlark
37+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
38+
39+
http_archive(
40+
name = "bazel_skylib",
41+
sha256 = "$SHA256SUM",
42+
urls = [
43+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-$VERSION.tar.gz",
44+
"https://github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-$VERSION.tar.gz",
45+
],
46+
)
47+
48+
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
49+
50+
bazel_skylib_workspace()
51+
\`\`\`
52+
53+
***Additional WORKSPACE setup for the Gazelle plugin***
54+
55+
\`\`\`starlark
56+
http_archive(
57+
name = "bazel_skylib_gazelle_plugin",
58+
sha256 = "$SHA256SUM_GAZELLE_PLUGIN",
59+
urls = [
60+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-gazelle-plugin-$VERSION.tar.gz",
61+
"https://github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-gazelle-plugin-$VERSION.tar.gz",
62+
],
63+
)
64+
65+
load("@bazel_skylib_gazelle_plugin//:workspace.bzl", "bazel_skylib_gazelle_plugin_workspace")
66+
67+
bazel_skylib_gazelle_plugin_workspace()
68+
69+
load("@bazel_skylib_gazelle_plugin//:setup.bzl", "bazel_skylib_gazelle_plugin_setup")
70+
71+
bazel_skylib_gazelle_plugin_setup()
72+
\`\`\`
73+
EOF

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
1+
# Release 1.8.2
2+
3+
**New Features**
4+
* Introduce repeatable_string_flag (#593)
5+
6+
**Other Changes**
7+
* Migrate `copy_directory` away from deprecated host constraint (#588)
8+
9+
**Contributors**
10+
* fmeum@
11+
* susinmotion@
12+
13+
# Release 1.8.1
14+
15+
**What's Changed**
16+
* Make `is_windows` public (https://github.com/bazelbuild/bazel-skylib/pull/584)
17+
18+
**Full Changelog**: https://github.com/bazelbuild/bazel-skylib/compare/1.8.0...1.8.1
19+
20+
# Release 1.8.0
21+
22+
## What's Changed
23+
* fix: subpackages.all works for root packages by @kilian-funk in https://github.com/bazelbuild/bazel-skylib/pull/531
24+
* Strip compatible_with from bzl_library rules by @aiuto in https://github.com/bazelbuild/bazel-skylib/pull/522
25+
* Make only root test_deps externally visible by @tetromino in https://github.com/bazelbuild/bazel-skylib/pull/508
26+
* Update README.md by @BoleynSu in https://github.com/bazelbuild/bazel-skylib/pull/380
27+
* Add test_deps to rules/private by @aiuto in https://github.com/bazelbuild/bazel-skylib/pull/534
28+
* Fix bazel_skylib with Bazel@HEAD by @meteorcloudy in https://github.com/bazelbuild/bazel-skylib/pull/538
29+
* Explicitly enable workspace for some tasks by @meteorcloudy in https://github.com/bazelbuild/bazel-skylib/pull/540
30+
* README.md: fix broken directory rule links by @lukasoyen in https://github.com/bazelbuild/bazel-skylib/pull/544
31+
* Remove sh_binary usage for Bazel 8 friendliness by @tetromino in https://github.com/bazelbuild/bazel-skylib/pull/550
32+
* adding scope attributes for starlark flags by @aranguyen in https://github.com/bazelbuild/bazel-skylib/pull/546
33+
* Update common_settings.bzl by @aranguyen in https://github.com/bazelbuild/bazel-skylib/pull/552
34+
* Simplify CI steup and make presubmit green again by @meteorcloudy in https://github.com/bazelbuild/bazel-skylib/pull/557
35+
* fix(gazelle): remove deprecated function call by @tyler-french in https://github.com/bazelbuild/bazel-skylib/pull/556
36+
* Remove obsolete bazel 4.x compat code by @lukasoyen in https://github.com/bazelbuild/bazel-skylib/pull/560
37+
* Add new "env" variable to native_* rules by @gioachin in https://github.com/bazelbuild/bazel-skylib/pull/561
38+
* Replace outdated `select() on --cpu` with another flag ref by @gregestren in https://github.com/bazelbuild/bazel-skylib/pull/570
39+
* Migrate away from `@bazel_tools//src/conditions:host_windows` by @fmeum in https://github.com/bazelbuild/bazel-skylib/pull/574
40+
* Use DefaultInfo directly by @keith in https://github.com/bazelbuild/bazel-skylib/pull/577
41+
* Use `native.package_relative_label` in `selects.bzl` by @fmeum in https://github.com/bazelbuild/bazel-skylib/pull/576
42+
* Add BCR publishing workflow by @fmeum in https://github.com/bazelbuild/bazel-skylib/pull/581
43+
44+
## New Contributors
45+
* @kilian-funk made their first contribution in https://github.com/bazelbuild/bazel-skylib/pull/531
46+
* @BoleynSu made their first contribution in https://github.com/bazelbuild/bazel-skylib/pull/380
47+
* @lukasoyen made their first contribution in https://github.com/bazelbuild/bazel-skylib/pull/544
48+
* @aranguyen made their first contribution in https://github.com/bazelbuild/bazel-skylib/pull/546
49+
* @tyler-french made their first contribution in https://github.com/bazelbuild/bazel-skylib/pull/556
50+
* @gioachin made their first contribution in https://github.com/bazelbuild/bazel-skylib/pull/561
51+
52+
**Full Changelog**: https://github.com/bazelbuild/bazel-skylib/compare/1.7.1...1.8.0
53+
154
# Release 1.7.1
255

356
**What's Changed**

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module(
22
name = "bazel_skylib",
33
# Keep in sync with version.bzl and @bazel_skylib_gazelle_plugin//:MODULE.bazel
4-
version = "1.7.1",
4+
version = "1.8.2",
55
compatibility_level = 1,
66
)
77

docs/common_settings_doc.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,27 @@ An int-typed build setting that cannot be set on the command line
9494
| <a id="int_setting-scope"></a>scope | The scope indicates where a flag can propagate to | String | optional | `"universal"` |
9595

9696

97+
<a id="repeatable_string_flag"></a>
98+
99+
## repeatable_string_flag
100+
101+
<pre>
102+
load("@bazel_skylib//rules:common_settings.bzl", "repeatable_string_flag")
103+
104+
repeatable_string_flag(<a href="#repeatable_string_flag-name">name</a>, <a href="#repeatable_string_flag-scope">scope</a>)
105+
</pre>
106+
107+
A build setting that accepts one or more string-typed settings on the command line, with the values concatenated into a single string list; for example, `--//my/setting=foo` `--//my/setting=bar` will be parsed as `['foo', 'bar']`. Contrast with `string_list_flag`
108+
109+
**ATTRIBUTES**
110+
111+
112+
| Name | Description | Type | Mandatory | Default |
113+
| :------------- | :------------- | :------------- | :------------- | :------------- |
114+
| <a id="repeatable_string_flag-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
115+
| <a id="repeatable_string_flag-scope"></a>scope | The scope indicates where a flag can propagate to | String | optional | `"universal"` |
116+
117+
97118
<a id="string_flag"></a>
98119

99120
## string_flag
@@ -148,7 +169,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "string_list_setting")
148169
string_list_setting(<a href="#string_list_setting-name">name</a>, <a href="#string_list_setting-scope">scope</a>)
149170
</pre>
150171

151-
A string list-typed build setting that cannot be set on the command line
172+
A string list-typed build setting which expects its value on the command line to be given in comma-separated format; for example, `--//my/setting=foo,bar` will be parsed as `['foo', 'bar']`. Contrast with `repeatable_string_flag`
152173

153174
**ATTRIBUTES**
154175

docs/maintainers_guide.md

Lines changed: 9 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -77,100 +77,18 @@ Name 1, Name 2, Name 3 (alphabetically from `git log`)
7777
2. Bump `version` in version.bzl, MODULE.bazel, *and* gazelle/MODULE.bazel to
7878
the new version.
7979
TODO(#386): add a test to make sure all the versions are in sync.
80-
3. Ensure that the commits for steps 1 and 2 have been merged. All further
81-
steps must be performed on a single, known-good git commit.
82-
4. `bazel build //distribution`
83-
5. Copy the `bazel-skylib-$VERSION.tar.gz` and
84-
`bazel-skylib-gazelle-plugin-$VERSION.tar.gz` tarballs to the mirror (you'll
80+
3. Ensure that the commits for steps 1 and 2 have been merged.
81+
4. Create a new tag in the format `1.2.3` (no leading `v`) and push it to
82+
GitHub.
83+
5. Review a PR at [Bazel Central Registry](https://github.com/bazelbuild/bazel-central-registry)
84+
created by the publish.yaml workflow.
85+
6. Download the the `bazel-skylib-$VERSION.tar.gz` and
86+
`bazel-skylib-gazelle-plugin-$VERSION.tar.gz` tarballs from the
87+
automatically created GitHub release and upload them to the mirror (you'll
8588
need Bazel developer gcloud credentials; assuming you are a Bazel developer,
8689
you can obtain them via `gcloud init`):
8790

8891
```bash
89-
gsutil cp bazel-bin/distribution/bazel-skylib{,-gazelle-plugin}-$VERSION.tar.gz gs://bazel-mirror/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/
92+
gsutil cp bazel-skylib{,-gazelle-plugin}-$VERSION.tar.gz gs://bazel-mirror/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/
9093
gsutil setmeta -h "Cache-Control: public, max-age=31536000" gs://bazel-mirror/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib{,-gazelle-plugin}-$VERSION.tar.gz
9194
```
92-
93-
6. Obtain checksums for release notes:
94-
95-
```bash
96-
sha256sum bazel-bin/distribution/bazel-skylib-$VERSION.tar.gz
97-
sha256sum bazel-bin/distribution/bazel-skylib-gazelle-plugin-$VERSION.tar.gz
98-
````
99-
100-
7. Draft a new release with a new tag named $VERSION in github. Attach
101-
`bazel-skylib-$VERSION.tar.gz` and
102-
`bazel-skylib-gazelle-plugin-$VERSION.tar.gz` to the release. For the
103-
release notes, use the CHANGELOG.md entry plus the following template:
104-
105-
--------------------------------------------------------------------------------
106-
107-
**WORKSPACE setup**
108-
109-
```
110-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
111-
112-
http_archive(
113-
name = "bazel_skylib",
114-
sha256 = "$SHA256SUM",
115-
urls = [
116-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-$VERSION.tar.gz",
117-
"https://github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-$VERSION.tar.gz",
118-
],
119-
)
120-
121-
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
122-
123-
bazel_skylib_workspace()
124-
```
125-
126-
***Additional WORKSPACE setup for the Gazelle plugin***
127-
128-
```starlark
129-
http_archive(
130-
name = "bazel_skylib_gazelle_plugin",
131-
sha256 = "$SHA256SUM_GAZELLE_PLUGIN",
132-
urls = [
133-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-gazelle-plugin-$VERSION.tar.gz",
134-
"https://github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-gazelle-plugin-$VERSION.tar.gz",
135-
],
136-
)
137-
138-
load("@bazel_skylib_gazelle_plugin//:workspace.bzl", "bazel_skylib_gazelle_plugin_workspace")
139-
140-
bazel_skylib_gazelle_plugin_workspace()
141-
142-
load("@bazel_skylib_gazelle_plugin//:setup.bzl", "bazel_skylib_gazelle_plugin_setup")
143-
144-
bazel_skylib_gazelle_plugin_setup()
145-
```
146-
147-
**Using the rules**
148-
149-
See [the source](https://github.com/bazelbuild/bazel-skylib/tree/$VERSION).
150-
151-
--------------------------------------------------------------------------------
152-
153-
8. Review a PR at [Bazel Central Registry](https://github.com/bazelbuild/bazel-central-registry)
154-
created by Publish-to-BCR plugin.
155-
156-
Use https://github.com/bazelbuild/bazel-central-registry/pull/403 as the
157-
model.
158-
159-
9. Once the Bazel Central Registry PR is merged, insert in the release
160-
description after the WORKSPACE setup section:
161-
162-
--------------------------------------------------------------------------------
163-
164-
**MODULE.bazel setup**
165-
166-
```starlark
167-
bazel_dep(name = "bazel_skylib", version = "$VERSION")
168-
```
169-
170-
And for the Gazelle plugin:
171-
172-
```starlark
173-
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "$VERSION", dev_dependency = True)
174-
```
175-
176-
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)