2026-01-08 09:55:37 +00:00
|
|
|
# Build System
|
|
|
|
|
|
|
|
|
|
**Purpose**: Core build tools for compiling Rust components and bundling Nushell libraries.
|
|
|
|
|
|
|
|
|
|
## Tools
|
|
|
|
|
|
|
|
|
|
### Compilation
|
|
|
|
|
|
|
|
|
|
- **`compile-platform.nu`** - Compile Rust orchestrator, control-center, and MCP server
|
2026-01-12 04:43:06 +00:00
|
|
|
- Multi-platform cross-compilation
|
|
|
|
|
- Release/debug build modes
|
|
|
|
|
- Feature flag management
|
|
|
|
|
- Output to `dist/platform/`
|
2026-01-08 09:55:37 +00:00
|
|
|
|
|
|
|
|
### Bundling
|
|
|
|
|
|
|
|
|
|
- **`bundle-core.nu`** - Bundle Nushell core libraries and CLI
|
2026-01-12 04:43:06 +00:00
|
|
|
- Package provisioning CLI wrapper
|
|
|
|
|
- Core library bundling (lib_provisioning)
|
|
|
|
|
- Configuration system packaging
|
|
|
|
|
- Validation and syntax checking
|
|
|
|
|
- Optional compression (gzip)
|
|
|
|
|
- Output to `dist/core/`
|
2026-01-08 09:55:37 +00:00
|
|
|
|
|
|
|
|
### Validation
|
|
|
|
|
|
|
|
|
|
- **`check-system.nu`** - Validate build environment
|
2026-01-12 04:43:06 +00:00
|
|
|
- Check required tools (Rust, Nushell, Nickel)
|
|
|
|
|
- Verify dependencies
|
|
|
|
|
- Validate configuration
|
2026-01-08 09:55:37 +00:00
|
|
|
|
|
|
|
|
## Build Process
|
|
|
|
|
|
|
|
|
|
Complete build pipeline:
|
|
|
|
|
|
2026-01-14 02:59:52 +00:00
|
|
|
```
|
2026-01-08 09:55:37 +00:00
|
|
|
just build-all # Platform + core
|
|
|
|
|
just build-platform # Rust binaries only
|
|
|
|
|
just build-core # Nushell libraries only
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Build with validation:
|
|
|
|
|
|
2026-01-14 02:59:52 +00:00
|
|
|
```
|
2026-01-08 09:55:37 +00:00
|
|
|
just build-core --validate # Validate Nushell syntax
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Debug build:
|
|
|
|
|
|
2026-01-14 02:59:52 +00:00
|
|
|
```
|
2026-01-08 09:55:37 +00:00
|
|
|
just build-debug # Build with debug symbols
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Output
|
|
|
|
|
|
|
|
|
|
Build outputs go to `dist/`:
|
|
|
|
|
|
|
|
|
|
- `dist/platform/` - Compiled Rust binaries
|
|
|
|
|
- `dist/core/` - Nushell libraries and CLI
|
|
|
|
|
- `dist/config/` - Configuration files
|
|
|
|
|
- `dist/core/bundle-metadata.json` - Build metadata
|
|
|
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
|
|
|
|
Each build tool follows Nushell 0.109+ standards:
|
|
|
|
|
|
|
|
|
|
- Immutable variable patterns
|
|
|
|
|
- Explicit external command prefixes (`^`)
|
|
|
|
|
- Error handling via `do { } | complete` pattern
|
|
|
|
|
- Comprehensive logging
|
|
|
|
|
|
|
|
|
|
## Related Files
|
|
|
|
|
|
|
|
|
|
- `provisioning/justfiles/build.just` - Build recipe definitions
|
|
|
|
|
- `provisioning/tools/distribution/` - Distribution generation using build outputs
|
|
|
|
|
- `provisioning/tools/package/` - Packaging compiled binaries
|