Skip to content

Commit 5012a5c

Browse files
committed
Merge remote-tracking branch 'upstream/main' into add-python3lib-windows
2 parents 5f4179e + be704e2 commit 5012a5c

File tree

801 files changed

+39460
-17466
lines changed

Some content is hidden

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

801 files changed

+39460
-17466
lines changed

.bazelci/presubmit.yml

Lines changed: 88 additions & 44 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
@@ -33,16 +34,26 @@ buildifier:
3334
build_flags:
3435
- "--keep_going"
3536
- "--build_tag_filters=-integration-test"
37+
- "--config=bazel7.x"
3638
test_targets:
3739
- "--"
3840
- "..."
3941
test_flags:
4042
- "--test_tag_filters=-integration-test"
43+
.common_workspace_flags_min_bazel: &common_workspace_flags_min_bazel
44+
build_flags:
45+
- "--noenable_bzlmod"
46+
- "--build_tag_filters=-integration-test"
47+
test_flags:
48+
- "--noenable_bzlmod"
49+
- "--test_tag_filters=-integration-test"
4150
.common_workspace_flags: &common_workspace_flags
4251
test_flags:
4352
- "--noenable_bzlmod"
53+
- "--enable_workspace"
4454
build_flags:
4555
- "--noenable_bzlmod"
56+
- "--enable_workspace"
4657
.common_bazelinbazel_config: &common_bazelinbazel_config
4758
build_flags:
4859
- "--build_tag_filters=integration-test"
@@ -74,17 +85,9 @@ buildifier:
7485
- //tests:version_3_8_test
7586
- //tests:version_3_9_test
7687
- //tests:version_default_test
77-
.pystar_base: &pystar_base
78-
bazel: "7.x"
79-
environment:
80-
RULES_PYTHON_ENABLE_PYSTAR: "1"
81-
test_flags:
82-
# The doc check tests fail because the Starlark implementation makes the
83-
# PyInfo and PyRuntimeInfo symbols become documented.
84-
- "--test_tag_filters=-integration-test,-doc_check_test"
8588
tasks:
8689
gazelle_extension_min:
87-
<<: *common_workspace_flags
90+
<<: *common_workspace_flags_min_bazel
8891
<<: *minimum_supported_version
8992
name: "Gazelle: workspace, minumum supported Bazel version"
9093
platform: ubuntu2004
@@ -108,40 +111,61 @@ tasks:
108111
ubuntu_min_workspace:
109112
<<: *minimum_supported_version
110113
<<: *reusable_config
111-
<<: *common_workspace_flags
114+
<<: *common_workspace_flags_min_bazel
112115
name: "Default: Ubuntu, workspace, minimum Bazel"
113116
platform: ubuntu2004
117+
114118
ubuntu_min_bzlmod:
115119
<<: *minimum_supported_version
116120
<<: *reusable_config
117121
name: "Default: Ubuntu, bzlmod, minimum Bazel"
118122
platform: ubuntu2004
123+
bazel: 7.x
119124
ubuntu:
120125
<<: *reusable_config
121126
name: "Default: Ubuntu"
122127
platform: ubuntu2004
123-
124-
pystar_ubuntu_workspace:
128+
ubuntu_upcoming:
125129
<<: *reusable_config
126-
<<: *pystar_base
127-
name: "Default test: Ubuntu, Pystar, workspace"
130+
name: "Default: Ubuntu, upcoming Bazel"
128131
platform: ubuntu2004
129-
pystar_ubuntu_bzlmod:
132+
bazel: last_rc
133+
ubuntu_workspace:
130134
<<: *reusable_config
131-
<<: *pystar_base
132-
name: "Default test: Ubuntu, Pystar, bzlmod"
135+
<<: *common_workspace_flags
136+
name: "Default: Ubuntu, workspace"
133137
platform: ubuntu2004
134-
pystar_mac_workspace:
138+
mac_workspace:
135139
<<: *reusable_config
136140
<<: *common_workspace_flags
137-
<<: *pystar_base
138-
name: "Default test: Mac, Pystar, workspace"
141+
name: "Default: Mac, workspace"
139142
platform: macos
140-
pystar_windows_workspace:
143+
windows_workspace:
141144
<<: *reusable_config
142-
<<: *pystar_base
143-
name: "Default test: Windows, Pystar, workspace"
145+
<<: *common_workspace_flags
146+
name: "Default: Windows, workspace"
144147
platform: windows
148+
# Most of tests/integration are failing on Windows w/workspace. Skip them
149+
# for now until we can look into it.
150+
build_targets:
151+
- "--"
152+
- "..."
153+
# As a regression test for #225, check that wheel targets still build when
154+
# their package path is qualified with the repo name.
155+
- "@rules_python//examples/wheel/..."
156+
build_flags:
157+
- "--noenable_bzlmod"
158+
- "--enable_workspace"
159+
- "--keep_going"
160+
- "--build_tag_filters=-integration-test"
161+
- "--config=bazel7.x"
162+
test_targets:
163+
- "--"
164+
- "..."
165+
test_flags:
166+
- "--noenable_bzlmod"
167+
- "--enable_workspace"
168+
- "--test_tag_filters=-integration-test"
145169

