Fix vendoring for test module for Bazel 7 (#2857)
If the latest Bazel version in the matrix is 7.x, vendoring for a test
module will fail since the `+` char is expected in the repo names:
```
* Moving vendored module source to /var/lib/buildkite-agent/builds/bk-docker-p7b3/bazel-org-repo-root/module_src
Traceback (most recent call last):
File "/usr/lib/python3.10/shutil.py", line 816, in move
os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/buildkite-agent/builds/bk-docker-p7b3/bazel-org-repo-root/.temp_anonymous_module/vendor_src/rules_nixpkgs_core+' -> '/var/lib/buildkite-agent/builds/bk-docker-p7b3/bazel-org-repo-root/module_src'
```
Enable the relevant flag for this major version.diff --git a/buildkite/bazel-central-registry/bcr_presubmit.py b/buildkite/bazel-central-registry/bcr_presubmit.py
index cc09783..4c4ed78 100755
--- a/buildkite/bazel-central-registry/bcr_presubmit.py
+++ b/buildkite/bazel-central-registry/bcr_presubmit.py
@@ -299,8 +299,11 @@
vendor_bazel_version = "latest"
suppress_log or bazelci.eprint(f"* Preparing test module source with Bazel {vendor_bazel_version}")
anonymous_module_root = create_anonymous_repo(module_name, module_version, root = root.joinpath(".temp_anonymous_module"))
+
+ # vendoring requires plus in repo names, which is off by default in Bazel 7.x, so
+ # always pass the --incompatible_use_plus_in_repo_names explicitly
bazelci.execute_command(["bazel", "--batch"] + bazelci.common_startup_flags()
- + ["vendor", "--vendor_dir=./vendor_src", "--repository_cache=", "--lockfile_mode=off", "--repo", f"@{module_name}"],
+ + ["vendor", "--incompatible_use_plus_in_repo_names", "--vendor_dir=./vendor_src", "--repository_cache=", "--lockfile_mode=off", "--repo", f"@{module_name}"],
cwd=anonymous_module_root,
env={**os.environ, "USE_BAZEL_VERSION": vendor_bazel_version})
source_root = root.joinpath("module_src")