Skip to content

Commit 3574b9f

Browse files
authored
Merge pull request github#16716 from github/criemen/rust-bzlmod-new
Rust: Move to bzlmod.
2 parents 73caa48 + 4226270 commit 3574b9f

File tree

11 files changed

+55
-8908
lines changed

11 files changed

+55
-8908
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.1.2
1+
7.2.0

MODULE.bazel

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,45 @@ local_path_override(
1313

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

16-
bazel_dep(name = "platforms", version = "0.0.9")
17-
bazel_dep(name = "rules_go", version = "0.47.0")
16+
bazel_dep(name = "platforms", version = "0.0.10")
17+
bazel_dep(name = "rules_go", version = "0.48.0")
1818
bazel_dep(name = "rules_pkg", version = "0.10.1")
19-
bazel_dep(name = "rules_nodejs", version = "6.0.3")
20-
bazel_dep(name = "rules_python", version = "0.31.0")
21-
bazel_dep(name = "bazel_skylib", version = "1.5.0")
19+
bazel_dep(name = "rules_nodejs", version = "6.2.0")
20+
bazel_dep(name = "rules_python", version = "0.32.2")
21+
bazel_dep(name = "bazel_skylib", version = "1.6.1")
2222
bazel_dep(name = "abseil-cpp", version = "20240116.0", repo_name = "absl")
2323
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
2424
bazel_dep(name = "fmt", version = "10.0.0")
2525
bazel_dep(name = "rules_kotlin", version = "1.9.4-codeql.1")
26-
bazel_dep(name = "gazelle", version = "0.36.0")
26+
bazel_dep(name = "gazelle", version = "0.37.0")
2727
bazel_dep(name = "rules_dotnet", version = "0.15.1")
2828
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
29+
bazel_dep(name = "rules_rust", version = "0.46.0")
2930

3031
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
3132

33+
crate = use_extension(
34+
"@rules_rust//crate_universe:extension.bzl",
35+
"crate",
36+
)
37+
crate.from_cargo(
38+
name = "py_deps",
39+
cargo_lockfile = "//python/extractor/tsg-python:Cargo.lock",
40+
manifests = [
41+
"//python/extractor/tsg-python:Cargo.toml",
42+
"//python/extractor/tsg-python/tsp:Cargo.toml",
43+
],
44+
)
45+
crate.from_cargo(
46+
name = "ruby_deps",
47+
cargo_lockfile = "//ruby/extractor:Cargo.lock",
48+
manifests = [
49+
"//ruby/extractor:Cargo.toml",
50+
"//ruby/extractor/codeql-extractor-fake-crate:Cargo.toml",
51+
],
52+
)
53+
use_repo(crate, "py_deps", "ruby_deps")
54+
3255
dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
3356
dotnet.toolchain(dotnet_version = "8.0.101")
3457
use_repo(dotnet, "dotnet_toolchains")

csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ codeql_csharp_library(
1111
"Extractor/**/*.cs",
1212
"Kinds/**/*.cs",
1313
"Populators/**/*.cs",
14-
"Properties/**/*.cs",
1514
"*.cs",
1615
]),
1716
allow_unsafe_blocks = True,

javascript/BUILD.bazel

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,3 @@ codeql_pack(
3636
visibility = ["//visibility:public"],
3737
zips = {"//javascript/extractor/lib/typescript": "tools"},
3838
)
39-
40-
# TODO copy for internal repository backward compatibility
41-
genrule(
42-
name = "javascript.zip",
43-
srcs = [":javascript-generic-zip"],
44-
outs = ["javascript.zip"],
45-
cmd = "cp $< $@",
46-
)

misc/bazel/rust.bzl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
load("@rules_rust//rust:defs.bzl", "rust_binary")
2+
load("@semmle_code//buildutils-internal:glibc_symbols_check.bzl", "glibc_symbols_check")
3+
load("@semmle_code//buildutils-internal:lipo.bzl", "universal_binary")
4+
5+
def codeql_rust_binary(
6+
name,
7+
target_compatible_with = None,
8+
visibility = None,
9+
symbols_test = True,
10+
**kwargs):
11+
rust_label_name = name + "_single_arch"
12+
universal_binary(
13+
name = name,
14+
dep = ":" + rust_label_name,
15+
target_compatible_with = target_compatible_with,
16+
visibility = visibility,
17+
)
18+
rust_binary(
19+
name = rust_label_name,
20+
**kwargs
21+
)
22+
if symbols_test:
23+
glibc_symbols_check(name = name + "symbols-test", binary = name)

python/extractor/tsg-python/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@py_deps//:defs.bzl", "aliases", "all_crate_deps")
2-
load("@semmle_code//:common.bzl", "codeql_rust_binary")
2+
load("//misc/bazel:rust.bzl", "codeql_rust_binary")
33

44
codeql_rust_binary(
55
name = "tsg-python",

0 commit comments

Comments
 (0)