The beans.pot manifest
beans.pot is the manifest file at the root of a Beans module. It names the
module, says whether the module is an application or a library, pins Git
dependencies, and passes native linker directives. It is parsed in
compiler/beans/module.b.
Syntax
Section titled “Syntax”The manifest is line-based. It is not TOML and not JSON. Each line is one
directive. Blank lines are ignored. A line starting with // is a comment and
is ignored.
The smallest real manifests are one line. The example project ships a
beans.pot that is just:
module shopThe compiler’s own manifest is just module compiler.
Create a minimal manifest in the current directory with
beansc pot init <module-name>. The command does not overwrite an existing
manifest.
Fields
Section titled “Fields”module <name> (required)
Section titled “module <name> (required)”Names the module. Exactly one module line is required. The name is the
module path: the root that local packages and the lock file hang off of.
module shopkind application or kind library (optional)
Section titled “kind application or kind library (optional)”Says what the module builds. The default is application.
kind application: the module needs anfn main().kind library: the module must not have amain.
module shopkind applicationSee Building for how a library build produces a .a, a
.dylib/.so, and an optional C header.
require <host/owner/repo> <ref> (repeatable)
Section titled “require <host/owner/repo> <ref> (repeatable)”Pins one Git dependency. The path is a Git host path; the ref is a tag, branch, or commit-like reference.
require github.com/acme/http v1.2Requiring the same path at two different refs is an error. Full detail, and how
this feeds beans.lock, is on Dependencies and the lock
file.
link <selector> <search|library|framework> "<value>" (repeatable)
Section titled “link <selector> <search|library|framework> "<value>" (repeatable)”Passes a native linker directive, for modules that link against C libraries.
selectorisall, an OS name (for examplemacos,linux,windows), or an exact target triple (for examplex86_64-unknown-linux-gnu).- The kind is one of:
search: a library search directory. Search paths are relative to thebeans.potfile.library: a library to link (by name).framework: a framework to link (macOS).
- The value is a quoted string.
Entries pass to the linker in the order you declare them.
A fuller example
Section titled “A fuller example”module shopkind applicationrequire github.com/acme/http v1.2link all search "native/lib"link all library "shop_native"link macos framework "CoreFoundation"link x86_64-unknown-linux-gnu library "platform_helper"This module is an application, pulls in one Git dependency, and links a native
library it ships under native/lib, plus a macOS framework and one
Linux-only helper.
See Dependencies and the lock file for how require feeds
beans.lock, and the FFI guide for how link fits with C
interop.