Skip to content

Commit 4c441d3

Browse files
committed
Merge branch 'main' into chore/auto-exec-groups
2 parents c721920 + 7b95ea6 commit 4c441d3

File tree

182 files changed

+23815
-8601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+23815
-8601
lines changed

.bazelci/presubmit.yml

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ buildifier:
1818
# Use a specific version to avoid skew issues when new versions are released.
1919
version: 6.1.0
2020
warnings: "all"
21+
# NOTE: Minimum supported version is 6.x for workspace; 7.x for bzlmod
2122
.minimum_supported_version: &minimum_supported_version
2223
# For testing minimum supported version.
2324
# NOTE: Keep in sync with //:version.bzl
@@ -39,10 +40,12 @@ buildifier:
3940
test_flags:
4041
- "--test_tag_filters=-integration-test"
4142
.common_workspace_flags_min_bazel: &common_workspace_flags_min_bazel
42-
test_flags:
43-
- "--noenable_bzlmod"
4443
build_flags:
4544
- "--noenable_bzlmod"
45+
- "--build_tag_filters=-integration-test"
46+
test_flags:
47+
- "--noenable_bzlmod"
48+
- "--test_tag_filters=-integration-test"
4649
.common_workspace_flags: &common_workspace_flags
4750
test_flags:
4851
- "--noenable_bzlmod"
@@ -65,15 +68,6 @@ buildifier:
6568
.reusable_build_test_all: &reusable_build_test_all
6669
build_targets: ["..."]
6770
test_targets: ["..."]
68-
.lockfile_mode_error: &lockfile_mode_error
69-
# For testing lockfile support
70-
skip_in_bazel_downstream_pipeline: "Lockfile depends on the bazel version"
71-
build_flags:
72-
- "--lockfile_mode=error"
73-
test_flags:
74-
- "--lockfile_mode=error"
75-
coverage_flags:
76-
- "--lockfile_mode=error"
7771
.coverage_targets_example_bzlmod: &coverage_targets_example_bzlmod
7872
coverage_targets: ["..."]
7973
.coverage_targets_example_bzlmod_build_file_generation: &coverage_targets_example_bzlmod_build_file_generation
@@ -94,6 +88,8 @@ buildifier:
9488
bazel: "7.x"
9589
environment:
9690
RULES_PYTHON_ENABLE_PYSTAR: "1"
91+
build_flags:
92+
- "--config=bazel7.x"
9793
test_flags:
9894
# The doc check tests fail because the Starlark implementation makes the
9995
# PyInfo and PyRuntimeInfo symbols become documented.
@@ -127,16 +123,22 @@ tasks:
127123
<<: *common_workspace_flags_min_bazel
128124
name: "Default: Ubuntu, workspace, minimum Bazel"
129125
platform: ubuntu2004
126+
130127
ubuntu_min_bzlmod:
131128
<<: *minimum_supported_version
132129
<<: *reusable_config
133130
name: "Default: Ubuntu, bzlmod, minimum Bazel"
134131
platform: ubuntu2004
132+
bazel: 7.x
135133
ubuntu:
136134
<<: *reusable_config
137135
name: "Default: Ubuntu"
138136
platform: ubuntu2004
139-
137+
ubuntu_upcoming:
138+
<<: *reusable_config
139+
name: "Default: Ubuntu, upcoming Bazel"
140+
platform: ubuntu2004
141+
bazel: last_rc
140142
pystar_ubuntu_workspace:
141143
<<: *reusable_config
142144
<<: *pystar_base
@@ -177,7 +179,8 @@ tasks:
177179
<<: *minimum_supported_version
178180
<<: *reusable_config
179181
name: "RBE: Ubuntu, minimum Bazel"
180-
platform: rbe_ubuntu1604
182+
platform: rbe_ubuntu2004
183+
bazel: 7.x
181184
build_flags:
182185
# BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1,
183186
# which prevents cc toolchain autodetection from working correctly
@@ -195,7 +198,7 @@ tasks:
195198
rbe:
196199
<<: *reusable_config
197200
name: "RBE: Ubuntu"
198-
platform: rbe_ubuntu1604
201+
platform: rbe_ubuntu2004
199202
test_flags:
200203
- "--test_tag_filters=-integration-test,-acceptance-test"
201204
- "--extra_toolchains=@buildkite_config//config:cc-toolchain"
@@ -239,24 +242,28 @@ tasks:
239242
name: "examples/bzlmod: Ubuntu, minimum Bazel"
240243
working_directory: examples/bzlmod
241244
platform: ubuntu2004
245+
bazel: 7.x
242246
integration_test_bzlmod_ubuntu:
243247
<<: *reusable_build_test_all
244248
<<: *coverage_targets_example_bzlmod
245249
name: "examples/bzlmod: Ubuntu"
246250
working_directory: examples/bzlmod
247251
platform: ubuntu2004
252+
bazel: 7.x
248253
integration_test_bzlmod_debian:
249254
<<: *reusable_build_test_all
250255
<<: *coverage_targets_example_bzlmod
251256
name: "examples/bzlmod: Debian"
252257
working_directory: examples/bzlmod
253258
platform: debian11
259+
bazel: 7.x
254260
integration_test_bzlmod_macos:
255261
<<: *reusable_build_test_all
256262
<<: *coverage_targets_example_bzlmod
257263
name: "examples/bzlmod: macOS"
258264
working_directory: examples/bzlmod
259265
platform: macos
266+
bazel: 7.x
260267
integration_test_bzlmod_windows:
261268
<<: *reusable_build_test_all
262269
# coverage is not supported on Windows
@@ -266,17 +273,25 @@ tasks:
266273
integration_test_bzlmod_ubuntu_lockfile:
267274
<<: *reusable_build_test_all
268275
<<: *coverage_targets_example_bzlmod
269-
<<: *lockfile_mode_error
270276
name: "examples/bzlmod: Ubuntu with lockfile"
271277
working_directory: examples/bzlmod
272278
platform: ubuntu2004
279+
bazel: 7.x
280+
shell_commands:
281+
# Update the lockfiles and fail if it is different.
282+
- "../../tools/private/update_bzlmod_lockfiles.sh"
283+
- "git diff --exit-code"
273284
integration_test_bzlmod_macos_lockfile:
274285
<<: *reusable_build_test_all
275286
<<: *coverage_targets_example_bzlmod
276-
<<: *lockfile_mode_error
277287
name: "examples/bzlmod: macOS with lockfile"
278288
working_directory: examples/bzlmod
279289
platform: macos
290+
bazel: 7.x
291+
shell_commands:
292+
# Update the lockfiles and fail if it is different.
293+
- "../../tools/private/update_bzlmod_lockfiles.sh"
294+
- "git diff --exit-code"
280295

