Skip to content

Commit d7b7e78

Browse files
committed
Merge remote-tracking branch 'upstream/main' into remove-cc-defs
2 parents 21e7790 + 4864d63 commit d7b7e78

File tree

29 files changed

+16768
-5469
lines changed

29 files changed

+16768
-5469
lines changed

.bazelci/presubmit.yml

Lines changed: 25 additions & 5 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"
@@ -120,16 +123,22 @@ tasks:
120123
<<: *common_workspace_flags_min_bazel
121124
name: "Default: Ubuntu, workspace, minimum Bazel"
122125
platform: ubuntu2004
126+
123127
ubuntu_min_bzlmod:
124128
<<: *minimum_supported_version
125129
<<: *reusable_config
126130
name: "Default: Ubuntu, bzlmod, minimum Bazel"
127131
platform: ubuntu2004
132+
bazel: 7.x
128133
ubuntu:
129134
<<: *reusable_config
130135
name: "Default: Ubuntu"
131136
platform: ubuntu2004
132-
137+
ubuntu_upcoming:
138+
<<: *reusable_config
139+
name: "Default: Ubuntu, upcoming Bazel"
140+
platform: ubuntu2004
141+
bazel: last_rc
133142
pystar_ubuntu_workspace:
134143
<<: *reusable_config
135144
<<: *pystar_base
@@ -171,6 +180,7 @@ tasks:
171180
<<: *reusable_config
172181
name: "RBE: Ubuntu, minimum Bazel"
173182
platform: rbe_ubuntu2004
183+
bazel: 7.x
174184
build_flags:
175185
# BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1,
176186
# which prevents cc toolchain autodetection from working correctly
@@ -232,24 +242,28 @@ tasks:
232242
name: "examples/bzlmod: Ubuntu, minimum Bazel"
233243
working_directory: examples/bzlmod
234244
platform: ubuntu2004
245+
bazel: 7.x
235246
integration_test_bzlmod_ubuntu:
236247
<<: *reusable_build_test_all
237248
<<: *coverage_targets_example_bzlmod
238249
name: "examples/bzlmod: Ubuntu"
239250
working_directory: examples/bzlmod
240251
platform: ubuntu2004
252+
bazel: 7.x
241253
integration_test_bzlmod_debian:
242254
<<: *reusable_build_test_all
243255
<<: *coverage_targets_example_bzlmod
244256
name: "examples/bzlmod: Debian"
245257
working_directory: examples/bzlmod
246258
platform: debian11
259+
bazel: 7.x
247260
integration_test_bzlmod_macos:
248261
<<: *reusable_build_test_all
249262
<<: *coverage_targets_example_bzlmod
250263
name: "examples/bzlmod: macOS"
251264
working_directory: examples/bzlmod
252265
platform: macos
266+
bazel: 7.x
253267
integration_test_bzlmod_windows:
254268
<<: *reusable_build_test_all
255269
# coverage is not supported on Windows
@@ -262,6 +276,7 @@ tasks:
262276
name: "examples/bzlmod: Ubuntu with lockfile"
263277
working_directory: examples/bzlmod
264278
platform: ubuntu2004
279+
bazel: 7.x
265280
shell_commands:
266281
# Update the lockfiles and fail if it is different.
267282
- "../../tools/private/update_bzlmod_lockfiles.sh"
@@ -272,6 +287,7 @@ tasks:
272287
name: "examples/bzlmod: macOS with lockfile"
273288
working_directory: examples/bzlmod
274289
platform: macos
290+
bazel: 7.x
275291
shell_commands:
276292
# Update the lockfiles and fail if it is different.
277293
- "../../tools/private/update_bzlmod_lockfiles.sh"
@@ -284,6 +300,7 @@ tasks:
284300
name: "examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
285301
working_directory: examples/bzlmod_build_file_generation
286302
platform: ubuntu2004
303+
bazel: 7.x
287304
integration_test_bzlmod_generation_build_files_ubuntu:
288305
<<: *reusable_build_test_all
289306
<<: *coverage_targets_example_bzlmod_build_file_generation
@@ -350,15 +367,16 @@ tasks:
350367
<<: *minimum_supported_version
351368
<<: *common_workspace_flags_min_bazel
352369
<<: *reusable_build_test_all
353-
name: "examples/pip_parse: Ubuntu, workspace, minimum supporte Bazel version"
370+
name: "examples/pip_parse: Ubuntu, workspace, minimum supported Bazel version"
354371
working_directory: examples/pip_parse
355372
platform: ubuntu2004
356373
integration_test_pip_parse_ubuntu_min_bzlmod:
357374
<<: *minimum_supported_version
358375
<<: *reusable_build_test_all
359-
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supporte Bazel version"
376+
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supported Bazel version"
360377
working_directory: examples/pip_parse
361378
platform: ubuntu2004
379+
bazel: 7.x
362380
integration_test_pip_parse_ubuntu:
363381
<<: *reusable_build_test_all
364382
name: "examples/pip_parse: Ubuntu"
@@ -393,6 +411,7 @@ tasks:
393411
name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel"
394412
working_directory: examples/pip_parse_vendored
395413
platform: ubuntu2004
414+
bazel: 7.x
396415
integration_test_pip_parse_vendored_ubuntu:
397416
<<: *reusable_build_test_all
398417
name: "examples/pip_parse_vendored: Ubuntu"
@@ -573,6 +592,7 @@ tasks:
573592
name: "compile_pip_requirements_test_from_external_repo: Ubuntu, bzlmod, minimum Bazel"
574593
working_directory: tests/integration/compile_pip_requirements_test_from_external_repo
575594
platform: ubuntu2004
595+
bazel: 7.x
576596
shell_commands:
577597
# Assert that @compile_pip_requirements//:requirements_test does the right thing.
578598
- "bazel test @compile_pip_requirements//..."

