diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index e6ee33558a..8cc1c2aac6 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -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.*] + 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 @@ -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: - <<: *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 diff --git a/.bcr/gazelle/presubmit.yml b/.bcr/gazelle/presubmit.yml index 3300f67f29..021e28f3d5 100644 --- a/.bcr/gazelle/presubmit.yml +++ b/.bcr/gazelle/presubmit.yml @@ -15,8 +15,8 @@ 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.*, 8.*] tasks: run_tests: name: "Run test module" @@ -24,8 +24,12 @@ bcr_test_module: 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" diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index b016dc9d6f..6217ad7ba2 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -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.*, 8.*] 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: - "//..." diff --git a/examples/bzlmod/MODULE.bazel b/examples/bzlmod/MODULE.bazel index f5311fb4d1..14c490cb0d 100644 --- a/examples/bzlmod/MODULE.bazel +++ b/examples/bzlmod/MODULE.bazel @@ -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 diff --git a/examples/multi_python_versions/MODULE.bazel b/examples/multi_python_versions/MODULE.bazel index 2ef09ade3e..82faaf8214 100644 --- a/examples/multi_python_versions/MODULE.bazel +++ b/examples/multi_python_versions/MODULE.bazel @@ -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") diff --git a/gazelle/MODULE.bazel b/gazelle/MODULE.bazel index add5986903..cff6341a2b 100644 --- a/gazelle/MODULE.bazel +++ b/gazelle/MODULE.bazel @@ -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( diff --git a/gazelle/examples/bzlmod_build_file_generation/.bazelrc b/gazelle/examples/bzlmod_build_file_generation/.bazelrc index d58665596b..31097b41de 100644 --- a/gazelle/examples/bzlmod_build_file_generation/.bazelrc +++ b/gazelle/examples/bzlmod_build_file_generation/.bazelrc @@ -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 diff --git a/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel b/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel index ce779627f5..1f92ea3826 100644 --- a/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel +++ b/gazelle/examples/bzlmod_build_file_generation/MODULE.bazel @@ -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. @@ -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")