281296
integration_test_bzlmod_generate_build_file_generation_ubuntu_min:
282297
<<: *minimum_supported_version
@@ -285,6 +300,7 @@ tasks:
285300
name: "examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
286301
working_directory: examples/bzlmod_build_file_generation
287302
platform: ubuntu2004
303+
bazel: 7.x
288304
integration_test_bzlmod_generation_build_files_ubuntu:
289305
<<: *reusable_build_test_all
290306
<<: *coverage_targets_example_bzlmod_build_file_generation
@@ -302,7 +318,7 @@ tasks:
302318
integration_test_bzlmod_build_file_generation_debian:
303319
<<: *reusable_build_test_all
304320
<<: *coverage_targets_example_bzlmod_build_file_generation
305-
name: "examples/bzlmod_build_file_integration: Debian"
321+
name: "examples/bzlmod_build_file_generation: Debian"
306322
working_directory: examples/bzlmod_build_file_generation
307323
platform: debian11
308324
integration_test_bzlmod_build_file_generation_macos:
@@ -351,15 +367,16 @@ tasks:
351367
<<: *minimum_supported_version
352368
<<: *common_workspace_flags_min_bazel
353369
<<: *reusable_build_test_all
354-
name: "examples/pip_parse: Ubuntu, workspace, minimum supporte Bazel version"
370+
name: "examples/pip_parse: Ubuntu, workspace, minimum supported Bazel version"
355371
working_directory: examples/pip_parse
356372
platform: ubuntu2004
357373
integration_test_pip_parse_ubuntu_min_bzlmod:
358374
<<: *minimum_supported_version
359375
<<: *reusable_build_test_all
360-
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supporte Bazel version"
376+
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supported Bazel version"
361377
working_directory: examples/pip_parse
362378
platform: ubuntu2004
379+
bazel: 7.x
363380
integration_test_pip_parse_ubuntu:
364381
<<: *reusable_build_test_all
365382
name: "examples/pip_parse: Ubuntu"
@@ -394,6 +411,7 @@ tasks:
394411
name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel"
395412
working_directory: examples/pip_parse_vendored
396413
platform: ubuntu2004
414+
bazel: 7.x
397415
integration_test_pip_parse_vendored_ubuntu:
398416
<<: *reusable_build_test_all
399417
name: "examples/pip_parse_vendored: Ubuntu"
@@ -574,6 +592,7 @@ tasks:
574592
name: "compile_pip_requirements_test_from_external_repo: Ubuntu, bzlmod, minimum Bazel"
575593
working_directory: tests/integration/compile_pip_requirements_test_from_external_repo
576594
platform: ubuntu2004
595+
bazel: 7.x
577596
shell_commands:
578597
# Assert that @compile_pip_requirements//:requirements_test does the right thing.
579598
- "bazel test @compile_pip_requirements//..."

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ examples/py_proto_library/bazel-py_proto_library
2626
tests/integration/compile_pip_requirements/bazel-compile_pip_requirements
2727
tests/integration/ignore_root_user_error/bazel-ignore_root_user_error
2828
tests/integration/local_toolchains/bazel-local_toolchains
29+
tests/integration/py_cc_toolchain_registered/bazel-py_cc_toolchain_registered

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ build:rtd --stamp
3333
# Some bzl files contain repos only available under bzlmod
3434
build:rtd --enable_bzlmod
3535

