Skip to content
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 46 additions & 101 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,50 @@ buildifier:
- //tests:version_3_13_test
- //tests:version_3_14_test
- //tests:version_default_test

matrix:
platform:
- ubuntu2204
- debian11
- macos_arm64
- windows
bazel: [7.*, 8.*, 9.*]

tasks:
bcr_test:
name: BCR example - rules_python
platform: ${{ platform }}
working_directory: examples/bzlmod
bazel: ${{ bazel }}
test_flags:
# Minimum bazel supported C++
- "--keep_going"
- '--cxxopt=-std=c++17'
- '--host_cxxopt=-std=c++17'
build_targets:
- "//..."
test_targets:
- "//..."

bcr_gazelle_test:
name: BCR example - rules_python_gazelle_plugin
platform: ${{ platform }}
bazel: ${{ bazel }}
working_directory: gazelle/examples/bzlmod_build_file_generation
shell_commands:
- "echo 'common --override_module=rules_python=' >> .bazelrc"
- "bazel run //:gazelle_python_manifest.update"
- "bazel run //:gazelle -- update"
batch_commands:
- "echo common --override_module=rules_python= >> .bazelrc"
- "bazel run //:gazelle_python_manifest.update"
- "bazel run //:gazelle -- update"
build_targets:
- "//..."
- ":modules_map"
test_targets:
- "//..."

gazelle_extension_min:
<<: *common_workspace_flags_min_bazel
<<: *minimum_supported_version
Expand Down Expand Up @@ -262,113 +305,15 @@ tasks:
working_directory: examples/build_file_generation
platform: windows

integration_test_bzlmod_ubuntu_min:
<<: *minimum_supported_version
<<: *reusable_build_test_all
coverage_targets: ["//:test"]
name: "examples/bzlmod: Ubuntu, minimum Bazel"
working_directory: examples/bzlmod
platform: ubuntu2204
bazel: 7.x
integration_test_bzlmod_ubuntu:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod
name: "examples/bzlmod: Ubuntu"
working_directory: examples/bzlmod
platform: ubuntu2204
bazel: 7.x
integration_test_bzlmod_ubuntu_upcoming:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod
name: "examples/bzlmod: Ubuntu, upcoming Bazel"
working_directory: examples/bzlmod
platform: ubuntu2204
bazel: last_rc
integration_test_bzlmod_debian:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod
name: "examples/bzlmod: Debian"
working_directory: examples/bzlmod
platform: debian11
bazel: 7.x
integration_test_bzlmod_ubuntu_vendor:
<<: *reusable_build_test_all
name: "examples/bzlmod: bazel vendor"
working_directory: examples/bzlmod
platform: ubuntu2204
shell_commands:
- "bazel vendor --vendor_dir=./vendor //..."
- "bazel build --vendor_dir=./vendor //..."
- "rm -rf ./vendor"
integration_test_bzlmod_macos:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod
name: "examples/bzlmod: macOS"
working_directory: examples/bzlmod
platform: macos_arm64
bazel: 7.x
integration_test_bzlmod_macos_upcoming:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod
name: "examples/bzlmod: macOS, upcoming Bazel"
working_directory: examples/bzlmod
platform: macos_arm64
bazel: last_rc
integration_test_bzlmod_windows:
<<: *reusable_build_test_all
# coverage is not supported on Windows
name: "examples/bzlmod: Windows"
working_directory: examples/bzlmod
platform: windows
bazel: 7.x
integration_test_bzlmod_windows_upcoming:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, now I'm a bit confused.
BCR says its failing with 8.x, but this test should have been covering that (at least until the bazel 9 rc came out)?

Yet in this PR's refactored CI run, it's also giving the error BCR is giving.

The only difference seems to be the vendor step?

<<: *reusable_build_test_all
# coverage is not supported on Windows
name: "examples/bzlmod: Windows, upcoming Bazel"
working_directory: examples/bzlmod
platform: windows
bazel: last_rc

integration_test_bzlmod_generate_build_file_generation_ubuntu_min:
<<: *minimum_supported_version
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod_build_file_generation
name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
working_directory: gazelle/examples/bzlmod_build_file_generation
platform: ubuntu2204
bazel: 7.x
integration_test_bzlmod_generation_build_files_ubuntu:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod_build_file_generation
name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu"
working_directory: gazelle/examples/bzlmod_build_file_generation
platform: ubuntu2204
integration_test_bzlmod_generation_build_files_ubuntu_run:
<<: *reusable_build_test_all
name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu, Gazelle and pip"
working_directory: gazelle/examples/bzlmod_build_file_generation
platform: ubuntu2204
shell_commands:
- "bazel run //:gazelle_python_manifest.update"
- "bazel run //:gazelle -- update"
integration_test_bzlmod_build_file_generation_debian:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod_build_file_generation
name: "gazelle/examples/bzlmod_build_file_generation: Debian"
working_directory: gazelle/examples/bzlmod_build_file_generation
platform: debian11
integration_test_bzlmod_build_file_generation_macos:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod_build_file_generation
name: "gazelle/examples/bzlmod_build_file_generation: MacOS"
working_directory: gazelle/examples/bzlmod_build_file_generation
platform: macos_arm64
integration_test_bzlmod_build_file_generation_windows:
<<: *reusable_build_test_all
# coverage is not supported on Windows
name: "gazelle/examples/bzlmod_build_file_generation: Windows"
working_directory: gazelle/examples/bzlmod_build_file_generation
platform: windows
- "bazel vendor --vendor_dir=./vendor //..."
- "bazel build --vendor_dir=./vendor //..."
- "rm -rf ./vendor"