146170
debian:
147171
<<: *reusable_config
@@ -161,7 +185,8 @@ tasks:
161185
<<: *minimum_supported_version
162186
<<: *reusable_config
163187
name: "RBE: Ubuntu, minimum Bazel"
164-
platform: rbe_ubuntu1604
188+
platform: rbe_ubuntu2004
189+
bazel: 7.x
165190
build_flags:
166191
# BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1,
167192
# which prevents cc toolchain autodetection from working correctly
@@ -179,14 +204,15 @@ tasks:
179204
rbe:
180205
<<: *reusable_config
181206
name: "RBE: Ubuntu"
182-
platform: rbe_ubuntu1604
207+
platform: rbe_ubuntu2004
183208
test_flags:
184209
- "--test_tag_filters=-integration-test,-acceptance-test"
210+
- "--extra_toolchains=@buildkite_config//config:cc-toolchain"
185211

186212
integration_test_build_file_generation_ubuntu_minimum_supported_workspace:
187213
<<: *minimum_supported_version
188214
<<: *reusable_build_test_all
189-
<<: *common_workspace_flags
215+
<<: *common_workspace_flags_min_bazel
190216
name: "examples/build_file_generation: Ubuntu, workspace, minimum Bazel"
191217
working_directory: examples/build_file_generation
192218
platform: ubuntu2004
@@ -222,30 +248,56 @@ tasks:
222248
name: "examples/bzlmod: Ubuntu, minimum Bazel"
223249
working_directory: examples/bzlmod
224250
platform: ubuntu2004
251+
bazel: 7.x
225252
integration_test_bzlmod_ubuntu:
226253
<<: *reusable_build_test_all
227254
<<: *coverage_targets_example_bzlmod
228255
name: "examples/bzlmod: Ubuntu"
229256
working_directory: examples/bzlmod
230257
platform: ubuntu2004
258+
bazel: 7.x
259+
integration_test_bzlmod_ubuntu_upcoming:
260+
<<: *reusable_build_test_all
261+
<<: *coverage_targets_example_bzlmod
262+
name: "examples/bzlmod: Ubuntu, upcoming Bazel"
263+
working_directory: examples/bzlmod
264+
platform: ubuntu2004
265+
bazel: last_rc
231266
integration_test_bzlmod_debian:
232267
<<: *reusable_build_test_all
233268
<<: *coverage_targets_example_bzlmod
234269
name: "examples/bzlmod: Debian"
235270
working_directory: examples/bzlmod
236271
platform: debian11
272+
bazel: 7.x
237273
integration_test_bzlmod_macos:
238274
<<: *reusable_build_test_all
239275
<<: *coverage_targets_example_bzlmod
240276
name: "examples/bzlmod: macOS"
241277
working_directory: examples/bzlmod
242278
platform: macos
279+
bazel: 7.x
280+
integration_test_bzlmod_macos_upcoming:
281+
<<: *reusable_build_test_all
282+
<<: *coverage_targets_example_bzlmod
283+
name: "examples/bzlmod: macOS, upcoming Bazel"
284+
working_directory: examples/bzlmod
285+
platform: macos
286+
bazel: last_rc
243287
integration_test_bzlmod_windows:
244288
<<: *reusable_build_test_all
245289
# coverage is not supported on Windows
246290
name: "examples/bzlmod: Windows"
247291
working_directory: examples/bzlmod
248292
platform: windows
293+
bazel: 7.x
294+
integration_test_bzlmod_windows_upcoming:
295+
<<: *reusable_build_test_all
296+
# coverage is not supported on Windows
297+
name: "examples/bzlmod: Windows, upcoming Bazel"
298+
working_directory: examples/bzlmod
299+
platform: windows
300+
bazel: last_rc
249301

