sigildocs

(sigil cli build-cmds)

(sigil cli build-cmds) - Build and bundle command implementations

Shared library used by both the user-facing CLI (cli.sgl) and the minimal bootstrap CLI (cli/boot.sgl). Holds the workspace-build engine plus its many helpers (external dep loading, build cache, package path resolution) and the build/bundle subcommand definitions.

Imports here define the bootstrap-required set: anything pulled in by this module (transitively) ends up in BOOTSTRAP_MODULES (Makefile). Keep the import list lean — sigil-cli's user-facing extras (test, format, watch, profile) belong in cli.sgl, not here.

Exports

Find source file for a module in source paths and load paths Returns absolute path or #f Exit with a clear error when the user asks for a build config that isn't declared in the workspace's package.sgl. Defined at module scope so callers where config-name is shadowed by a parameter can still reach the config-name struct accessor. See t-83fe.

Create a default config if none specified in package. Provides sensible defaults for common config names:

  • dev: debug build, no optimization, dynamic linking
  • debug: debug build with static linking (installable)
  • release: optimized, dynamic linking, supports FFI/dlopen
  • release-static: optimized, musl static, no FFI support
  • prerelease: like release but marked as non-release
  • prerelease-static: like release-static but marked as non-release

Load external dependency packages from .sigil/deps/ (git deps) and resolve from-path deps directly (including transitive deps) Optional third argument is redirects to apply Returns (packages-alist . paths-alist) where: packages-alist: (pkg-name . package) pairs paths-alist: (pkg-name . path) pairs

Load git deps and their transitive dependencies Returns list of (pkg-name package path) tuples

Load a single git dep (redirected or not) Returns (pkg-name package path) or #f

Get transitive git deps from a package that need to be loaded Returns list of from-git deps (after applying redirects if within same workspace)

Resolve all from-path deps and their transitive dependencies Returns list of (pkg-name package path) tuples

Collect transitive dependencies that can be resolved from the same workspace Returns list of from-path records for deps found in the workspace

Find a package by name in a workspace Returns the path to the package directory, or #f if not found

Add source directories of external packages to the library path This enables imports from external (redirected) dependencies during compilation Also handles workspaces: when an external path is a workspace, adds ALL package source dirs from that workspace (for transitive dependencies)

Find the workspace root for a package path (if it's part of a workspace)

Add all package source directories from a workspace to the library path

Build packages in a workspace with dependency resolution Returns an alist of (pkg-name . outputs) where outputs is: ((modules . path) (libs . path) (assets . path-or-#f))

Find the path to a package directory by name Searches: 1) external-paths (if provided), 2) workspace paths, 3) git deps in .sigil/deps/, 4) from-path deps external-paths is an alist of (pkg-name . path) for pre-resolved external deps

Find a from-path dependency's path by name Returns the path or raises an error if not found

Find sigil-lib path by looking for it as a sibling of resolved deps, or in the sigil repo that hosts the running sigil binary.

When sigil-lib isn't in the dependency chain (common for apps that only use sigil-stdlib / sigil-tls / sigil-crypto transitively), we can find it in a few places:

  • For from-path deps (in external-paths), check each dep's parent directory for a sigil-lib sibling.
  • For from-git deps, .sigil/deps/<pkg> symlinks into the shared ~/.sigil/deps/<repo>-<sha>/packages/<pkg> checkout, which contains sigil-lib as a sibling. Resolve the symlink target and check its parent directory too.
  • As a last resort, derive it from the running sigil binary's location: for an in-tree build the binary lives at <sigil-repo>/build/<config>/bin/sigil, so ../../../packages/sigil-lib relative to the binary directory points at the matching sigil-lib source tree. This makes native-entry builds work without the caller having to declare sigil-lib as a dep or supply --redirects.

Build a single package Returns an artifacts alist: ((static-library path1 path2 ...) (bytecode path3 ...) ...)

find-taskprocedure

Find a task by name in a package (includes default tasks)

Check if a task exists in workspace-level tasks

task-runnerprocedure

Common task runner used by both 'run' and 'build' commands

build-handlerprocedure

Handler for 'sigil build' - builds packages with dependency resolution

Usage: sigil build - In workspace: build all packages in dependency order In package: run the 'build' task sigil build <package> - In workspace: build specific package with deps sigil build --task <t> - Run specific task instead of 'build'

Find all .msb files in a directory

Find static sigil executable

verbose-optvariable

(No description)

help-optvariable

(No description)

force-optvariable

(No description)

config-optvariable

(No description)

(No description)

(No description)

build-cmdvariable

(No description)

bundle-cmdvariable

(No description)