@@ -31,41 +31,44 @@ bazel_dep(name = "rules_rust", version = "0.52.2")
31
31
32
32
bazel_dep (name = "buildifier_prebuilt" , version = "6.4.0" , dev_dependency = True )
33
33
34
- # crate_py but shortened due to Windows file path considerations
35
- cp = use_extension (
36
- "@rules_rust//crate_universe:extension.bzl" ,
37
- "crate" ,
38
- isolate = True ,
39
- )
40
- cp .from_cargo (
41
- name = "py_deps" ,
42
- cargo_lockfile = "//python/extractor/tsg-python:Cargo.lock" ,
43
- manifests = [
44
- "//python/extractor/tsg-python:Cargo.toml" ,
45
- "//python/extractor/tsg-python/tsp:Cargo.toml" ,
34
+ # Keep edition and version approximately in sync with internal repo.
35
+ # the versions there are canonical, the versions here are used for CI in github/codeql, as well as for the vendoring of dependencies.
36
+ RUST_EDITION = "2021"
37
+
38
+ RUST_VERSION = "1.81.0"
39
+
40
+ rust = use_extension ("@rules_rust//rust:extensions.bzl" , "rust" )
41
+ rust .toolchain (
42
+ edition = RUST_EDITION ,
43
+ # We need those extra target triples so that we can build universal binaries on macos
44
+ extra_target_triples = [
45
+ "x86_64-apple-darwin" ,
46
+ "aarch64-apple-darwin" ,
46
47
],
48
+ versions = [RUST_VERSION ],
47
49
)
48
- use_repo (cp , "py_deps " )
50
+ use_repo (rust , "rust_toolchains " )
49
51
50
- # deps for ruby+rust, but shortened due to windows file paths
51
- r = use_extension (
52
- "@rules_rust//crate_universe:extension.bzl" ,
53
- "crate" ,
54
- isolate = True ,
55
- )
56
- r .from_cargo (
57
- name = "r" ,
58
- cargo_lockfile = "//:Cargo.lock" ,
59
- manifests = [
60
- "//:Cargo.toml" ,
61
- "//ruby/extractor:Cargo.toml" ,
62
- "//rust/extractor:Cargo.toml" ,
63
- "//rust/extractor/macros:Cargo.toml" ,
64
- "//rust/ast-generator:Cargo.toml" ,
65
- "//shared/tree-sitter-extractor:Cargo.toml" ,
66
- ],
52
+ register_toolchains ("@rust_toolchains//:all" )
53
+
54
+ rust_host_tools = use_extension ("@rules_rust//rust:extensions.bzl" , "rust_host_tools" )
55
+
56
+ # Don't download a second toolchain as host toolchain, make sure this is the same version as above
57
+ # The host toolchain is used for vendoring dependencies.
58
+ rust_host_tools .host_tools (
59
+ edition = RUST_EDITION ,
60
+ version = RUST_VERSION ,
67
61
)
68
- use_repo (r , tree_sitter_extractors_deps = "r" )
62
+
63
+ # deps for python extractor
64
+ # keep in sync by running `misc/bazel/3rdparty/update_cargo_deps.sh`
65
+ py_deps = use_extension ("//misc/bazel/3rdparty:py_deps_extension.bzl" , "p" )
66
+ use_repo (py_deps , "vendor__anyhow-1.0.44" , "vendor__cc-1.0.70" , "vendor__clap-2.33.3" , "vendor__regex-1.5.5" , "vendor__smallvec-1.6.1" , "vendor__string-interner-0.12.2" , "vendor__thiserror-1.0.29" , "vendor__tree-sitter-0.20.4" , "vendor__tree-sitter-graph-0.7.0" )
67
+
68
+ # deps for ruby+rust
69
+ # keep in sync by running `misc/bazel/3rdparty/update_cargo_deps.sh`
70
+ tree_sitter_extractors_deps = use_extension ("//misc/bazel/3rdparty:tree_sitter_extractors_extension.bzl" , "r" )
71
+ use_repo (tree_sitter_extractors_deps , "vendor__anyhow-1.0.93" , "vendor__argfile-0.2.1" , "vendor__chrono-0.4.38" , "vendor__clap-4.5.20" , "vendor__encoding-0.2.33" , "vendor__figment-0.10.19" , "vendor__flate2-1.0.34" , "vendor__glob-0.3.1" , "vendor__globset-0.4.15" , "vendor__itertools-0.10.5" , "vendor__itertools-0.13.0" , "vendor__lazy_static-1.5.0" , "vendor__log-0.4.22" , "vendor__num-traits-0.2.19" , "vendor__num_cpus-1.16.0" , "vendor__proc-macro2-1.0.89" , "vendor__quote-1.0.37" , "vendor__ra_ap_base_db-0.0.232" , "vendor__ra_ap_hir-0.0.232" , "vendor__ra_ap_hir_def-0.0.232" , "vendor__ra_ap_hir_expand-0.0.232" , "vendor__ra_ap_ide_db-0.0.232" , "vendor__ra_ap_load-cargo-0.0.232" , "vendor__ra_ap_parser-0.0.232" , "vendor__ra_ap_paths-0.0.232" , "vendor__ra_ap_project_model-0.0.232" , "vendor__ra_ap_span-0.0.232" , "vendor__ra_ap_syntax-0.0.232" , "vendor__ra_ap_vfs-0.0.232" , "vendor__rand-0.8.5" , "vendor__rayon-1.10.0" , "vendor__regex-1.11.1" , "vendor__serde-1.0.214" , "vendor__serde_json-1.0.132" , "vendor__serde_with-3.11.0" , "vendor__stderrlog-0.6.0" , "vendor__syn-2.0.87" , "vendor__tracing-0.1.40" , "vendor__tracing-subscriber-0.3.18" , "vendor__tree-sitter-0.24.4" , "vendor__tree-sitter-embedded-template-0.23.2" , "vendor__tree-sitter-json-0.24.8" , "vendor__tree-sitter-ql-0.23.1" , "vendor__tree-sitter-ruby-0.23.1" , "vendor__triomphe-0.1.14" , "vendor__ungrammar-1.16.1" )
69
72
70
73
dotnet = use_extension ("@rules_dotnet//dotnet:extensions.bzl" , "dotnet" )
71
74
dotnet .toolchain (dotnet_version = "8.0.101" )
0 commit comments