integration_test_multi_python_versions_ubuntu_workspace:
<<: *reusable_build_test_all
Expand Down
8 changes: 6 additions & 2 deletions .bcr/gazelle/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@
bcr_test_module:
module_path: "examples/bzlmod_build_file_generation"
matrix:
platform: ["debian11", "macos", "ubuntu2004", "windows"]
bazel: [7.x, 8.x]
platform: ["debian11", "macos", "ubuntu2204", "windows"]
bazel: [7.x, 8.x, 9.x]
tasks:
run_tests:
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
shell_commands:
- "echo 'common --override_module=rules_python=' >> .bazelrc"
- "bazel run //:gazelle_python_manifest.update"
- "bazel run //:gazelle -- update"
batch_commands:
- "echo common --override_module=rules_python= >> .bazelrc"
- "bazel run //:gazelle_python_manifest.update"
- "bazel run //:gazelle -- update"
build_targets:
- "//..."
- ":modules_map"
Expand Down
12 changes: 7 additions & 5 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@
bcr_test_module:
module_path: "examples/bzlmod"
matrix:
platform: ["debian11", "macos", "ubuntu2004", "windows"]
bazel: [7.x, 8.x]
platform: ["debian11", "macos", "ubuntu2204", "windows"]
bazel: [7.x, 8.x, 9.x]
tasks:
run_tests:
name: "Run test module"
platform: ${{ platform }}
bazel: ${{ bazel }}
test_flags:
# Minimum bazel supported C++
- "--keep_going"
# Without these cxxopts, BCR's Mac builds fail
- '--cxxopt=-std=c++14'
- '--host_cxxopt=-std=c++14'
- '--cxxopt=-std=c++17'
- '--host_cxxopt=-std=c++17'
build_targets:
- "//..."
test_targets:
- "//..."
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ bazel_dep(name = "another_module", version = "0", dev_dependency = True)

# Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests.
# We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides.
bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_go", version = "0.59.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "gazelle", version = "0.47.0", dev_dependency = True, repo_name = "bazel_gazelle")

internal_dev_deps = use_extension(
"//python/private:internal_dev_deps.bzl",
Expand Down
2 changes: 1 addition & 1 deletion examples/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf"

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

# Only needed to make rules_python's CI happy. A test verifies that
# MODULE.bazel.lock is cross-platform friendly, and there are transitive
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_python_versions/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True)

# Only needed to make rules_python's CI happy. rules_java 8.3.0+ is needed so
# that --java_runtime_version=remotejdk_11 works with Bazel 8.
bazel_dep(name = "rules_java", version = "8.3.1")
bazel_dep(name = "rules_java", version = "8.16.1")
4 changes: 2 additions & 2 deletions gazelle/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module(

bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "rules_python", version = "0.18.0")
bazel_dep(name = "rules_go", version = "0.55.1", repo_name = "io_bazel_rules_go")
bazel_dep(name = "gazelle", version = "0.36.0", repo_name = "bazel_gazelle")
bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "gazelle", version = "0.47.0", repo_name = "bazel_gazelle")
bazel_dep(name = "rules_cc", version = "0.0.16")

local_path_override(
Expand Down
2 changes: 1 addition & 1 deletion gazelle/examples/bzlmod_build_file_generation/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test --test_output=errors --enable_runfiles
# Windows requires these for multi-python support:
build --enable_runfiles

common --experimental_enable_bzlmod
common --enable_bzlmod

coverage --java_runtime_version=remotejdk_11
common:bazel7.x --incompatible_python_disallow_native_rules
Expand Down
4 changes: 2 additions & 2 deletions gazelle/examples/bzlmod_build_file_generation/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ local_path_override(
# The following stanza defines the dependency for gazelle
# See here https://github.com/bazelbuild/bazel-gazelle/releases/ for the
# latest version.
bazel_dep(name = "gazelle", version = "0.36.0", repo_name = "bazel_gazelle")
bazel_dep(name = "gazelle", version = "0.47.0", repo_name = "bazel_gazelle")

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

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