Skip to main content

Module workspace

Module workspace 

Source
Expand description

Packaging slice 1 (#2207, decision C): workspaces.

A workspace root is a directory whose bynk.toml holds [workspace] (and may hold [registries]) and nothing else: it is never a project itself, the Cargo “virtual manifest”. Its members are the directories members matches, minus those exclude matches, each holding its own bynk.toml.

A pattern is a relative path whose components may use * (any run of characters) and ? (one character); each * matches within one directory level. A hidden directory is matched only by a component that itself starts with ..

A project finds the workspace it belongs to by walking up for a [workspace] whose members include it (find_parent_workspace). A parent bynk.toml that doesn’t parse, has an unknown table, or doesn’t list the project counts as absent, so one broken unrelated manifest can’t break every project nested under it.

Structs§

ImplicitWorkspace
#3274: the workspace a manifest-less directory of projects stands for under --each, with what it set aside.
Workspace
A loaded workspace root and its members.

Enums§

ImplicitWorkspaceError
Why a directory is not an implicit workspace.

Functions§

find_parent_workspace
The workspace root above project_root whose members include it, if any.
implicit_workspace
#3274: the implicit workspace at root, a directory with no bynk.toml of its own. Its members are the immediate subdirectories that hold a bynk.toml, in name order: members = ["*"] as a real workspace reads it, except that a subdirectory without a manifest is set aside rather than an error (a repository of examples keeps a docs/ beside them). Directories that discovery skips (hidden, out, node_modules) are never members.
is_workspace_root
Whether dir’s bynk.toml parses and holds a [workspace] table. A manifest that doesn’t parse isn’t a workspace root: the command that reads it next reports it as malformed.
load_workspace
Load the workspace rooted at root: check its manifest, refuse sources at the root, and resolve its members. A workspace whose patterns match no member is an error, as an unknown table is (#1665).