Nitpick Build System (npkbld) Specification

The official build system and package manager for Nitpick is npkbld. It manages dependency resolution, compilation orchestration, and parallel building, integrating seamlessly with the npkc compiler.

1. Core Commands

npkbld offers a standard suite of build commands similar to Cargo or Make.

2. Global Options and Flags

You can customize the build execution environment with several global flags:

3. Configuration Format (build.abc)

By default, npkbld looks for a build.abc configuration file in the project root. The syntax is TOML-based and defines project metadata and individual target parameters.

Example build.abc Structure

[project]
name = "my_project"
version = "0.1.0"

[target.main]
type = "binary"              # Can be "binary" or "library"
sources = ["src/*.npk"]      # Glob patterns supported
deps = []                    # Internal target dependencies
flags = ["-O2", "--verify"]  # Custom npkc flags

Dependency Emission

npkbld deeply integrates with npkc’s --emit-deps flag. During a build, it triggers the compiler to emit JSON dependency manifests, which npkbld then consumes to build the parallelized internal build graph. You can visualize this graph using the npkbld deps > graph.dot command.