hawdb 0.30.0

An embedded Rust graph database for local data-plane workloads
Documentation
module(
    name = "hawdb",
    version = "0.30.0",
)

bazel_dep(name = "rules_rust", version = "0.75.0")
bazel_dep(name = "rules_shell", version = "0.8.0")
bazel_dep(name = "rules_tla", version = "0.2.0")
bazel_dep(name = "bazel_skylib", version = "1.9.2")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_python", version = "2.4.6")
bazel_dep(name = "rules_go", version = "0.65.0")
bazel_dep(name = "gazelle", version = "0.54.0")

# Maintain the rules locally so the authoritative check also retains evidence.
local_path_override(
    module_name = "rules_tla",
    path = "third_party/rules_tla",
)

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
    edition = "2024",
    versions = ["1.97.1"],
)
use_repo(rust, "rust_toolchains")

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.from_cargo(
    name = "crate_index",
    cargo_lockfile = "//:Cargo.lock",
    manifests = ["//:Cargo.toml"],
)
use_repo(crate, "crate_index")

# Keep optional telemetry resolution out of the default Cargo lockfile graph.
crate.spec(
    package = "opentelemetry",
    repositories = ["telemetry_crates"],
    version = "=0.33.1",
    default_features = False,
    features = ["metrics"],
)
crate.from_specs(
    name = "telemetry_crates",
    cargo_lockfile = "//crates/telemetry:Cargo.Bazel.lock",
)
use_repo(crate, "telemetry_crates")

# Resolve the standalone C binding's extra dependency without duplicating the
# engine or running Cargo's source-tree header generator inside Bazel.
crate.spec(
    package = "base64",
    repositories = ["ffi_crates"],
    version = "0.22",
)
crate.from_specs(
    name = "ffi_crates",
    cargo_lockfile = "//bindings/ffi:Cargo.Bazel.lock",
)
use_repo(crate, "ffi_crates")

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.from_file(go_mod = "//bindings/go:go.mod")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//bindings/go:go.mod")
use_repo(go_deps, "com_github_ebitengine_purego")

# The binding remains outside the library's Cargo workspace. Resolve only its
# PyO3 dependency here and reuse //:hawdb for the embedded engine itself.
crate.spec(
    features = [
        "abi3-py311",
        "extension-module",
    ],
    package = "pyo3",
    repositories = ["python_crates"],
    version = "0.29",
)
crate.from_specs(
    name = "python_crates",
    cargo_lockfile = "//bindings/python:Cargo.Bazel.lock",
)

_PYTHON_BUILD_ENV = {
    "PYO3_BUILD_EXTENSION_MODULE": "1",
    "PYO3_NO_PYTHON": "1",
}

crate.annotation(
    build_script_env = _PYTHON_BUILD_ENV,
    crate = "pyo3",
    repositories = ["python_crates"],
)
crate.annotation(
    build_script_env = _PYTHON_BUILD_ENV,
    crate = "pyo3-build-config",
    repositories = ["python_crates"],
)
crate.annotation(
    build_script_env = _PYTHON_BUILD_ENV,
    crate = "pyo3-ffi",
    repositories = ["python_crates"],
)
use_repo(crate, "python_crates")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.11")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
    hub_name = "python_test_deps",
    python_version = "3.11",
    requirements_lock = "//bindings/python:requirements.txt",
)
use_repo(pip, "python_test_deps")