250302
integration_test_bzlmod_generate_build_file_generation_ubuntu_min:
251303
<<: *minimum_supported_version
@@ -254,6 +306,7 @@ tasks:
254306
name: "examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
255307
working_directory: examples/bzlmod_build_file_generation
256308
platform: ubuntu2004
309+
bazel: 7.x
257310
integration_test_bzlmod_generation_build_files_ubuntu:
258311
<<: *reusable_build_test_all
259312
<<: *coverage_targets_example_bzlmod_build_file_generation
@@ -271,7 +324,7 @@ tasks:
271324
integration_test_bzlmod_build_file_generation_debian:
272325
<<: *reusable_build_test_all
273326
<<: *coverage_targets_example_bzlmod_build_file_generation
274-
name: "examples/bzlmod_build_file_integration: Debian"
327+
name: "examples/bzlmod_build_file_generation: Debian"
275328
working_directory: examples/bzlmod_build_file_generation
276329
platform: debian11
277330
integration_test_bzlmod_build_file_generation_macos:
@@ -318,17 +371,18 @@ tasks:
318371

319372
integration_test_pip_parse_ubuntu_min_workspace:
320373
<<: *minimum_supported_version
321-
<<: *common_workspace_flags
374+
<<: *common_workspace_flags_min_bazel
322375
<<: *reusable_build_test_all
323-
name: "examples/pip_parse: Ubuntu, workspace, minimum supporte Bazel version"
376+
name: "examples/pip_parse: Ubuntu, workspace, minimum supported Bazel version"
324377
working_directory: examples/pip_parse
325378
platform: ubuntu2004
326379
integration_test_pip_parse_ubuntu_min_bzlmod:
327380
<<: *minimum_supported_version
328381
<<: *reusable_build_test_all
329-
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supporte Bazel version"
382+
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supported Bazel version"
330383
working_directory: examples/pip_parse
331384
platform: ubuntu2004
385+
bazel: 7.x
332386
integration_test_pip_parse_ubuntu:
333387
<<: *reusable_build_test_all
334388
name: "examples/pip_parse: Ubuntu"
@@ -352,7 +406,7 @@ tasks:
352406

353407
integration_test_pip_parse_vendored_ubuntu_min_workspace:
354408
<<: *minimum_supported_version
355-
<<: *common_workspace_flags
409+
<<: *common_workspace_flags_min_bazel
356410
<<: *reusable_build_test_all
357411
name: "examples/pip_parse_vendored: Ubuntu, workspace, minimum Bazel"
358412
working_directory: examples/pip_parse_vendored
@@ -363,6 +417,7 @@ tasks:
363417
name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel"
364418
working_directory: examples/pip_parse_vendored
365419
platform: ubuntu2004
420+
bazel: 7.x
366421
integration_test_pip_parse_vendored_ubuntu:
367422
<<: *reusable_build_test_all
368423
name: "examples/pip_parse_vendored: Ubuntu"
@@ -515,18 +570,6 @@ tasks:
515570
- "bazel run //:os_specific_requirements.update"
516571
- "git diff --exit-code"
517572

