acton build
Reference manual for the acton build command
Synopsis
acton build [options] [contract-name]
Description
Compile contracts declared in Acton.toml, resolve their dependencies, and
write build artifacts for the requested build set.
By default, acton build compiles every configured contract. If you pass a
_contract-name_, Acton builds only that contract and its transitive
dependencies.
For each successful build, Acton writes a JSON artifact to the build output
directory and a contract ABI JSON file to the ABI output directory. When the contract config has an
output path, Acton also writes the compiled .boc file there. Dependency
helper files are emitted into the generated-code directory, and optional Fift
output can be written separately.
Contracts with .boc sources are treated as precompiled inputs: Acton loads
their code, includes them in dependency resolution, and skips recompilation.
If the project has no [contracts] section or the section is empty, the
command prints guidance and exits without compiling anything.
Options
Build Options
Build only the specified contract and its transitive dependencies.
The value must match a [contracts.<name>] key in Acton.toml.
Clear the project compilation cache before building.
Write the dependency graph for the requested build set as a DOT file.
Directory for generated JSON build artifacts.
[build].out-dir when configured, otherwise build/.
Directory for generated dependency helper files such as
gen/<dependency>.code.tolk.
[build].gen-dir when configured, otherwise gen/.
Directory for contract ABI JSON files.
[build].output-abi when configured, otherwise build/abi/.
Directory for compiled Fift output for .tolk contracts.
[build].output-fift when configured. If neither the flag nor the
config value is set, Acton does not write .fif files.
Print compiled code and hash information for each successfully built contract.
Display Options
Control when to use colored output.
auto, always, never
Project Options
Path to the Acton.toml file to load for this invocation.
Use this when running acton build outside the project directory or when the
manifest lives at a non-default location.
Path to the project root to use for configuration discovery, cache storage, and default relative output paths.
This conflicts with --manifest-path.
Configuration
acton build reads contracts from Acton.toml:
[contracts.Wallet]
display-name = "Wallet Contract"
src = "contracts/Wallet.tolk"
output = "Wallet.boc"
depends = ["Child"]Optional default output paths can be configured in [build]:
[build]
out-dir = "build"
gen-dir = "gen"
output-abi = "build/abi"
output-fift = "build/fift"CLI flags override config values for the current invocation.
For dependency helpers, a per-dependency depends[].path still overrides the
resolved gen-dir for that helper file.
Outputs
Depending on command flags and project configuration, acton build may write:
<out-dir>/<contract-name>.jsonwithcode_boc64andhash<output-abi>/<contract-name>.jsonwith the compiler ABI for.tolkcontracts that declare ABI metadata- the configured contract
output.bocfile <gen-dir>/<dependency>.code.tolkhelper files for dependencies by default (or a dependency-specific custom path whendepends[].pathis configured)<output-fift>/<contract-name>.fiffor compiled.tolkcontracts- a DOT dependency graph file when
--graphis passed
Existing output files at those paths are replaced with freshly generated artifacts.
Best-Effort Behavior
Dependency-graph failures such as missing contracts or circular dependencies stop the command before the main compile loop starts, so those failures do not produce partial build outputs.
After dependency resolution succeeds, acton build becomes best-effort:
- compile failures for one contract are recorded while other eligible contracts continue building
- artifact-writing failures are also collected instead of aborting immediately
- artifacts that were written successfully before a later failure remain on disk
If an earlier dependency failed, its generated helper file is not produced. A later parent contract may then fail because its generated import is missing.
When you build a specific _contract-name_, Acton limits the build set to that
contract and its transitive dependencies.
Side Effects
acton build writes artifacts, cache entries, and optional graph output under
the resolved project root. If one contract fails after earlier contracts were
built successfully, the successful artifacts remain on disk.
Before compiling, acton build normally refreshes the bundled standard library
under .acton/. Set ACTON_DISABLE_AUTO_STDLIB=1 to skip that automatic
refresh for the current process.
Exit Status
0: The command completed without compilation failures.1: The command failed because compilation, artifact writing, or dependency resolution failed for at least one requested contract.
Examples
-
Build every configured contract:
acton build -
Build one contract and its dependencies:
acton build Wallet -
Rebuild with a cleared cache:
acton build --clear-cache -
Write a dependency graph:
acton build --graph deps.dot -
Override output locations for a single run:
acton build --out-dir artifacts --gen-dir artifacts/gen --output-abi artifacts/abi --output-fift artifacts/fift -
Print compiled code and hashes after the build:
acton build --info
See Also
acton help wrapper- Build system configuration reference
- Acton.toml reference
Last updated on