.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:

CHANGELOG.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,41 @@ A brief description of the categories of changes:
2828
{#v0-0-0-changed}
2929
### Changed
3030
* (deps) bazel_skylib 1.6.1 -> 1.7.1
31+
* (deps) rules_cc 0.0.9 -> 0.0.14
32+
* (deps) protobuf 24.4 -> 29.0-rc2
33+
* (deps) rules_proto 6.0.0-rc1 -> 6.0.2
34+
* (deps) stardoc 0.6.2 -> 0.7.1
35+
* For bzlmod, Bazel 7.4 is now the minimum Bazel version.
36+
* (toolchains) Use the latest indygreg toolchain release [20241016] for Python versions:
37+
* 3.9.20
38+
* 3.10.15
39+
* 3.11.10
40+
* 3.12.7
41+
* 3.13.0
42+
* (pypi) The naming scheme for the `bzlmod` spoke repositories have changed as
43+
all of the given `requirements.txt` files are now parsed by `default`, to
44+
temporarily restore the behavior, you can use
45+
{bzl:obj}`pip.parse.extra_hub_aliases`, which will be removed or made noop in
46+
the future.
47+
48+
[20241016]: https://github.com/indygreg/python-build-standalone/releases/tag/20241016
3149

3250
{#v0-0-0-fixed}
3351
### Fixed
3452
* Nothing yet
3553

3654
{#v0-0-0-added}
3755
### Added
38-
* Nothing yet
56+
* Bazel 8 is now supported.
57+
* (toolchain) Support for freethreaded Python toolchains is now available. Use
58+
the config flag `//python/config_settings:py_freethreaded` to toggle the
59+
selection of the free-threaded toolchains.
60+
* (toolchain) {obj}`py_runtime.abi_flags` attribute and
61+
{obj}`PyRuntimeInfo.abi_flags` field added.
3962

4063
{#v0-0-0-removed}
4164
### Removed
42-
* Nothing yet
65+
* Support for Bazel 6 using bzlmod has been dropped.
4366

4467
{#v0-38-0}
4568
## [0.38.0] - 2024-11-08

MODULE.bazel

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ module(
66

77
bazel_dep(name = "bazel_features", version = "1.9.1")
88
bazel_dep(name = "bazel_skylib", version = "1.7.1")
9-
bazel_dep(name = "rules_cc", version = "0.0.13")
9+
bazel_dep(name = "rules_cc", version = "0.0.14")
1010
bazel_dep(name = "platforms", version = "0.0.4")
1111

1212
# Those are loaded only when using py_proto_library
13-
bazel_dep(name = "rules_proto", version = "6.0.0-rc1")
14-
bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf")
13+
bazel_dep(name = "rules_proto", version = "6.0.2")
14+
bazel_dep(name = "protobuf", version = "29.0-rc2", repo_name = "com_google_protobuf")
1515

1616
internal_deps = use_extension("//python/private:internal_deps.bzl", "internal_deps")
1717
use_repo(
@@ -71,7 +71,7 @@ pip.parse(
7171
use_repo(pip, "rules_python_publish_deps")
7272

7373
# Not a dev dependency to allow usage of //sphinxdocs code, which refers to stardoc repos.
74-
bazel_dep(name = "stardoc", version = "0.6.2", repo_name = "io_bazel_stardoc")
74+
bazel_dep(name = "stardoc", version = "0.7.1", repo_name = "io_bazel_stardoc")
7575

7676
# ===== DEV ONLY DEPS AND SETUP BELOW HERE =====
7777
bazel_dep(name = "rules_bazel_integration_test", version = "0.26.1", dev_dependency = True)
@@ -83,8 +83,18 @@ bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
8383
# Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests.
8484
# We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides.
8585
bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
86-
bazel_dep(name = "gazelle", version = "0.33.0", dev_dependency = True, repo_name = "bazel_gazelle")
8786
bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True)
87+
bazel_dep(name = "gazelle", version = "0.33.0", dev_dependency = True, repo_name = "bazel_gazelle")
88+
single_version_override(
89+
module_name = "gazelle",
90+
patch_strip = 1,
91+
patches = [
92+
# Can be removed once https://github.com/bazel-contrib/bazel-gazelle/issues/1959
93+
# is fixed and released.
94+
"patches/gazelle_native_sh.patch",
95+
],
96+
version = "0.33.0",
97+
)
8898

8999
internal_dev_deps = use_extension(
90100
"//python/private:internal_dev_deps.bzl",
@@ -144,17 +154,20 @@ bazel_binaries.local(
144154
path = "tests/integration/bazel_from_env",
145155
)
146156
bazel_binaries.download(version = "6.4.0")
147-
bazel_binaries.download(version = "7.3.1")
148-
bazel_binaries.download(version = "rolling")
157+
bazel_binaries.download(version = "7.4.0")
158+
159+
# For now, don't test with rolling, because that's Bazel 9, which is a ways
160+
# away.
161+
# bazel_binaries.download(version = "rolling")
149162
use_repo(
150163
bazel_binaries,
151164
"bazel_binaries",
152165
# These don't appear necessary, but are reported as direct dependencies
153166
# that should be use_repo()'d, so we add them as requested
154167
"bazel_binaries_bazelisk",
155168
"build_bazel_bazel_6_4_0",
156-
"build_bazel_bazel_7_3_1",
157-
"build_bazel_bazel_rolling",
169+
"build_bazel_bazel_7_4_0",
170+
# "build_bazel_bazel_rolling",
158171
"build_bazel_bazel_self",
159172
)
160173

docs/api/rules_python/python/config_settings/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,16 @@ Values:
149149
:::
150150
::::
151151

152+
::::{bzl:flag} py_freethreaded
153+
Set whether to use an interpreter with the experimental freethreaded option set to true.
154+
155+
Values:
156+
* `no`: Use regular Python toolchains, default.
157+
* `yes`: Use the experimental Python toolchain with freethreaded compile option enabled.
158+
:::{versionadded} 0.38.0
159+
:::
160+
::::
161+
152162
::::{bzl:flag} pip_whl
153163
Set what distributions are used in the `pip` integration.
154164

examples/bzlmod/.bazelversion

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

examples/bzlmod/MODULE.bazel

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,20 @@ local_path_override(
1212
)
1313

1414
# (py_proto_library specific) We are using rules_proto to define rules_proto targets to be consumed by py_proto_library.
15-
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
15+
bazel_dep(name = "rules_proto", version = "6.0.0-rc1")
1616

1717
# (py_proto_library specific) Add the protobuf library for well-known types (e.g. `Any`, `Timestamp`, etc)
18-
bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf")
18+
bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf")
19+
20+
# Only needed to make rules_python's CI happy. rules_java 8.3.0+ is needed so
21+
# that --java_runtime_version=remotejdk_11 works with Bazel 8.
22+
bazel_dep(name = "rules_java", version = "8.3.0")
23+
24+
# Only needed to make rules_python's CI happy. A test verifies that
25+
# MODULE.bazel.lock is cross-platform friendly, and there are transitive
26+
# dependencies on rules_rust, so we need rules_rust 0.54.1+ where such issues
27+
# were fixed.
28+
bazel_dep(name = "rules_rust", version = "0.54.1")
1929

2030
# We next initialize the python toolchain using the extension.
2131
# You can set different Python versions in this block.

0 commit comments

Comments
 (0)