mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
This outputs some duration counts for various parts of the extraction process in the database in the form of telemetry diagnostics. The diagnostics format was preferred to putting things in the relational database as that will scale better to code scanning and is more flexible as for the data we can put into it without passing through the dbscheme. Also, although it's not the case yet, it will be possible to output diagnostics even if creation of the database fails.
205 lines
8.1 KiB
Python
205 lines
8.1 KiB
Python
module(
|
|
name = "ql",
|
|
version = "0.0",
|
|
repo_name = "codeql",
|
|
)
|
|
|
|
# this points to our internal repository when `codeql` is checked out as a submodule thereof
|
|
# when building things from `codeql` independently this is stubbed out in `.bazelrc`
|
|
bazel_dep(name = "semmle_code", version = "0.0")
|
|
local_path_override(
|
|
module_name = "semmle_code",
|
|
path = "..",
|
|
)
|
|
|
|
# see https://registry.bazel.build/ for a list of available packages
|
|
|
|
bazel_dep(name = "platforms", version = "0.0.10")
|
|
bazel_dep(name = "rules_go", version = "0.50.0")
|
|
bazel_dep(name = "rules_pkg", version = "1.0.1")
|
|
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
|
|
bazel_dep(name = "rules_python", version = "0.36.0")
|
|
bazel_dep(name = "bazel_skylib", version = "1.7.1")
|
|
bazel_dep(name = "abseil-cpp", version = "20240116.0", repo_name = "absl")
|
|
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
|
|
bazel_dep(name = "fmt", version = "10.0.0")
|
|
bazel_dep(name = "rules_kotlin", version = "2.0.0-codeql.1")
|
|
bazel_dep(name = "gazelle", version = "0.38.0")
|
|
bazel_dep(name = "rules_dotnet", version = "0.17.4")
|
|
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
|
|
bazel_dep(name = "rules_rust", version = "0.52.2")
|
|
|
|
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
|
|
|
|
# Keep edition and version approximately in sync with internal repo.
|
|
# the versions there are canonical, the versions here are used for CI in github/codeql, as well as for the vendoring of dependencies.
|
|
RUST_EDITION = "2021"
|
|
|
|
RUST_VERSION = "1.81.0"
|
|
|
|
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
|
|
rust.toolchain(
|
|
edition = RUST_EDITION,
|
|
# We need those extra target triples so that we can build universal binaries on macos
|
|
extra_target_triples = [
|
|
"x86_64-apple-darwin",
|
|
"aarch64-apple-darwin",
|
|
],
|
|
versions = [RUST_VERSION],
|
|
)
|
|
use_repo(rust, "rust_toolchains")
|
|
|
|
register_toolchains("@rust_toolchains//:all")
|
|
|
|
rust_host_tools = use_extension("@rules_rust//rust:extensions.bzl", "rust_host_tools")
|
|
|
|
# Don't download a second toolchain as host toolchain, make sure this is the same version as above
|
|
# The host toolchain is used for vendoring dependencies.
|
|
rust_host_tools.host_tools(
|
|
edition = RUST_EDITION,
|
|
version = RUST_VERSION,
|
|
)
|
|
|
|
# deps for python extractor
|
|
# keep in sync by running `misc/bazel/3rdparty/update_cargo_deps.sh`
|
|
py_deps = use_extension("//misc/bazel/3rdparty:py_deps_extension.bzl", "p")
|
|
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")
|
|
|
|
# deps for ruby+rust
|
|
# keep in sync by running `misc/bazel/3rdparty/update_cargo_deps.sh`
|
|
tree_sitter_extractors_deps = use_extension("//misc/bazel/3rdparty:tree_sitter_extractors_extension.bzl", "r")
|
|
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_cfg-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_intern-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.133", "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")
|
|
|
|
dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
|
|
dotnet.toolchain(dotnet_version = "9.0.100")
|
|
use_repo(dotnet, "dotnet_toolchains")
|
|
|
|
register_toolchains("@dotnet_toolchains//:all")
|
|
|
|
csharp_main_extension = use_extension("//csharp:paket.main_extension.bzl", "main_extension")
|
|
use_repo(csharp_main_extension, "paket.main")
|
|
|
|
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
|
|
pip.parse(
|
|
hub_name = "codegen_deps",
|
|
python_version = "3.11",
|
|
requirements_lock = "//misc/codegen:requirements_lock.txt",
|
|
)
|
|
use_repo(pip, "codegen_deps")
|
|
|
|
swift_deps = use_extension("//swift/third_party:load.bzl", "swift_deps")
|
|
|
|
# following list can be kept in sync with `bazel mod tidy`
|
|
use_repo(
|
|
swift_deps,
|
|
"binlog",
|
|
"picosha2",
|
|
"swift_prebuilt_darwin_x86_64",
|
|
"swift_prebuilt_linux",
|
|
"swift_toolchain_linux",
|
|
"swift_toolchain_macos",
|
|
)
|
|
|
|
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
|
|
node.toolchain(
|
|
name = "nodejs",
|
|
node_urls = [
|
|
"https://nodejs.org/dist/v{version}/{filename}",
|
|
"https://mirrors.dotsrc.org/nodejs/release/v{version}/{filename}",
|
|
],
|
|
node_version = "18.15.0",
|
|
)
|
|
use_repo(node, "nodejs", "nodejs_toolchains")
|
|
|
|
kotlin_extractor_deps = use_extension("//java/kotlin-extractor:deps.bzl", "kotlin_extractor_deps")
|
|
|
|
# following list can be kept in sync by running `bazel mod tidy` in `codeql`
|
|
use_repo(
|
|
kotlin_extractor_deps,
|
|
"codeql_kotlin_defaults",
|
|
"codeql_kotlin_embeddable",
|
|
"kotlin-compiler-1.5.0",
|
|
"kotlin-compiler-1.5.10",
|
|
"kotlin-compiler-1.5.20",
|
|
"kotlin-compiler-1.5.30",
|
|
"kotlin-compiler-1.6.0",
|
|
"kotlin-compiler-1.6.20",
|
|
"kotlin-compiler-1.7.0",
|
|
"kotlin-compiler-1.7.20",
|
|
"kotlin-compiler-1.8.0",
|
|
"kotlin-compiler-1.9.0-Beta",
|
|
"kotlin-compiler-1.9.20-Beta",
|
|
"kotlin-compiler-2.0.0-RC1",
|
|
"kotlin-compiler-2.0.20-Beta2",
|
|
"kotlin-compiler-2.1.0-Beta1",
|
|
"kotlin-compiler-embeddable-1.5.0",
|
|
"kotlin-compiler-embeddable-1.5.10",
|
|
"kotlin-compiler-embeddable-1.5.20",
|
|
"kotlin-compiler-embeddable-1.5.30",
|
|
"kotlin-compiler-embeddable-1.6.0",
|
|
"kotlin-compiler-embeddable-1.6.20",
|
|
"kotlin-compiler-embeddable-1.7.0",
|
|
"kotlin-compiler-embeddable-1.7.20",
|
|
"kotlin-compiler-embeddable-1.8.0",
|
|
"kotlin-compiler-embeddable-1.9.0-Beta",
|
|
"kotlin-compiler-embeddable-1.9.20-Beta",
|
|
"kotlin-compiler-embeddable-2.0.0-RC1",
|
|
"kotlin-compiler-embeddable-2.0.20-Beta2",
|
|
"kotlin-compiler-embeddable-2.1.0-Beta1",
|
|
"kotlin-stdlib-1.5.0",
|
|
"kotlin-stdlib-1.5.10",
|
|
"kotlin-stdlib-1.5.20",
|
|
"kotlin-stdlib-1.5.30",
|
|
"kotlin-stdlib-1.6.0",
|
|
"kotlin-stdlib-1.6.20",
|
|
"kotlin-stdlib-1.7.0",
|
|
"kotlin-stdlib-1.7.20",
|
|
"kotlin-stdlib-1.8.0",
|
|
"kotlin-stdlib-1.9.0-Beta",
|
|
"kotlin-stdlib-1.9.20-Beta",
|
|
"kotlin-stdlib-2.0.0-RC1",
|
|
"kotlin-stdlib-2.0.20-Beta2",
|
|
"kotlin-stdlib-2.1.0-Beta1",
|
|
)
|
|
|
|
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
|
|
go_sdk.download(version = "1.23.1")
|
|
|
|
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
|
|
go_deps.from_file(go_mod = "//go/extractor:go.mod")
|
|
use_repo(go_deps, "org_golang_x_mod", "org_golang_x_tools")
|
|
|
|
lfs_files = use_repo_rule("//misc/bazel:lfs.bzl", "lfs_files")
|
|
|
|
lfs_files(
|
|
name = "ripunzip-linux",
|
|
srcs = ["//misc/ripunzip:ripunzip-linux"],
|
|
executable = True,
|
|
)
|
|
|
|
lfs_files(
|
|
name = "ripunzip-windows",
|
|
srcs = ["//misc/ripunzip:ripunzip-windows.exe"],
|
|
executable = True,
|
|
)
|
|
|
|
lfs_files(
|
|
name = "ripunzip-macos",
|
|
srcs = ["//misc/ripunzip:ripunzip-macos"],
|
|
executable = True,
|
|
)
|
|
|
|
lfs_files(
|
|
name = "swift-resource-dir-linux",
|
|
srcs = ["//swift/third_party/resource-dir:resource-dir-linux.zip"],
|
|
)
|
|
|
|
lfs_files(
|
|
name = "swift-resource-dir-macos",
|
|
srcs = ["//swift/third_party/resource-dir:resource-dir-macos.zip"],
|
|
)
|
|
|
|
register_toolchains(
|
|
"@nodejs_toolchains//:all",
|
|
)
|