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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -875,11 +875,11 @@ jobs:
python3 scripts/ci/cargo-bazel-drift-check.py
python3 scripts/ci/test-cargo-bazel-drift-check.py

- name: Bazel smoke + foundation/compiler libs
- name: Bazel smoke + first-party library targets
run: |
# Do not set --remote_cache; Blacksmith injects repository cache.
bazelisk test //tools/bazel/smoke:smoke_test //:foundation_compiler_tests
bazelisk build //:bazel_smoke //:foundation_compiler_libs
bazelisk test //tools/bazel/smoke:smoke_test //:first_party_lib_tests
bazelisk build //:bazel_smoke //:first_party_libs //:runtime_libs

ci-gate:
name: CI Gate
Expand Down
70 changes: 68 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Root Bazel package for GraphForge (#10 foundation/compiler libs)."""
"""Root Bazel package for GraphForge (#10 foundation + #9 runtime libs)."""

load("@bazel_skylib//rules:build_test.bzl", "build_test")

Expand All @@ -23,7 +23,7 @@ alias(
)

# Foundation + compiler-layer libraries modeled in #10 (plus storage, required
# by graphforge-rel). Runtime peers remain for #9.
# by graphforge-rel).
build_test(
name = "foundation_compiler_libs",
targets = [
Expand Down Expand Up @@ -53,3 +53,69 @@ test_suite(
"//crates/graphforge-storage:graphforge_storage_test",
],
)

# Runtime libraries modeled in #9 (storage already in foundation aggregate).
build_test(
name = "runtime_libs",
targets = [
"//crates/graphforge-api:graphforge_api",
"//crates/graphforge-exec:graphforge_exec",
"//crates/graphforge-io:graphforge_io",
"//crates/graphforge-knowledge:graphforge_knowledge",
"//crates/graphforge-search:graphforge_search",
"//crates/graphforge-storage:graphforge_storage",
],
)

test_suite(
name = "runtime_lib_tests",
tests = [
"//crates/graphforge-api:graphforge_api_test",
"//crates/graphforge-exec:graphforge_exec_test",
"//crates/graphforge-io:graphforge_io_test",
"//crates/graphforge-knowledge:graphforge_knowledge_test",
"//crates/graphforge-search:graphforge_search_test",
"//crates/graphforge-storage:graphforge_storage_test",
],
)

# All first-party library targets modeled so far (#10 + #9).
build_test(
name = "first_party_libs",
targets = [
"//crates/graphforge-api:graphforge_api",
"//crates/graphforge-ast:graphforge_ast",
"//crates/graphforge-core:graphforge_core",
"//crates/graphforge-cypher:graphforge_cypher",
"//crates/graphforge-exec:graphforge_exec",
"//crates/graphforge-io:graphforge_io",
"//crates/graphforge-ir:graphforge_ir",
"//crates/graphforge-knowledge:graphforge_knowledge",
"//crates/graphforge-ontology:graphforge_ontology",
"//crates/graphforge-plan:graphforge_plan",
"//crates/graphforge-provenance:graphforge_provenance",
"//crates/graphforge-rel:graphforge_rel",
"//crates/graphforge-search:graphforge_search",
"//crates/graphforge-storage:graphforge_storage",
],
)

test_suite(
name = "first_party_lib_tests",
tests = [
"//crates/graphforge-api:graphforge_api_test",
"//crates/graphforge-ast:graphforge_ast_test",
"//crates/graphforge-core:graphforge_core_test",
"//crates/graphforge-cypher:graphforge_cypher_test",
"//crates/graphforge-exec:graphforge_exec_test",
"//crates/graphforge-io:graphforge_io_test",
"//crates/graphforge-ir:graphforge_ir_test",
"//crates/graphforge-knowledge:graphforge_knowledge_test",
"//crates/graphforge-ontology:graphforge_ontology_test",
"//crates/graphforge-plan:graphforge_plan_test",
"//crates/graphforge-provenance:graphforge_provenance_test",
"//crates/graphforge-rel:graphforge_rel_test",
"//crates/graphforge-search:graphforge_search_test",
"//crates/graphforge-storage:graphforge_storage_test",
],
)
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""GraphForge Bazel module (M2 / #10 foundation + compiler libs).
"""GraphForge Bazel module (M2 / #10 foundation + #9 runtime libs).

Canonical build-system contract: GitHub issue #1.
Activates crate_universe `from_cargo` against the frozen Cargo workspace and
models foundation/compiler-layer first-party libraries as real rules_rust
targets (no Cargo shell-out for ordinary compilation).
models first-party libraries as real rules_rust targets (no Cargo shell-out
for ordinary compilation).
"""

module(
Expand Down
2 changes: 1 addition & 1 deletion crates/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""First-party crate packages live in crates/*/BUILD.bazel (#10+)."""
"""First-party crate packages live in crates/*/BUILD.bazel (#10/#9+)."""

package(default_visibility = ["//visibility:public"])
53 changes: 52 additions & 1 deletion crates/graphforge-api/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
"""Scaffolding for crate_universe manifests; library modeling deferred (#9/#7/#8)."""
"""Bazel targets for graphforge-api (#9 runtime)."""

load("//tools/bazel:gf_rust.bzl", "gf_rust_library", "gf_rust_test")

exports_files(["Cargo.toml"])

package(default_visibility = ["//visibility:public"])

# Unit tests include_str! contract fixtures from docs/contracts/examples.
_API_COMPILE_DATA = [
"//docs/contracts/examples:fixtures",
]

gf_rust_library(
name = "graphforge_api",
compile_data = _API_COMPILE_DATA,
deps = [
"//crates/graphforge-core:graphforge_core",
"//crates/graphforge-cypher:graphforge_cypher",
"//crates/graphforge-exec:graphforge_exec",
"//crates/graphforge-ir:graphforge_ir",
"//crates/graphforge-knowledge:graphforge_knowledge",
"//crates/graphforge-ontology:graphforge_ontology",
"//crates/graphforge-provenance:graphforge_provenance",
"//crates/graphforge-rel:graphforge_rel",
"//crates/graphforge-search:graphforge_search",
"//crates/graphforge-storage:graphforge_storage",
],
)

gf_rust_test(
name = "graphforge_api_test",
crate = ":graphforge_api",
compile_data = _API_COMPILE_DATA,
# Runtime reads via env!("CARGO_MANIFEST_DIR")/../../docs/reference/...
# Bake a workspace-relative manifest dir so runfiles layout resolves.
data = ["//docs/reference:schema_inventory_fixtures"],
rustc_env = {
"CARGO_MANIFEST_DIR": "crates/graphforge-api",
},
# Large public-facade unit suite with filesystem/async paths.
size = "large",
timeout = "long",
deps = [
"//crates/graphforge-core:graphforge_core",
"//crates/graphforge-cypher:graphforge_cypher",
"//crates/graphforge-exec:graphforge_exec",
"//crates/graphforge-ir:graphforge_ir",
"//crates/graphforge-knowledge:graphforge_knowledge",
"//crates/graphforge-ontology:graphforge_ontology",
"//crates/graphforge-provenance:graphforge_provenance",
"//crates/graphforge-rel:graphforge_rel",
"//crates/graphforge-search:graphforge_search",
"//crates/graphforge-storage:graphforge_storage",
],
)
32 changes: 31 additions & 1 deletion crates/graphforge-exec/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
"""Scaffolding for crate_universe manifests; library modeling deferred (#9/#7/#8)."""
"""Bazel targets for graphforge-exec (#9 runtime)."""

load("//tools/bazel:gf_rust.bzl", "gf_rust_library", "gf_rust_test")

exports_files(["Cargo.toml"])

package(default_visibility = ["//visibility:public"])

gf_rust_library(
name = "graphforge_exec",
deps = [
"//crates/graphforge-core:graphforge_core",
"//crates/graphforge-ir:graphforge_ir",
"//crates/graphforge-ontology:graphforge_ontology",
"//crates/graphforge-plan:graphforge_plan",
"//crates/graphforge-rel:graphforge_rel",
"//crates/graphforge-storage:graphforge_storage",
],
)

gf_rust_test(
name = "graphforge_exec_test",
crate = ":graphforge_exec",
# Algorithm + execution unit suite; default "small" is too tight.
size = "medium",
deps = [
"//crates/graphforge-core:graphforge_core",
"//crates/graphforge-cypher:graphforge_cypher",
"//crates/graphforge-ir:graphforge_ir",
"//crates/graphforge-ontology:graphforge_ontology",
"//crates/graphforge-plan:graphforge_plan",
"//crates/graphforge-rel:graphforge_rel",
"//crates/graphforge-storage:graphforge_storage",
],
)
21 changes: 20 additions & 1 deletion crates/graphforge-io/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
"""Scaffolding for crate_universe manifests; library modeling deferred (#9/#7/#8)."""
"""Bazel targets for graphforge-io (#9 runtime)."""

load("//tools/bazel:gf_rust.bzl", "gf_rust_library", "gf_rust_test")

exports_files(["Cargo.toml"])

package(default_visibility = ["//visibility:public"])

gf_rust_library(
name = "graphforge_io",
deps = [
"//crates/graphforge-core:graphforge_core",
"//crates/graphforge-storage:graphforge_storage",
],
)

gf_rust_test(
name = "graphforge_io_test",
crate = ":graphforge_io",
deps = [
"//crates/graphforge-core:graphforge_core",
"//crates/graphforge-storage:graphforge_storage",
],
)
19 changes: 18 additions & 1 deletion crates/graphforge-knowledge/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
"""Scaffolding for crate_universe manifests; library modeling deferred (#9/#7/#8)."""
"""Bazel targets for graphforge-knowledge (#9 runtime)."""

load("//tools/bazel:gf_rust.bzl", "gf_rust_library", "gf_rust_test")

exports_files(["Cargo.toml"])

package(default_visibility = ["//visibility:public"])

gf_rust_library(
name = "graphforge_knowledge",
deps = [
"//crates/graphforge-core:graphforge_core",
],
)

gf_rust_test(
name = "graphforge_knowledge_test",
crate = ":graphforge_knowledge",
deps = [
"//crates/graphforge-core:graphforge_core",
],
)
23 changes: 22 additions & 1 deletion crates/graphforge-search/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
"""Scaffolding for crate_universe manifests; library modeling deferred (#9/#7/#8)."""
"""Bazel targets for graphforge-search (#9 runtime)."""

load("//tools/bazel:gf_rust.bzl", "gf_rust_library", "gf_rust_test")

exports_files(["Cargo.toml"])

package(default_visibility = ["//visibility:public"])

gf_rust_library(
name = "graphforge_search",
deps = [
"//crates/graphforge-storage:graphforge_storage",
],
)

gf_rust_test(
name = "graphforge_search_test",
crate = ":graphforge_search",
# Indexing / tempfile paths; default "small" is too tight.
size = "medium",
deps = [
"//crates/graphforge-core:graphforge_core",
"//crates/graphforge-ir:graphforge_ir",
"//crates/graphforge-storage:graphforge_storage",
],
)
9 changes: 8 additions & 1 deletion crates/graphforge-storage/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Bazel targets for graphforge-storage.

Modeled in #10 because graphforge-rel (compiler lowering) depends on it.
Issue #9 still owns the remaining runtime libraries (exec/search/knowledge/api/io).
Runtime peers (exec/search/knowledge/api/io) are modeled in #9.
"""

load("//tools/bazel:gf_rust.bzl", "gf_rust_library", "gf_rust_test")
Expand All @@ -12,6 +12,12 @@ package(default_visibility = ["//visibility:public"])

gf_rust_library(
name = "graphforge_storage",
# Enable failpoint hooks so api/cli unit tests that spawn subprocesses can
# inject protocol faults. Hooks remain no-ops unless the exact env cookie is
# set (same as Cargo `[dev-dependencies] features = ["test-failpoints"]`
# unification). Residual vs Cargo release builds: Bazel links the env-gated
# bodies instead of the const no-op; document for #6 parity.
crate_features = ["test-failpoints"],
deps = [
"//crates/graphforge-core:graphforge_core",
"//crates/graphforge-ir:graphforge_ir",
Expand All @@ -22,6 +28,7 @@ gf_rust_library(
gf_rust_test(
name = "graphforge_storage_test",
crate = ":graphforge_storage",
crate_features = ["test-failpoints"],
# Unit suite exercises filesystem/async paths; default "small" is too tight.
size = "medium",
deps = [
Expand Down
10 changes: 10 additions & 0 deletions docs/contracts/examples/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Contract example fixtures compiled into graphforge-api unit tests (#9)."""

package(default_visibility = ["//visibility:public"])

exports_files(glob(["*"]))

filegroup(
name = "fixtures",
srcs = glob(["*"]),
)
Loading
Loading