Skip to content

Commit 759f5da

Browse files
aignasrickeylev
andauthored
ci: add ci config to test 7 and 8 for bcr like setup (bazel-contrib#3404)
Run the examples that BCR uses as tests in a more similar way to BCR. Unfortunately, this breaks the gazelle plugin on Windows due to bazel-contrib#3416, so testing of it is removed. Work towards bazel-contrib#3392 --------- Co-authored-by: Richard Levasseur <rlevasseur@google.com>
1 parent 411b937 commit 759f5da

File tree

10 files changed

+105
-115
lines changed

10 files changed

+105
-115
lines changed

.bazelci/presubmit.yml

Lines changed: 59 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,63 @@ buildifier:
9191
- //tests:version_3_13_test
9292
- //tests:version_3_14_test
9393
- //tests:version_default_test
94+
95+
# Keep in sync with .bcr/gazelle/presubmit.yml
96+
.gazelle_common_bcr: &gazelle_common_bcr
97+
bazel: ${{ bazel }}
98+
working_directory: gazelle/examples/bzlmod_build_file_generation
99+
shell_commands:
100+
- "echo 'common --override_module=rules_python=' >> .bazelrc"
101+
- "bazel run //:gazelle_python_manifest.update"
102+
- "bazel run //:gazelle -- update"
103+
batch_commands:
104+
- "echo common --override_module=rules_python= >> .bazelrc "
105+
- " bazel run //:gazelle_python_manifest.update "
106+
- " bazel run //:gazelle -- update"
107+
build_targets:
108+
- "//..."
109+
- ":modules_map"
110+
test_targets:
111+
- "//..."
112+
113+
114+
matrix:
115+
platform:
116+
- ubuntu2204
117+
- debian11
118+
- macos_arm64
119+
- windows
120+
bazel: [7.*, 8.*]
121+
94122
tasks:
123+
# Keep in sync with .bcr/presubmit.yml
124+
bcr_test:
125+
name: "BCR: Bazel {bazel}"
126+
platform: ${{ platform }}
127+
working_directory: examples/bzlmod
128+
bazel: ${{ bazel }}
129+
build_flags:
130+
- "--keep_going"
131+
test_flags:
132+
- "--keep_going"
133+
build_targets:
134+
- "//..."
135+
test_targets:
136+
- "//..."
137+
138+
gazelle_bcr_ubuntu:
139+
<<: *gazelle_common_bcr
140+
name: "Gazelle: BCR, Bazel {bazel}"
141+
platform: ubuntu2204
142+
gazelle_bcr_debian11:
143+
<<: *gazelle_common_bcr
144+
name: "Gazelle: BCR, Bazel {bazel}"
145+
platform: debian11
146+
gazelle_bcr_macos_arm64:
147+
<<: *gazelle_common_bcr
148+
name: "Gazelle: BCR, Bazel {bazel}"
149+
platform: macos_arm64
150+
95151
gazelle_extension_min:
96152
<<: *common_workspace_flags_min_bazel
97153
<<: *minimum_supported_version
@@ -262,113 +318,15 @@ tasks:
262318
working_directory: examples/build_file_generation
263319
platform: windows
264320

265-
integration_test_bzlmod_ubuntu_min:
266-
<<: *minimum_supported_version
267-
<<: *reusable_build_test_all
268-
coverage_targets: ["//:test"]
269-
name: "examples/bzlmod: Ubuntu, minimum Bazel"
270-
working_directory: examples/bzlmod
271-
platform: ubuntu2204
272-
bazel: 7.x
273-
integration_test_bzlmod_ubuntu:
274-
<<: *reusable_build_test_all
275-
<<: *coverage_targets_example_bzlmod
276-
name: "examples/bzlmod: Ubuntu"
277-
working_directory: examples/bzlmod
278-
platform: ubuntu2204
279-
bazel: 7.x
280-
integration_test_bzlmod_ubuntu_upcoming:
281-
<<: *reusable_build_test_all
282-
<<: *coverage_targets_example_bzlmod
283-
name: "examples/bzlmod: Ubuntu, upcoming Bazel"
284-
working_directory: examples/bzlmod
285-
platform: ubuntu2204
286-
bazel: last_rc
287-
integration_test_bzlmod_debian:
288-
<<: *reusable_build_test_all
289-
<<: *coverage_targets_example_bzlmod
290-
name: "examples/bzlmod: Debian"
291-
working_directory: examples/bzlmod
292-
platform: debian11
293-
bazel: 7.x
294321
integration_test_bzlmod_ubuntu_vendor:
295322
<<: *reusable_build_test_all
296323
name: "examples/bzlmod: bazel vendor"
297324
working_directory: examples/bzlmod
298325
platform: ubuntu2204
299326
shell_commands:
300-
- "bazel vendor --vendor_dir=./vendor //..."
301-
- "bazel build --vendor_dir=./vendor //..."
302-
- "rm -rf ./vendor"
303-
integration_test_bzlmod_macos:
304-
<<: *reusable_build_test_all
305-
<<: *coverage_targets_example_bzlmod
306-
name: "examples/bzlmod: macOS"
307-
working_directory: examples/bzlmod
308-
platform: macos_arm64
309-
bazel: 7.x
310-
integration_test_bzlmod_macos_upcoming:
311-
<<: *reusable_build_test_all
312-
<<: *coverage_targets_example_bzlmod
313-
name: "examples/bzlmod: macOS, upcoming Bazel"
314-
working_directory: examples/bzlmod
315-
platform: macos_arm64
316-
bazel: last_rc
317-
integration_test_bzlmod_windows:
318-
<<: *reusable_build_test_all
319-
# coverage is not supported on Windows
320-
name: "examples/bzlmod: Windows"
321-
working_directory: examples/bzlmod
322-
platform: windows
323-
bazel: 7.x
324-
integration_test_bzlmod_windows_upcoming:
325-
<<: *reusable_build_test_all
326-
# coverage is not supported on Windows
327-
name: "examples/bzlmod: Windows, upcoming Bazel"
328-
working_directory: examples/bzlmod
329-
platform: windows
330-
bazel: last_rc
331-
332-
integration_test_bzlmod_generate_build_file_generation_ubuntu_min:
333-
<<: *minimum_supported_version
334-
<<: *reusable_build_test_all
335-
<<: *coverage_targets_example_bzlmod_build_file_generation
336-
name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
337-
working_directory: gazelle/examples/bzlmod_build_file_generation
338-
platform: ubuntu2204
339-
bazel: 7.x
340-
integration_test_bzlmod_generation_build_files_ubuntu:
341-
<<: *reusable_build_test_all
342-
<<: *coverage_targets_example_bzlmod_build_file_generation
343-
name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu"
344-
working_directory: gazelle/examples/bzlmod_build_file_generation
345-
platform: ubuntu2204
346-
integration_test_bzlmod_generation_build_files_ubuntu_run:
347-
<<: *reusable_build_test_all
348-
name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu, Gazelle and pip"
349-
working_directory: gazelle/examples/bzlmod_build_file_generation
350-
platform: ubuntu2204
351-
shell_commands:
352-
- "bazel run //:gazelle_python_manifest.update"
353-
- "bazel run //:gazelle -- update"
354-
integration_test_bzlmod_build_file_generation_debian:
355-
<<: *reusable_build_test_all
356-
<<: *coverage_targets_example_bzlmod_build_file_generation
357-
name: "gazelle/examples/bzlmod_build_file_generation: Debian"
358-
working_directory: gazelle/examples/bzlmod_build_file_generation
359-
platform: debian11
360-
integration_test_bzlmod_build_file_generation_macos:
361-
<<: *reusable_build_test_all
362-
<<: *coverage_targets_example_bzlmod_build_file_generation
363-
name: "gazelle/examples/bzlmod_build_file_generation: MacOS"
364-
working_directory: gazelle/examples/bzlmod_build_file_generation
365-
platform: macos_arm64
366-
integration_test_bzlmod_build_file_generation_windows:
367-
<<: *reusable_build_test_all
368-
# coverage is not supported on Windows
369-
name: "gazelle/examples/bzlmod_build_file_generation: Windows"
370-
working_directory: gazelle/examples/bzlmod_build_file_generation
371-
platform: windows
327+
- "bazel vendor --vendor_dir=./vendor //..."
328+
- "bazel build --vendor_dir=./vendor //..."
329+
- "rm -rf ./vendor"
372330

373331
integration_test_multi_python_versions_ubuntu_workspace:
374332
<<: *reusable_build_test_all

.bcr/gazelle/presubmit.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,28 @@
1515
bcr_test_module:
1616
module_path: "examples/bzlmod_build_file_generation"
1717
matrix:
18-
platform: ["debian11", "macos", "ubuntu2004", "windows"]
19-
bazel: [7.x, 8.x]
18+
platform: [
19+
"debian11",
20+
"macos",
21+
"ubuntu2204",
22+
]
23+
bazel: [
24+
7.*,
25+
8.*,
26+
]
2027
tasks:
2128
run_tests:
2229
name: "Run test module"
2330
platform: ${{ platform }}
2431
bazel: ${{ bazel }}
2532
shell_commands:
2633
- "echo 'common --override_module=rules_python=' >> .bazelrc"
34+
- "bazel run //:gazelle_python_manifest.update"
35+
- "bazel run //:gazelle -- update"
2736
batch_commands:
2837
- "echo common --override_module=rules_python= >> .bazelrc"
38+
- "bazel run //:gazelle_python_manifest.update"
39+
- "bazel run //:gazelle -- update"
2940
build_targets:
3041
- "//..."
3142
- ":modules_map"

.bcr/presubmit.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@
1515
bcr_test_module:
1616
module_path: "examples/bzlmod"
1717
matrix:
18-
platform: ["debian11", "macos", "ubuntu2004", "windows"]
19-
bazel: [7.x, 8.x]
18+
platform: ["debian11", "macos", "ubuntu2204", "windows"]
19+
bazel: [7.*, 8.*]
2020
tasks:
2121
run_tests:
2222
name: "Run test module"
2323
platform: ${{ platform }}
2424
bazel: ${{ bazel }}
2525
test_flags:
26+
# Minimum bazel supported C++
2627
- "--keep_going"
27-
# Without these cxxopts, BCR's Mac builds fail
28-
- '--cxxopt=-std=c++14'
29-
- '--host_cxxopt=-std=c++14'
28+
- '--cxxopt=-std=c++17'
29+
- '--host_cxxopt=-std=c++17'
30+
build_targets:
31+
- "//..."
3032
test_targets:
3133
- "//..."

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ END_UNRELEASED_TEMPLATE
5353

5454
[0.0.0]: https://github.com/bazel-contrib/rules_python/releases/tag/0.0.0
5555

56+
{#v0-0-0-known-issues}
57+
### Known Issues
58+
* (gazelle) Windows support for the Gazelle plugin may be broken. See
59+
[#3416](https://github.com/bazel-contrib/rules_python/issues/3416) for
60+
details and possible workarounds.
61+
5662
{#v0-0-0-removed}
5763
### Removed
5864
* (toolchain) Remove all of the python 3.8 toolchain support out of the box. Users need
@@ -75,6 +81,8 @@ END_UNRELEASED_TEMPLATE
7581
* (pip) `pipstar` has been enabled for all `whl_library` instances where the whl
7682
is passed through a label or downloaded using the bazel downloader
7783
([#2949](https://github.com/bazel-contrib/rules_python/issues/2949)).
84+
* (gazelle deps) rules_go bumped from 0.55.1 to 0.59.0
85+
* (gazelle deps) gazelle bumped from 0.36.0 to 0.47.0
7886

7987
{#v0-0-0-fixed}
8088
### Fixed

examples/bzlmod/.bazelrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ startup --windows_enable_symlinks
55

66
common --enable_bzlmod
77
common --lockfile_mode=update
8+
# This adds an implicit --config=<osname>
9+
# See docs for osname values
10+
# https://bazel.build/reference/command-line-reference#common_options-flag--enable_platform_specific_config
11+
common --enable_platform_specific_config
12+
13+
common:windows --cxxopt=/std:c++17
14+
common:windows --host_cxxopt=/std:c++17
15+
common:linux --cxxopt=-std=c++17
16+
common:linux --host_cxxopt=-std=c++17
17+
common:macos --cxxopt=-std=c++17
18+
common:macos --host_cxxopt=-std=c++17
819

920
coverage --java_runtime_version=remotejdk_11
1021

examples/bzlmod/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf"
1717

1818
# Only needed to make rules_python's CI happy. rules_java 8.3.0+ is needed so
1919
# that --java_runtime_version=remotejdk_11 works with Bazel 8.
20-
bazel_dep(name = "rules_java", version = "8.3.1")
20+
bazel_dep(name = "rules_java", version = "8.16.1")
2121

2222
# Only needed to make rules_python's CI happy. A test verifies that
2323
# MODULE.bazel.lock is cross-platform friendly, and there are transitive

examples/multi_python_versions/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True)
7575

7676
# Only needed to make rules_python's CI happy. rules_java 8.3.0+ is needed so
7777
# that --java_runtime_version=remotejdk_11 works with Bazel 8.
78-
bazel_dep(name = "rules_java", version = "8.3.1")
78+
bazel_dep(name = "rules_java", version = "8.16.1")

gazelle/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module(
66

77
bazel_dep(name = "bazel_skylib", version = "1.8.2")
88
bazel_dep(name = "rules_python", version = "0.18.0")
9-
bazel_dep(name = "rules_go", version = "0.55.1", repo_name = "io_bazel_rules_go")
10-
bazel_dep(name = "gazelle", version = "0.36.0", repo_name = "bazel_gazelle")
9+
bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "io_bazel_rules_go")
10+
bazel_dep(name = "gazelle", version = "0.47.0", repo_name = "bazel_gazelle")
1111
bazel_dep(name = "rules_cc", version = "0.0.16")
1212

1313
local_path_override(

gazelle/examples/bzlmod_build_file_generation/.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ test --test_output=errors --enable_runfiles
33
# Windows requires these for multi-python support:
44
build --enable_runfiles
55

6-
common --experimental_enable_bzlmod
6+
common --enable_bzlmod
77

88
coverage --java_runtime_version=remotejdk_11
99
common:bazel7.x --incompatible_python_disallow_native_rules

gazelle/examples/bzlmod_build_file_generation/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ local_path_override(
3131
# The following stanza defines the dependency for gazelle
3232
# See here https://github.com/bazelbuild/bazel-gazelle/releases/ for the
3333
# latest version.
34-
bazel_dep(name = "gazelle", version = "0.36.0", repo_name = "bazel_gazelle")
34+
bazel_dep(name = "gazelle", version = "0.47.0", repo_name = "bazel_gazelle")
3535

3636
# The following stanze returns a proxy object representing a module extension;
3737
# its methods can be invoked to create module extension tags.
@@ -84,4 +84,4 @@ local_path_override(
8484
)
8585

8686
# Only needed to make rules_python's CI happy
87-
bazel_dep(name = "rules_java", version = "8.3.1")
87+
bazel_dep(name = "rules_java", version = "8.16.1")

0 commit comments

Comments
 (0)