From c16df15ae877101fca35bea47de5167046e2ce9c Mon Sep 17 00:00:00 2001 From: tonyaiuto Date: Wed, 18 Feb 2026 23:27:06 -0400 Subject: [PATCH] Bring testing for bzlmod vs. non-bzlmod up to date with bazel features Head and LTS have bzlmod enabled by default, so: - stop enabling the flag explicitly - stop calling out "bzlmod" in the test name, that is now assumed, only nobzlmod needs naming - Do the packaging test against workspace only for bazel 7 and earlier. - we probably could drop the workspace test entirely. It is essentially meaningless now --- .bazelci/examples_naming.yml | 6 ------ .bazelci/tests.yml | 40 +++++++++++------------------------- distro/packaging_test.py | 7 ++++--- 3 files changed, 16 insertions(+), 37 deletions(-) diff --git a/.bazelci/examples_naming.yml b/.bazelci/examples_naming.yml index 07295ef6..ebadb565 100644 --- a/.bazelci/examples_naming.yml +++ b/.bazelci/examples_naming.yml @@ -16,9 +16,3 @@ tasks: windows: platform: windows <<: *common - bzlmod: - name: bzlmod - platform: ubuntu2204 - build_flags: - - "--enable_bzlmod" - <<: *common diff --git a/.bazelci/tests.yml b/.bazelci/tests.yml index c1e3b5e9..6fc98c96 100644 --- a/.bazelci/tests.yml +++ b/.bazelci/tests.yml @@ -11,10 +11,6 @@ common: &common working_directory: .. -bzlmod: &bzlmod - build_flags: - - "--enable_bzlmod" - nobzlmod: &nobzlmod build_flags: - "--noenable_bzlmod" @@ -85,23 +81,15 @@ windows: &windows # Finally, the cross product of bazel releases X platforms # tasks: - ub_head_bzlmod: - name: ub_head_bzlmod - bazel: latest - <<: *ubuntu - <<: *bzlmod - - ub_head_nobzlmod: - name: ub_head_nobzlmod + ub_head: + name: ub_head bazel: latest <<: *ubuntu - <<: *nobzlmod - ub_lts_bzlmod: - name: ub_lts_bzlmod + ub_lts: + name: ub_lts bazel: latest <<: *ubuntu - <<: *bzlmod ub_lts_nobzlmod: name: ub_lts_nobzlmod @@ -120,17 +108,15 @@ tasks: bazel: latest <<: *centos - mac_head_bzlmod: - name: mac_head_bzlmod + mac_head: + name: mac_head bazel: latest <<: *macos - <<: *bzlmod - mac_lts_bzlmod: - name: mac_lts_bzlmod + mac_lts: + name: mac_lts bazel: latest <<: *macos - <<: *bzlmod mac_lts_nobzlmod: name: mac_lts_nobzlmod @@ -138,17 +124,15 @@ tasks: <<: *macos <<: *nobzlmod - win_head_bzlmod: - name: win_head_bzlmod + win_head: + name: win_head bazel: latest <<: *windows - <<: *bzlmod - win_lts_bzlmod: - name: win_lts_bzlmod + win_lts: + name: win_lts bazel: latest <<: *windows - <<: *bzlmod win_lts_nobzlmod: name: win_lts_nobzlmod diff --git a/distro/packaging_test.py b/distro/packaging_test.py index f1146256..74bef827 100644 --- a/distro/packaging_test.py +++ b/distro/packaging_test.py @@ -97,9 +97,10 @@ def CopyTestFile(source_name, dest_name): def _select_bazel_supported_setup(self): output = subprocess.check_output(['bazel', 'version'], text=True) major_version = re.search(r'Build label:\s+(\d+)', output) - if major_version and int(major_version.group(1)) >= 9: - return 'MODULE.bazel', self._module_bazel_lines, [] - return 'WORKSPACE', self._workspace_lines, ['--enable_workspace'] + # Module support was not the default at 7 + if major_version and int(major_version.group(1)) <= 7: + return 'WORKSPACE', self._workspace_lines, ['--enable_workspace'] + return 'MODULE.bazel', self._module_bazel_lines, [] def _module_bazel_lines(self, local_path, sha256): return (