Skip to main content

Crate gen_bazel

Crate gen_bazel 

Source
Expand description

gen-bazel — Bazel renderer for the gen engine.

Same typed Manifest as gen-nix / gen-nix-bulk; emits a typed Starlark AST → canonical pretty-printer → BUILD.bazel + MODULE.bazel files. The destination per the GEN.md plan: one source-of-truth Manifest, N typed renderers (Nix / Bazel / Buck / Bazel-rust-rules), operators pick the backend via shikumi.

The Starlark AST is intentionally minimal (atoms / lists / dicts / function-calls / assignments) — matches what BUILD files actually use; full Starlark eval is not in scope.

Re-exports§

pub use ast::StarlarkValue;
pub use ast::StarlarkStmt;
pub use ast::KwArg;
pub use render::render_file;

Modules§

ast
Minimal typed Starlark AST. Covers the subset BUILD files actually use: atoms, lists, dicts, function calls, named keyword args, load() statements, assignments. Full Starlark eval is out of scope — this is an emission AST only.
render
Canonical pretty-printer for the Starlark emission AST.

Functions§

render_build_bazel
Render a typed Manifest to a BUILD.bazel file body. One rust_library or rust_binary call per workspace member, plus rust_test for the integration tests when present.
render_module_bazel
Render a MODULE.bazel that declares the cargo dependencies via the cargo extension. Each external crate becomes one crate.from_cargo entry; operators use bazel mod tidy after to pin transitives.