Options
Command options
Section titled “Command options”| Option | Meaning |
|---|---|
-s SLOT | the slot name in the object or bundle, like Release.Agnostic |
-p ASSET | the path of the asset in the bundle |
-c COMMAND, --command COMMAND | strictly relative command path inside the anonymous command directory |
-f FILE, --file FILE | write to FILE (overwriting if it exists) |
-d DIR, --dir DIR | write to directory DIR (creating it if needed) |
-n STRIP, --strip STRIP | when writing to a directory, strip this many leading path components [default: 0] |
-m MEMBER, --member MEMBER | when writing to a tar archive, only extract MEMBER; for run-object/run-asset it also implies the command path |
Global options
Section titled “Global options”Use -- to separate the global options from the command and its arguments.
-help,--help- show help and exit.--version- show version information and exit.-v,--verbose- show command lines while building; show values when complete. Repeat for more verbosity (max three).--quiet- don't show progress status; command lines still shown with-v.--global- set defaults to XDG directories under thedkprogram name.--install PROGRAM- [caution] install files to XDG directories underPROGRAMfor forms with XDG variables (${STATE},${CACHE}), and to home directories for${HOME}.-I DIR- include directory to search forvalues.json[c]and*.values.json[c](also library subdirectories, e.g.DIR/SomeLibrary_Std/values.json). Repeatable.--cell NAME=PATH- add a subdivision of project source code with the givenNAMEandPATH; later cells override earlier cells with the same name.-C DIR- change toDIRbefore doing anything else.--execution-abi ABI- set theexecution_abiwildcard; defaults to the ABI of this build executable (e.g.Darwin_arm64,Windows_x86_64).--target-abi ABI- set thetarget_abiwildcard; defaults to--execution-abi.-d MODE- enable debugging (-d listlists modes).-x TARGET,--invalidate TARGET- invalidateTARGETbefore running the command; likeinvalidatebut saved only if the command succeeds. Repeatable.--import lazy|eager- import values from distributions lazily, or all values for all slots at once [default:lazy].-a,--autofix- [caution] automatically fix problems like incorrect checksums.
Build metadata
Section titled “Build metadata”-t BUILD_TIMESTAMP,--build-timestamp BUILD_TIMESTAMP- from the ISO-8601BUILD_TIMESTAMP(2021-02-03T04:05:06Z), set the semver "build metadata" for invalidated and new objects' versions tobn-YYYYMMDDhhmmss.-P BUILD_PERIOD,--build-period BUILD_PERIOD- as-t, moduloBUILD_PERIOD. Suffixes:sseconds,mminutes,hhours,ddays.-n BUILD_NUMBER,--build-number BUILD_NUMBER- set the build metadata tobn-BUILD_NUMBER(omit thebn-prefix).
The build metadata is constructed from dk0's -t TIMESTAMP command-line
option in the bn-YYYYMMDDhhmmss format. In CI, pass the commit timestamp:
# GitHub Actionsrun: dk0 -t "${{ github.event.head_commit.timestamp }}" ...# GitLab CI- dk0 -t "$CI_COMMIT_TIMESTAMP" ...Security options
Section titled “Security options”--integrity none|existence|checksum- verify the local value store against the trace store.noneis fastest but can't tell if values are evicted;existencechecks for the existence of values (fetching from a remote value store if present);checksumis slowest, skips any value read without a constructive-trace entry, and removes it if permitted [default: existence].--random-seed SEED- seed the RNG for operations needing randomness (e.g. signing build files). Highly insecure but allows reproducible trace/value stores; if unset, a seed is generated from system entropy.--trust-local-package PACKAGE_ID- allow loading distributions fromPACKAGE_IDeven if their signatures cannot be verified. Repeatable.--dangerously-trust-all- skip all trust prompts and allow every privileged operation. Don't do it.--keys-env ENV_PREFIX- use<ENV_PREFIX>_PUBKEYand<ENV_PREFIX>_SECKEYas the build public/secret key (lines may be separated with pipes or newlines).--keys-dir DIR- directory for thebuild.pub/build.seckeys [default:<workspace>/t/k, or<xdg config>/dkwith--global].
Configuration options
Section titled “Configuration options”--data-dir DIR- data files [default:<workspace>/t/d,--global:<xdg data>/dk].--cache-dir DIR- transient cache files [default:<workspace>/t/c,--global:<xdg cache>/dk].--valuestore DIR- the value store for assets and intermediate build artifacts [default:datadir/val.1].--tracestore DIR- the trace store for successful builds and their dependent assets/artifacts [default:datadir/cts.1].
Include paths
Section titled “Include paths”-I DIR- include directory (see Global options).-isystem DIR- addDIRto the system include directories.-nobuiltininc- do not include built-in modules likeMlFront_Attestation.GitHubCLI.-nosysinc- do not include the system include directories (theetc/dk/idirectory wheredk0is installed) or any-isystemdirs.-noworkspaceinc- do not include the workspace include directories (etc/dk/iandetc/dk/vin the workspace).
Display options
Section titled “Display options”--errors-color/--errors-plain/--errors-pretty- control error-message formatting [default: plain ifCI=true, otherwise color].--ancestor-graph FILE/--dependency-graph FILE- at exit, print a DOT-format ancestor/dependency graph toFILEor stdout (-).
Advanced options
Section titled “Advanced options”--print-platform-ids- print platform-specific ids that affect cache ids.--print-config- print configuration and exit.--wait-trace-store- when multiple builds run in the same directory, wait for the trace store to become available (nothing printed while waiting).-f FILE- a package search start file: the directory ofFILEis implicitly added with-I DIR, and ancestor directory names form a package id for forms without one.-p PACKAGE,--package PACKAGE- the package for forms without explicit package ids [default: inferred from parent directories].--long- use long identifiers to avoid collisions (on Windows, enable long paths first).