Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bazel: update rules_rust #18710

Merged
merged 11 commits into from
Feb 11, 2025
  •  
  •  
  •  
13 changes: 2 additions & 11 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local_path_override(

# see https://registry.bazel.build/ for a list of available packages

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
Expand All @@ -28,7 +28,7 @@ bazel_dep(name = "rules_kotlin", version = "2.0.0-codeql.1")
bazel_dep(name = "gazelle", version = "0.40.0")
bazel_dep(name = "rules_dotnet", version = "0.17.4")
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "rules_rust", version = "0.52.2")
bazel_dep(name = "rules_rust", version = "0.57.1")
bazel_dep(name = "zstd", version = "1.5.5.bcr.1")

bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
Expand All @@ -53,15 +53,6 @@ use_repo(rust, "rust_toolchains")

register_toolchains("@rust_toolchains//:all")

rust_host_tools = use_extension("@rules_rust//rust:extensions.bzl", "rust_host_tools")

# Don't download a second toolchain as host toolchain, make sure this is the same version as above
# The host toolchain is used for vendoring dependencies.
rust_host_tools.host_tools(
edition = RUST_EDITION,
version = RUST_VERSION,
)

# deps for python extractor
# keep in sync by running `misc/bazel/3rdparty/update_cargo_deps.sh`
py_deps = use_extension("//misc/bazel/3rdparty:py_deps_extension.bzl", "p")
Expand Down
16 changes: 16 additions & 0 deletions misc/bazel/3rdparty/patch_defs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import sys
import re
import pathlib

label_re = re.compile(r'"@vendor//:(.+)-([\d.]+)"')

file = pathlib.Path(sys.argv[1])
temp = file.with_suffix(f'{file.suffix}.tmp')


with open(file) as input, open(temp, "w") as output:
for line in input:
line = label_re.sub(lambda m: f'"@vendor__{m[1]}-{m[2]}//:{m[1].replace("-", "_")}"', line)
output.write(line)

temp.rename(file)
8 changes: 5 additions & 3 deletions misc/bazel/3rdparty/py_deps/BUILD.ahash-0.4.7.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions misc/bazel/3rdparty/py_deps/BUILD.aho-corasick-0.7.18.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions misc/bazel/3rdparty/py_deps/BUILD.ansi_term-0.11.0.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions misc/bazel/3rdparty/py_deps/BUILD.anyhow-1.0.44.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions misc/bazel/3rdparty/py_deps/BUILD.atty-0.2.14.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions misc/bazel/3rdparty/py_deps/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading