From 4c21444dd5afc33fa3637bcc6198e8fc82506fb7 Mon Sep 17 00:00:00 2001 From: Cornelius Riemenschneider Date: Wed, 9 Oct 2024 14:04:05 +0200 Subject: [PATCH] Bazel: Flip --incompatible_use_plus_in_repo_names. We've hardcoded the tilde in a lot of places :( This improves performance on Windows and gets us ready for Bazel 8. We need an upgrade of rules_rust for this to work. --- .bazelrc | 1 + MODULE.bazel | 2 +- java/kotlin-extractor/deps.bzl | 2 +- misc/bazel/internal/zipmerge/zipmerge_test.cpp | 2 +- misc/bazel/lfs.bzl | 4 ++-- misc/ripunzip/install.sh | 2 +- rust/codegen/codegen.sh | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.bazelrc b/.bazelrc index 9abda3e670a0..26a0600a44ed 100644 --- a/.bazelrc +++ b/.bazelrc @@ -25,5 +25,6 @@ common --registry=https://bcr.bazel.build common --@rules_dotnet//dotnet/settings:strict_deps=false common --experimental_isolated_extension_usages +common --incompatible_use_plus_in_repo_names try-import %workspace%/local.bazelrc diff --git a/MODULE.bazel b/MODULE.bazel index 4a2219d43a54..c04fe5d3ec33 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -27,7 +27,7 @@ bazel_dep(name = "rules_kotlin", version = "1.9.4-codeql.1") bazel_dep(name = "gazelle", version = "0.38.0") bazel_dep(name = "rules_dotnet", version = "0.15.1") bazel_dep(name = "googletest", version = "1.14.0.bcr.1") -bazel_dep(name = "rules_rust", version = "0.50.0") +bazel_dep(name = "rules_rust", version = "0.52.2") bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True) diff --git a/java/kotlin-extractor/deps.bzl b/java/kotlin-extractor/deps.bzl index 6e55969f2512..bee713f8c466 100644 --- a/java/kotlin-extractor/deps.bzl +++ b/java/kotlin-extractor/deps.bzl @@ -17,7 +17,7 @@ def _get_dep(repository_ctx, name): return repository_ctx.path(Label("//java/kotlin-extractor/deps:%s" % name)) def _kotlin_dep_impl(repository_ctx): - _, _, name = repository_ctx.name.rpartition("~") + _, _, name = repository_ctx.name.rpartition("+") lfs_smudge(repository_ctx, [_get_dep(repository_ctx, name + ".jar")]) # for some reason rules_kotlin warns about these jars missing, this is to silence those warnings diff --git a/misc/bazel/internal/zipmerge/zipmerge_test.cpp b/misc/bazel/internal/zipmerge/zipmerge_test.cpp index 9bee1a79c02f..65278a679f5b 100644 --- a/misc/bazel/internal/zipmerge/zipmerge_test.cpp +++ b/misc/bazel/internal/zipmerge/zipmerge_test.cpp @@ -75,7 +75,7 @@ std::string get_file(const char* name) { return ret; }(); // this works from both `codeql` and the internal repository - for (auto prefix : {"_main", "ql~"}) { + for (auto prefix : {"_main", "ql+"}) { auto ret = runfiles->Rlocation(prefix + "/misc/bazel/internal/zipmerge/test-files/"s + name); if (fs::exists(ret)) { return ret; diff --git a/misc/bazel/lfs.bzl b/misc/bazel/lfs.bzl index a068d76b2eae..7c37c0a55236 100644 --- a/misc/bazel/lfs.bzl +++ b/misc/bazel/lfs.bzl @@ -64,8 +64,8 @@ def _download_lfs(repository_ctx): srcs = [f for f in dir.readdir() if not f.is_dir] lfs_smudge(repository_ctx, srcs, executable = repository_ctx.attr.executable) - # with bzlmod the name is qualified with `~` separators, and we want the base name here - name = repository_ctx.name.split("~")[-1] + # with bzlmod the name is qualified with `+` separators, and we want the base name here + name = repository_ctx.name.split("+")[-1] basenames = [src.basename for src in srcs] build = "exports_files(%s)\n" % repr(basenames) diff --git a/misc/ripunzip/install.sh b/misc/ripunzip/install.sh index d9ee6dda1cb6..d383381f0e2e 100755 --- a/misc/ripunzip/install.sh +++ b/misc/ripunzip/install.sh @@ -2,7 +2,7 @@ set -eu -source misc/bazel/runfiles.sh 2>/dev/null || source external/ql~/misc/bazel/runfiles.sh +source misc/bazel/runfiles.sh 2>/dev/null || source external/ql+/misc/bazel/runfiles.sh dest="${2:-$HOME/.local/bin}" diff --git a/rust/codegen/codegen.sh b/rust/codegen/codegen.sh index e56f40627e65..cb15c796fd6a 100755 --- a/rust/codegen/codegen.sh +++ b/rust/codegen/codegen.sh @@ -2,7 +2,7 @@ set -eu -source misc/bazel/runfiles.sh 2>/dev/null || source external/ql~/misc/bazel/runfiles.sh +source misc/bazel/runfiles.sh 2>/dev/null || source external/ql+/misc/bazel/runfiles.sh ast_generator="$(rlocation "$1")" ast_generator_manifest="$(rlocation "$2")"