Peios Learn
Documentation

Peios

Peios Peios Kernel Universal Directory Project

Developer Tools

Trail Acta Provium clackatoo CAF GCSL Pekit

Applications

Framewright

Standards and Conventions

Standards and Conventions Peios Specifications
Pekit

Reference

Single-page view · as markdown

Commands

Pekit / Reference

The pekit command has a subcommand for each kind of work. This page says what each is for and where to read about it. pekit(1) is the authority for every command, option, exit status, environment variable, and file, and pekit <command> --help summarizes one command.

The commands #

These are the commands, in the order you're likely to meet them:

CommandDoesRead
pekit buildBuilds targets.Building a First Program
pekit testRuns tests, every test below this directory by default.Writing and Running Tests
pekit runRuns a script, or the program a build gives.Running Scripts and Programs
pekit query depsLists the steps and files targets reach.Querying What Targets Reach
pekit query rdepsLists the targets that read a file.Querying What Targets Reach
pekit lockPins the libraries the workspace imports.Pinning Libraries
pekit sourcesRecords what each recipe's packages are built from in pekit.sources.Recording Corresponding Source
pekit packagePacks packages with the workspace's packagers.Packaging
pekit publishPacks packages and publishes them into a store.Packaging
pekit releaseBuilds a package from HEAD strictly, publishes it, and tags it.Releasing
pekit cleanRemoves pekit-out/, and with --cache the store.Managing the Store
pekit store statsShows the store's size, its limit, and whether a build is using it.Managing the Store
pekit store evictEvicts the store to within its limit now.Managing the Store
pekit store verifyHashes every file of the store again, and with --repair repairs what is wrong.Managing the Store

Options the building commands share #

build, test, run, query, package, publish, and sources take the same options for how they build:

OptionDoesRead
--jobsLimits how many programs this build runs at once.Targets and Steps, Sharing the Machine
--evaluatingLimits how many targets this build evaluates at once.Sharing the Machine
--platformBuilds for another platform.Building for Another Platform
--profileChooses the keychain's profile.Using Secrets
--rebuildRuns every step, reusing nothing from the store.Reuse and the Store
--check-reproducibleRuns every step twice and compares the outputs.Checking That a Build Is Reproducible
--strictBuilds as a release does.Hermetic and Strict Builds
--fail-fastStops the build at the first target that fails.Naming Targets
--no-dynamicFails a target that waits for a step's result.Targets and Steps
--traceWrites a timeline of the build.Profiling a Build
--gcsl-profileWrites a profile of the build's GCSL code.Profiling a Build
--remote-cache, --remote-instance, --remote-headerLooks for steps in a remote cache.Sharing a Remote Cache
--remote-uploadWrites the steps a build records to the remote cache.Sharing a Remote Cache

Definition Types and Attributes

Pekit / Reference

GCSL's prelude declares the definition types and attributes that build files use. Plain GCSL runs them as ordinary calls; pekit gives them their meaning as a build system. This page lists what each means to pekit. GCSL's Attributes and Definition Types and Metadata pages describe them as language features.

Definition types #

Each definition type declares a kind of target, which one command acts on:

Definition typeDeclaresIts body givesCommand
buildSomething to build.Any value: a file, a directory, or a record or list of them.pekit build
testA check. Its body is a step, unless marked #[hermetic(false)].Nothing. The test passes if the body succeeds.pekit test
packageA package of any format.A version and the files it installs under /usr.pekit package, pekit publish, pekit release
scriptA task you run by hand. Only a script can call a script.Any value.pekit run
Toolchain::<kind>A toolchain of a kind, to register in pekitconf.Its platforms and the files it provides.None; libraries ask for it.

A definition can declare parameters with defaults, as def test runs(prog: File = build app()). The defaults are worked out where the definition is called, outside any step, so a test is given what it tests.

Attributes #

These attributes change how pekit runs a function. Put them on the lines before a fn or def:

AttributeMeans to pekit
#[hermetic]A call of the function from a target's code is a step: run in a sandbox, and its result kept in the store. #[hermetic(false)] turns this off, as for a test that needs the network.
#[retry(n)]A step that fails runs again from the start, up to n more times. One that passes only on a retry is reported as flaky.
#[timeout(limit)]A step that runs longer than limit, such as 5m, fails. The limit covers all its attempts together.
#[device("kvm")]The step's sandbox has /dev/kvm, where the machine has it. It doesn't key the step.
#[scratch]The step has a directory at /pekit-scratch that pekit keeps between its runs. It doesn't key the step.
#[track_caller]An error in the function's body is reported where it was called.

#[retry], #[timeout], and #[track_caller] mean the same in plain GCSL. #[hermetic], #[device], and #[scratch] mean nothing to plain GCSL, which runs such a call at once, as any call.

Paths in a Step

Pekit / Reference

A step's sandbox has the same layout on every machine and in every checkout. This table lists each path a step can have, in the order a step is likely to use them. Step Sandboxes explains why the layout is as it is.

PathHoldsWritableThere when
/w/<path>A workspace file or directory the step was given, at its path in the workspace.NoThe step was given it.
/w/.gcsl/libraries/<library>/A library's own files the step was given.NoThe step was given one.
/pekit-out/.steps/<function>/<identity>/The step's own directory, where its programs start and its outputs go.YesAlways.
/pekit-out/<path>Another step's output the step was given.NoThe step was given it.
/pekit-out/.fetch/<sha256>/<name>A fetched file the step was given.NoThe step was given it.
/pekit-out/.unpack/<key>/An unpacked archive the step was given.NoThe step was given it.
/pekit-out/.git/<key>/<name>/A git commit's files the step was given.NoThe step was given them.
/tmpAn empty directory of the step's own.YesAlways.
/pekit-scratchA directory pekit keeps between the step's runs.YesThe step is marked #[scratch].
/pekit-secrets/<profile>/<name>A secret file.NoThe step was given the secret.
/usr, /bin, /lib, /lib64, /sbinThe host's own programs and libraries.NoThe build isn't strict.
/etc/alternatives, /etc/ld.so.cacheWhat the host's programs need to start.NoThe build isn't strict.
/etc/passwd, /etc/groupA fixed user database of root, pekit and nobody, the same in every step.NoAlways.
/devnull, zero, full, random, urandom, tty, and the standard streams.Yes, as devices allowAlways.
/dev/kvmThe machine's KVM device.YesThe step is marked #[device("kvm")] and the machine has KVM.
/procThe step's own processes.NoAlways.

A program the step runs starts in the step's own directory, with PATH set to /usr/bin:/bin:/usr/sbin:/sbin unless its exec sets one. It runs as the user pekit, number 1000, with LOGNAME and USER set to pekit unless its exec sets them. pekit's home, /nonexistent, isn't there.

Peios Learn — documentation for Peios software.

Built with Trail.