rux build
Purpose
Build the current package
Synopsis
rux build [options]
Behavior
Builds the normal package artifact and may additionally write inspection output selected by repeatable or comma-separated --emit. --debug and --release are mutually exclusive. Frontend target selection is supported, but linking a foreign target is rejected until that backend is available end to end. A build that is not up to date compiles only the source files that changed, on one thread per logical core unless --jobs caps them; the artifact is the same for every --jobs value. --disable-pass switches off one optional optimization pass for diagnosis, and an unknown or inactive pass name is rejected.
Executable, SharedLibrary, and StaticLibrary packages build their conventional native artifact. A Windows SharedLibrary additionally writes its .lib import library. SourceLibrary packages can be checked but cannot be built directly.
--emit values
| Kind | Additional output |
|---|---|
tokens | Token streams in Temp/Tokens/ |
ast | Parsed syntax trees in Temp/Ast/ |
sema | Semantic-analysis dump in Temp/Sema/sema.txt |
hir | High-level IR in Temp/Hir/hir.txt |
lir | Low-level IR in Temp/Lir/lir.txt |
passes | The HIR and LIR before and after each optimization pass, in a directory per invocation under Temp/Optimization/ |
asm | Target assembly in Temp/Asm/ |
rcu | RCU objects in Temp/Obj/ and text dumps in Temp/Rcu/ |
symbols | Section headers and a .symtab in an ELF image, so profilers such as perf name Rux functions; PE and Mach-O images ignore it |
The option is repeatable and accepts comma-separated values, so --emit ast --emit sema and --emit ast,sema are equivalent.
Arguments
This command accepts no operands.
Options
| Option | Description |
|---|---|
--all | Build all 16 target/profile cells; incompatible with --target, --debug, --release, --emit, and --disable-pass |
--debug | Build with debug symbols (unoptimized output) |
--define <name[=value]> | Set or override a config compile-time value |
--disable-pass <name> | Disable an optional optimization pass for diagnosis; repeat for multiple passes |
--emit <kind[,kind...]> | Additionally emit tokens, ast, sema, hir, lir, passes, asm, or rcu inspection output, or image symbols |
--jobs <N> | Compile on up to N threads (default: one per logical core); the output is the same for every N |
--no-cache | Compile even when an earlier build of the same inputs is still up to date |
--release | Build with release profile (optimized, no debug info) |
--stats | Print build timing, source, optimization, and performance statistics |
--target <triple> | Build for the specified target platform (e.g. linux-x86_64, linux-aarch64) |
-q, --quiet | Suppress non-essential output (only errors are shown) |
-v, --verbose | Enable verbose output for detailed build information |
Global options may appear before or after the command. See Global options.
Output and exit status
The artifact is written below configured [Build].Output using the selected profile. Inspection output is written below Temp/ and does not replace the normal artifact. A successful build records what it read under Temp/Cache, and the next identical build reuses the artifact when nothing changed, reporting (up to date); --no-cache always compiles.
Success exits 0, invalid command-line usage exits 2, and compiler, validation, filesystem, network, or generation failures exit 1 unless stated otherwise above.
Examples
rux build
rux build --all --stats
rux build --debug
rux build --release --target linux-x86_64
rux build --stats
rux build --verbose --release
rux build --emit ast,sema
Environment variables
SOURCE_DATE_EPOCH fixes compiler timestamps for reproducible builds.
The global color environment behavior is described under Global options.