mirror of
https://github.com/github/codeql.git
synced 2026-03-17 04:56:58 +01:00
Previously, we pulled in the shared tree-sitter extractor via a `git` dependency in `Cargo.toml` to address a `rules_rust` limitation (no `path` dependencies outside of the cargo workspace)). This was a problem, as that means we're cloning `github/codeql` _again_ for the build, which is quite slow. I found another way that is faster, and still produces correct builds for both `cargo`` and `rules_rust`: * Cargo depends on a fake crate that has the same dependencies as the real crate (thanks to `sync-files.py`). Therefore, cargo pulls in the right dependencies into the lockfile, which bazel targets * For local builds, we override the path to that dependency in a cargo config, so we're pulling in the correct code * rules_rust only uses `path` dependencies for collecting transitive dependencies, it never pulls in the code from there. So far that, we manually provide a `BUILD.bazel` file for the shared extractor, and depend on that.
17 lines
444 B
Python
17 lines
444 B
Python
load("@ruby_deps//:defs.bzl", "aliases", "all_crate_deps")
|
|
load("@rules_rust//rust:defs.bzl", "rust_library")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
rust_library(
|
|
name = "codeql-extractor",
|
|
srcs = glob([
|
|
"src/**/*.rs",
|
|
]),
|
|
aliases = aliases(),
|
|
compile_data = [
|
|
"src/generator/prefix.dbscheme",
|
|
],
|
|
deps = all_crate_deps(package_name = "ruby/extractor/codeql-extractor-fake-crate"),
|
|
)
|