Skip to main content

gen_gomod/
lib.rs

1//! `gen-gomod` — gomod adapter for the gen ecosystem.
2//!
3//! Parses `go.mod` + a vendored tree (via `go list -deps -json`) into a
4//! typed per-package [`build_spec::BuildSpec`] (v2 incremental) and emits
5//! it as `Go.build-spec.json`. See `theory/ECOSYSTEM-INTAKE.md` for the
6//! seven-artifact contract and the M1 build doc for the per-package
7//! (rustc-per-crate-in-Go) delta.
8//!
9//! The TYPED-SPEC + INTERPRETER TRIPLET:
10//! - **Rust border** — [`build_spec`] (the v2 shape + the v1 `coarse` submod).
11//! - **Lisp spec** — `specs/go-package-build.lisp` + `specs/adapter.lisp`.
12//! - **Interpreter** — [`interp`] (`apply(env, ctx) -> BuildSpec`), with
13//!   every side effect behind the [`interp::GoBuildEnv`] trait.
14
15pub mod adapter;
16pub mod build_spec;
17pub mod emit;
18pub mod error;
19pub mod gen_delta;
20pub mod golist;
21pub mod gomod;
22pub mod interp;
23pub mod invariants;
24pub mod quirks;
25pub mod testkit;
26
27pub use adapter::GomodAdapter;
28pub use build_spec::{BuildSpec, PackageKind, PackageSpec, SCHEMA_VERSION};
29pub use emit::{generate_and_write, generate_for_target_and_write, SPEC_FILENAME};
30pub use error::{GomodError, Result};
31pub use interp::{apply, EncodeCtx, GoBuildEnv, RealGoBuildEnv};