Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
155 changes: 47 additions & 108 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,54 @@ buildifier:
- //tests:version_3_11_test
- //tests:version_3_9_test
- //tests:version_default_test

matrix:
platform:
- ubuntu2204
- macos
- windows
bazel: [7.*, 8.*, 9.*]
tasks:
# Keep in sync with .bcr/presubmit.yml
bcr_tests:
name: BCR test module
platform: ${{ platform }}
bazel: ${{ bazel }}
working_directory: examples/bzlmod
platform: ${{ platform }}
bazel: ${{ bazel }}
shell_commands:
- "bazel vendor --vendor_dir=./vendor //..."
- "bazel build --vendor_dir=./vendor //..."
- "rm -rf ./vendor"
coverage_targets: ["//:test"]
test_flags:
- "--keep_going"
# Without these cxxopts, BCR's Mac builds fail
- '--cxxopt=-std=c++14'
- '--host_cxxopt=-std=c++14'
test_targets:
- "//..."
bcr_gazelle_tests:
# Keep in sync with .bcr/gazelle/presubmit.yml
name: BCR gazelle test module
platform: ${{ platform }}
bazel: ${{ bazel }}
working_directory: gazelle/examples/bzlmod_build_file_generation
# Regenerate the BUILD files for the test module using Gazelle.
# Also verify -repo_config are generated correctly in gazelle.bash
shell_commands:
- "echo 'common --override_module=rules_python=' >> .bazelrc"
- bazel run //:gazelle
batch_commands:
- "echo common --override_module=rules_python= >> .bazelrc"
- bazel run //:gazelle
build_targets:
- "//..."
- ":modules_map"
test_targets:
- "//..."

gazelle_extension_min:
<<: *common_workspace_flags_min_bazel
<<: *minimum_supported_version
Expand Down Expand Up @@ -258,114 +305,6 @@ 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
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
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
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

integration_test_multi_python_versions_ubuntu_workspace:
<<: *reusable_build_test_all
<<: *common_workspace_flags
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ 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")

Expand Down
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")
10 changes: 6 additions & 4 deletions gazelle/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module github.com/bazel-contrib/rules_python/gazelle

go 1.21.13
go 1.22.9

toolchain go1.23.6

require (
github.com/bazelbuild/bazel-gazelle v0.36.0
github.com/bazelbuild/buildtools v0.0.0-20240313121412-66c605173954
github.com/bazelbuild/bazel-gazelle v0.47.0
github.com/bazelbuild/buildtools v0.0.0-20250930140053-2eb4fccefb52
github.com/bazelbuild/rules_go v0.55.1
github.com/bmatcuk/doublestar/v4 v4.7.1
github.com/bmatcuk/doublestar/v4 v4.9.1
github.com/emirpasic/gods v1.18.1
github.com/ghodss/yaml v1.0.0
github.com/smacker/go-tree-sitter v0.0.0-20240827094217-dd81d9e9be82
Expand Down
6 changes: 6 additions & 0 deletions gazelle/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/bazelbuild/bazel-gazelle v0.36.0 h1:n41ODckCkU9D2BEwBxYN+xu5E92Vd0gaW6QmsIW9l00=
github.com/bazelbuild/bazel-gazelle v0.36.0/go.mod h1:5wGHbkRpDUdz4LxREtPYwXstrWfnkV+oDmOuxNAxW1s=
github.com/bazelbuild/bazel-gazelle v0.47.0 h1:g3Rr1ZbkC1Pk20aOgBITxSD/efS1WbaSty5jC786Z3Q=
github.com/bazelbuild/bazel-gazelle v0.47.0/go.mod h1:8Ozf20jhv+in87nCUHdmUPPcVGTfKg/gotZ/hce3T+w=
github.com/bazelbuild/buildtools v0.0.0-20240313121412-66c605173954 h1:VNqmvOfFzn2Hrtoni8vqgXlIQ4C2Zt22fxeZ9gOOkp0=
github.com/bazelbuild/buildtools v0.0.0-20240313121412-66c605173954/go.mod h1:689QdV3hBP7Vo9dJMmzhoYIyo/9iMhEmHkJcnaPRCbo=
github.com/bazelbuild/buildtools v0.0.0-20250930140053-2eb4fccefb52 h1:njQAmjTv/YHRm/0Lfv9DXHFZ4MdT2IA/RKHTnqZkgDw=
github.com/bazelbuild/buildtools v0.0.0-20250930140053-2eb4fccefb52/go.mod h1:PLNUetjLa77TCCziPsz0EI8a6CUxgC+1jgmWv0H25tg=
github.com/bazelbuild/rules_go v0.55.1 h1:cQYGcunY8myOB+0Ym6PGQRhc/milkRcNv0my3XgxaDU=
github.com/bazelbuild/rules_go v0.55.1/go.mod h1:T90Gpyq4HDFlsrvtQa2CBdHNJ2P4rAu/uUTmQbanzf0=
github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q=
github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/avrEXE=
github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
Expand Down