Skip to content

Commit f464759

Browse files
authored
Merge pull request github#17434 from github/redsun82/rust-experiment
Bazel: remove non-working fake `tree-sitter-extractor` workaround
2 parents 4f90f5f + f8c9d96 commit f464759

File tree

21 files changed

+80
-1133
lines changed

21 files changed

+80
-1133
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ node_modules/
6868

6969
# Jetbrains IDE files
7070
.idea
71+
72+
# cargo build directory
73+
/target

rust/extractor/Cargo.lock renamed to Cargo.lock

+49-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This is the shared workspace file for extractor using shared/tree-sitter/extractor
2+
[workspace]
3+
4+
resolver = "2"
5+
members = [
6+
"shared/tree-sitter-extractor",
7+
"ruby/extractor",
8+
"rust/extractor",
9+
]
10+
11+
[patch.crates-io]
12+
# patch for build script bug preventing bazel build
13+
# see https://github.com/rust-lang/rustc_apfloat/pull/17
14+
rustc_apfloat = { git = "https://github.com/redsun82/rustc_apfloat.git", rev = "096d585100636bc2e9f09d7eefec38c5b334d47b" }

MODULE.bazel

+6-18
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,23 @@ cp.from_cargo(
4747
)
4848
use_repo(cp, "py_deps")
4949

50-
# crate_ruby, but shortened due to windows file paths
50+
# deps for ruby+rust, but shortened due to windows file paths
5151
r = use_extension(
5252
"@rules_rust//crate_universe:extension.bzl",
5353
"crate",
5454
isolate = True,
5555
)
5656
r.from_cargo(
57-
name = "rd",
58-
cargo_lockfile = "//ruby/extractor:Cargo.lock",
57+
name = "r",
58+
cargo_lockfile = "//:Cargo.lock",
5959
manifests = [
60+
"//:Cargo.toml",
6061
"//ruby/extractor:Cargo.toml",
61-
"//ruby/extractor/codeql-extractor-fake-crate:Cargo.toml",
62-
],
63-
)
64-
use_repo(r, ruby_deps = "rd")
65-
66-
rsp = use_extension(
67-
"@rules_rust//crate_universe:extension.bzl",
68-
"crate",
69-
isolate = True,
70-
)
71-
rsp.from_cargo(
72-
name = "rs_deps",
73-
cargo_lockfile = "//rust/extractor:Cargo.lock",
74-
manifests = [
7562
"//rust/extractor:Cargo.toml",
63+
"//shared/tree-sitter-extractor:Cargo.toml",
7664
],
7765
)
78-
use_repo(rsp, rust_deps = "rs_deps")
66+
use_repo(r, tree_sitter_extractors_deps = "r")
7967

8068
dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
8169
dotnet.toolchain(dotnet_version = "8.0.101")

config/identical-files.json

-5
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,5 @@
355355
"Python model summaries test extension": [
356356
"python/ql/test/library-tests/dataflow/model-summaries/InlineTaintTest.ext.yml",
357357
"python/ql/test/library-tests/dataflow/model-summaries/NormalDataflowTest.ext.yml"
358-
],
359-
"shared tree-sitter extractor cargo.toml": [
360-
"shared/tree-sitter-extractor/Cargo.toml",
361-
"ruby/extractor/codeql-extractor-fake-crate/Cargo.toml",
362-
"rust/extractor/codeql-extractor-fake-crate/Cargo.toml"
363358
]
364359
}

ruby/extractor/.cargo/config.toml

-1
This file was deleted.

ruby/extractor/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@ruby_deps//:defs.bzl", "aliases", "all_crate_deps")
1+
load("@tree_sitter_extractors_deps//:defs.bzl", "aliases", "all_crate_deps")
22
load("//misc/bazel:rust.bzl", "codeql_rust_binary")
33

44
codeql_rust_binary(

0 commit comments

Comments
 (0)