36+
common:bazel7.x --incompatible_python_disallow_native_rules
37+
3638
build --lockfile_mode=update
3739

3840
# See https://github.com/bazelbuild/rules_python/issues/2282

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.1.0
1+
7.x

.bcr/gazelle/metadata.template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"github": "rickeylev"
88
},
99
{
10-
"name": "Thulio Ferraz Assis",
11-
"email": "[email protected]",
12-
"github": "f0rmiga"
10+
"name": "Ignas Anikevicius",
11+
"email": "[email protected]",
12+
"github": "aignas"
1313
}
1414
],
1515
"repository": [

.bcr/metadata.template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"github": "rickeylev"
88
},
99
{
10-
"name": "Thulio Ferraz Assis",
11-
"email": "[email protected]",
12-
"github": "f0rmiga"
10+
"name": "Ignas Anikevicius",
11+
"email": "[email protected]",
12+
"github": "aignas"
1313
}
1414
],
1515
"repository": [

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
python/features.bzl export-subst
12
tools/publish/*.txt linguist-generated=true

.github/workflows/create_archive_and_notes.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
2525
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
2626

2727
cat > release_notes.txt << EOF
28-
## Using Bzlmod with Bazel 6
2928
30-
**NOTE: bzlmod support is still beta. APIs subject to change.**
29+
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
30+
31+
## Using Bzlmod
3132
3233
Add to your \`MODULE.bazel\` file:
3334

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
# See https://pre-commit.com for more information
1717
# See https://pre-commit.com/hooks.html for more hooks
1818
repos:
19+
- repo: https://github.com/pre-commit/pre-commit-hooks
20+
rev: v5.0.0 # Use the ref you want to point at
21+
hooks:
22+
- id: check-merge-conflict
1923
- repo: https://github.com/keith/pre-commit-buildifier
2024
rev: 6.1.0
2125
hooks:

BUILD.bazel

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
16-
load(":version.bzl", "BAZEL_VERSION")
1716

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

@@ -24,6 +23,11 @@ exports_files([
2423
"version.bzl",
2524
])
2625

26+
exports_files(
27+
[".bazelversion"],
28+
visibility = ["//tests:__subpackages__"],
29+
)
30+
2731
exports_files(
2832
glob(["*.md"]),
2933
visibility = ["//docs:__subpackages__"],
@@ -69,29 +73,3 @@ filegroup(
6973
],
7074
visibility = ["//visibility:public"],
7175
)
72-
73-
genrule(
74-
name = "assert_bazelversion",
75-
srcs = [".bazelversion"],
76-
outs = ["assert_bazelversion_test.sh"],
77-
cmd = """\
78-
set -o errexit -o nounset -o pipefail
79-
current=$$(cat "$(execpath .bazelversion)")
80-
cat > "$@" <<EOF
81-
#!/usr/bin/env bash
82-
set -o errexit -o nounset -o pipefail
83-
if [[ \"$${{current}}\" != \"{expected}\" ]]; then
84-
>&2 echo "ERROR: current bazel version '$${{current}}' is not the expected '{expected}'"
85-
exit 1
86-
fi
87-
EOF
88-
""".format(
89-
expected = BAZEL_VERSION,
90-
),
91-
executable = True,
92-
)
93-
94-
sh_test(
95-
name = "assert_bazelversion_test",
96-
srcs = [":assert_bazelversion_test.sh"],
97-
)

0 commit comments

Comments
 (0)