Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Cargo.lock

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

11 changes: 8 additions & 3 deletions misc/bazel/3rdparty/rust_workspace_deps/crates.bzl

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

1 change: 1 addition & 0 deletions ql/extractor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
rayon = "1.9.0"
regex = "1.10.4"
codeql-extractor = { path = "../../shared/tree-sitter-extractor" }
extractor-common = { path = "../../shared/extractor-common" }
2 changes: 1 addition & 1 deletion ql/extractor/src/autobuilder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::PathBuf;

use clap::Args;

use codeql_extractor::autobuilder;
use extractor_common::autobuilder;

#[derive(Args)]
// The autobuilder takes no command-line options, but this may change in the future.
Expand Down
4 changes: 2 additions & 2 deletions ql/extractor/src/extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use clap::Args;
use std::path::PathBuf;

use codeql_extractor::extractor::simple;
use codeql_extractor::trap;
use extractor_common::trap;

#[derive(Args)]
pub struct Options {
Expand All @@ -20,7 +20,7 @@ pub struct Options {
}

pub fn run(options: Options) -> std::io::Result<()> {
codeql_extractor::extractor::set_tracing_level("ql");
extractor_common::extractor::set_tracing_level("ql");

let extractor = simple::Extractor {
prefix: "ql".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion ql/extractor/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct Options {
}

pub fn run(options: Options) -> std::io::Result<()> {
codeql_extractor::extractor::set_tracing_level("ql");
extractor_common::extractor::set_tracing_level("ql");

let languages = vec![
Language {
Expand Down
2 changes: 1 addition & 1 deletion ruby/extractor/src/autobuilder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::PathBuf;

use clap::Args;

use codeql_extractor::autobuilder;
use extractor_common::autobuilder;

#[derive(Args)]
// The autobuilder takes no command-line options, but this may change in the future.
Expand Down
7 changes: 4 additions & 3 deletions ruby/extractor/src/extractor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use clap::Args;
use extractor_common::file_paths::{self, PathTransformer};
use extractor_common::trap;
use rayon::prelude::*;
use std::borrow::Cow;
use std::collections::HashSet;
Expand All @@ -9,7 +10,7 @@ use std::path::{Path, PathBuf};
use std::sync::LazyLock;
use tree_sitter::{Language, Parser, Range};

use codeql_extractor::{diagnostics, extractor, node_types, trap};
use codeql_extractor::{diagnostics, extractor, node_types};

#[derive(Args)]
pub struct Options {
Expand All @@ -28,7 +29,7 @@ pub struct Options {

#[allow(clippy::too_many_lines)]
pub fn run(options: &Options) -> std::io::Result<()> {
extractor::set_tracing_level("ruby");
extractor_common::extractor::set_tracing_level("ruby");
tracing::info!("Extraction started");
let diagnostics = diagnostics::DiagnosticLoggers::new("ruby");
let mut main_thread_logger = diagnostics.logger();
Expand Down Expand Up @@ -229,7 +230,7 @@ pub fn run(options: &Options) -> std::io::Result<()> {

let path = PathBuf::from("extras");
let mut trap_writer = trap::Writer::new();
extractor::populate_empty_location(&mut trap_writer);
extractor_common::extractor::populate_empty_location(&mut trap_writer);
let res = write_trap(
&trap_dir,
&path,
Expand Down
2 changes: 1 addition & 1 deletion ruby/extractor/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct Options {
}

pub fn run(options: Options) -> std::io::Result<()> {
codeql_extractor::extractor::set_tracing_level("ruby");
extractor_common::extractor::set_tracing_level("ruby");

let languages = vec![
Language {
Expand Down
2 changes: 1 addition & 1 deletion rust/autobuild/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ codeql_rust_binary(
deps = all_crate_deps(
normal = True,
) + [
"//shared/tree-sitter-extractor",
"//shared/extractor-common",
],
)
2 changes: 1 addition & 1 deletion rust/autobuild/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition.workspace = true
workspace = true

[dependencies]
codeql-extractor = { path = "../../shared/tree-sitter-extractor" }
extractor-common = { path = "../../shared/extractor-common" }
2 changes: 1 addition & 1 deletion rust/autobuild/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use codeql_extractor::autobuilder;
use extractor_common::autobuilder;
use std::path::PathBuf;

fn main() -> std::io::Result<()> {
Expand Down
1 change: 0 additions & 1 deletion rust/extractor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ codeql_rust_binary(
normal = True,
) + [
"//shared/extractor-common",
"//shared/tree-sitter-extractor",
],
)
1 change: 0 additions & 1 deletion rust/extractor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ ra_ap_cfg = "0.0.358"
ra_ap_intern = "0.0.358"
serde = "1.0.229"
triomphe = "0.1.17"
codeql-extractor = { path = "../../shared/tree-sitter-extractor" }
extractor-common = { path = "../../shared/extractor-common" }
itertools = "0.15.0"
glob = "0.3.4"
Expand Down
2 changes: 1 addition & 1 deletion rust/extractor/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod deserialize;

use anyhow::Context;
use clap::Parser;
use codeql_extractor::trap;
use extractor_common::trap;
use figment::{
Figment,
providers::{Env, Format, Serialized, Yaml},
Expand Down
2 changes: 1 addition & 1 deletion rust/extractor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ fn main() -> anyhow::Result<()> {
};

tracing_subscriber::registry()
.with(codeql_extractor::extractor::default_subscriber_with_level(
.with(extractor_common::extractor::default_subscriber_with_level(
"single_arch",
&config.logging_verbosity,
))
Expand Down
3 changes: 1 addition & 2 deletions rust/extractor/src/trap.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{config, generated};
use codeql_extractor::{extractor, trap};
use extractor_common::file_paths;
use extractor_common::{extractor, file_paths, trap};
use ra_ap_ide_db::line_index::LineCol;
use std::fmt::Debug;
use std::hash::Hash;
Expand Down
3 changes: 3 additions & 0 deletions shared/extractor-common/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
load("@rules_rust//rust:defs.bzl", "rust_library")
load("//misc/bazel/3rdparty/rust_workspace_deps:defs.bzl", "aliases", "all_crate_deps")

exports_files(["Cargo.toml"])

rust_library(
name = "extractor-common",
srcs = glob(["src/**/*.rs"]),
aliases = aliases(),
crate_name = "extractor_common",
visibility = ["//visibility:public"],
deps = all_crate_deps(),
)
6 changes: 6 additions & 0 deletions shared/extractor-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ edition.workspace = true

[lints]
workspace = true

# When updating these dependencies, run `rust/update_cargo_deps.sh`
[dependencies]
flate2 = "1.1"
Comment thread
paldepind marked this conversation as resolved.
Resolved
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
zstd = "0.14.2"
Loading
Loading