518-
integration_test_pip_repository_entry_points_macos_workspace:
519-
<<: *reusable_build_test_all
520-
<<: *common_workspace_flags
521-
name: "pip_repository_entry_points: macOS, workspace"
522-
working_directory: tests/integration/pip_repository_entry_points
523-
platform: macos
524-
integration_test_pip_repository_entry_points_windows_workspace:
525-
<<: *reusable_build_test_all
526-
<<: *common_workspace_flags
527-
name: "pip_repository_entry_points: Windows, workspace"
528-
working_directory: tests/integration/pip_repository_entry_points
529-
platform: windows
530573

531574
integration_test_ignore_root_user_error_macos_workspace:
532575
<<: *reusable_build_test_all
@@ -543,7 +586,7 @@ tasks:
543586

544587
integration_compile_pip_requirements_test_from_external_repo_ubuntu_min_workspace:
545588
<<: *minimum_supported_version
546-
<<: *common_workspace_flags
589+
<<: *common_workspace_flags_min_bazel
547590
name: "compile_pip_requirements_test_from_external_repo: Ubuntu, workspace, minimum Bazel"
548591
working_directory: tests/integration/compile_pip_requirements_test_from_external_repo
549592
platform: ubuntu2004
@@ -555,6 +598,7 @@ tasks:
555598
name: "compile_pip_requirements_test_from_external_repo: Ubuntu, bzlmod, minimum Bazel"
556599
working_directory: tests/integration/compile_pip_requirements_test_from_external_repo
557600
platform: ubuntu2004
601+
bazel: 7.x
558602
shell_commands:
559603
# Assert that @compile_pip_requirements//:requirements_test does the right thing.
560604
- "bazel test @compile_pip_requirements//..."

.bazelignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ examples/pip_parse_vendored/bazel-pip_parse_vendored
2525
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
28-
tests/integration/pip_repository_entry_points/bazel-pip_repository_entry_points
28+
tests/integration/local_toolchains/bazel-local_toolchains
29+
tests/integration/py_cc_toolchain_registered/bazel-py_cc_toolchain_registered

.bazelrc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
55
# To update these lines, execute
66
# `bazel run @rules_bazel_integration_test//tools:update_deleted_packages`
7-
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/dupe_requirements,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/pip_repository_entry_points,tests/integration/py_cc_toolchain_registered
8-
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/dupe_requirements,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/pip_repository_entry_points,tests/integration/py_cc_toolchain_registered
7+
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,gazelle/python/private,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/custom_commands,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/local_toolchains,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered
8+
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,gazelle/python/private,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/custom_commands,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/local_toolchains,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered
99

1010
test --test_output=errors
1111

@@ -17,6 +17,9 @@ test --test_output=errors
1717
# Python targets as required.
1818
build --incompatible_default_to_explicit_init_py
1919

20+
# Ensure ongoing compatibility with this flag.
21+
common --incompatible_disallow_struct_provider_syntax
22+
2023
# Windows makes use of runfiles for some rules
2124
build --enable_runfiles
2225

@@ -30,4 +33,6 @@ build:rtd --stamp
3033
# Some bzl files contain repos only available under bzlmod
3134
build:rtd --enable_bzlmod
3235

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

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.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/gazelle/presubmit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ bcr_test_module:
1616
module_path: "../examples/bzlmod_build_file_generation"
1717
matrix:
1818
platform: ["debian11", "macos", "ubuntu2004", "windows"]
19+
# last_rc is to get latest 8.x release. Replace with 8.x when available.
20+
bazel: [7.x, last_rc]
1921
tasks:
2022
run_tests:
2123
name: "Run test module"
2224
platform: ${{ platform }}
25+
bazel: ${{ bazel }}
2326
build_targets:
2427
- "//..."
2528
- ":modules_map"

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

0 commit comments

Comments
 (0)