mit einem Klick
build
// Guide for building, formatting, linting, and spell-checking Nanvix with z. Use this when asked to build or validate the repository.
// Guide for building, formatting, linting, and spell-checking Nanvix with z. Use this when asked to build or validate the repository.
| name | build |
| description | Guide for building, formatting, linting, and spell-checking Nanvix with z. Use this when asked to build or validate the repository. |
Use this skill when the user asks to build, compile, format, lint, or spell-check Nanvix. This
covers all build-system operations exposed through the z utility.
doc/setup.md.toolchain/).doc/setup.md for details.Before building on Windows, ensure:
Enable-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform -All, then reboot).winget install ezwinports.make).winget install Rustlang.Rustup.git clone -c core.symlinks=true../z.ps1 setup.z utility)# Build everything with the local toolchain.
./z build -- all
# Kernel only.
./z build -- kernel
# Nanvixd only.
./z build -- all-nanvixd
# UserVM only.
./z build -- all-uservm
Set these as environment variables or pass them after -- in the z command:
| Parameter | Values | Default |
|---|---|---|
MACHINE | microvm | microvm |
TARGET | x86 | x86 |
RELEASE | yes, no | no |
LOG_LEVEL | trace, debug, | error |
info, warn, | ||
error, panic | ||
PROFILER | yes, no | no |
DEPLOYMENT_MODE | standalone, | standalone |
single-process, | ||
multi-process, l2 |
Example with custom parameters:
./z build -- all RELEASE=yes LOG_LEVEL=error
# Default debug build.
./z build -- all
# Release build.
./z build -- all RELEASE=yes LOG_LEVEL=panic
# For echo-breakdown benchmark.
./z build -- all RELEASE=yes LOG_LEVEL=panic TIMESTAMP_MSG=yes
z.ps1)On Windows 11, the z.ps1 PowerShell script provides the same CLI interface. Guest components are
cross-compiled using a local toolchain; host binaries (nanvixd, uservm) are built natively with the
microvm backend (WHP on Windows).
# Build everything (guest via make + host binaries natively).
.\z.ps1 build -- all
# Build only the UserVM (native Windows build).
.\z.ps1 build -- uservm
# Build only nanvixd (native Windows build).
.\z.ps1 build -- nanvixd
# Build only nanvix-bench (native Windows build).
.\z.ps1 build -- nanvix-bench
# Build only guest components (kernel + hello-rust-nostd).
.\z.ps1 build -- guest
# Release build.
.\z.ps1 build -- all RELEASE=yes
Any unrecognized target is forwarded to make, just like on Linux:
.\z.ps1 build -- kernel
.\z.ps1 build -- format-check
.\z.ps1 build -- lint-check
# Check formatting issues.
./z build -- format-check
# Auto-fix formatting issues.
./z build -- format
# Check linting issues.
./z build -- lint-check
# Auto-fix linting issues.
./z build -- lint
# Check spelling errors.
./z build -- spellcheck
# Fix spelling errors.
./z build -- spellcheck-fix
Nanvix uses Verus for formal verification of selected kernel crates. The expected Verus version is pinned in build/verus-version. Verification requires VERUS_EXECUTABLE_DIR to be set; when unset, make verify is a no-op.
# Install verus and run verification.
./scripts/setup/verus.sh ~/toolchain/verus
./z build -- verify VERUS_EXECUTABLE_DIR=~/toolchain/verus
# Verify a single crate.
./z build -- verify-bitmap VERUS_EXECUTABLE_DIR=~/toolchain/verus
VERUS_EXECUTABLE_DIR to the directory containing the verus binary.scripts/setup/verus.sh <dir> to download the pinned release.vstd crate version in Cargo.toml is exact-pinned (=) to match the Verus binary../z clean # Clean build artifacts.
./z distclean # Remove all generated files.
.\z.ps1 clean # Quick clean (UserVM artifacts + cache).
.\z.ps1 distclean # Full clean (cargo clean + all artifacts).
# Run the full CI pipeline locally.
./scripts/pipeline.sh
The pipeline covers: spell checking, formatting, linting, building, and testing across multiple machine and deployment configurations.
Use the host-specific settings template. The Linux template invokes ./z, while the Windows
template routes Rust Analyzer through ./z.bat build -- check, which runs native cargo check
on host crates (uservm, nanvixd, nanvix-test, mkramfs).
Linux:
mkdir -p .vscode && cd .vscode
ln -s ../scripts/setup/vscode/settings-linux.json settings.json
Windows (PowerShell):
New-Item -ItemType Directory -Path .vscode -Force
Copy-Item scripts\setup\vscode\settings-windows.json .vscode\settings.json
Note: The
checktarget inz.ps1only checks host crates natively. Guest and kernel crates require the cross-compilation toolchain. Run.\z.ps1 build -- check-kernel check-guest-binariesfor a full cross-target check.
toolchain/ symlink points to a valid toolchain../z help for usage information..\z.ps1 help for Windows-specific usage information.Get-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform).Guide for Nanvix CI and GitHub Actions workflow behavior, including local pipeline execution and matrix coverage. Use this when asked about CI checks, workflow failures, or release flow.
Guide for developing, building, and running Nanvix user-space applications across supported runtimes and languages. Use this when asked about guest app implementation or execution.
Guide for creating and modifying Nanvix libraries under src/libs, including guest no_std and host std crates. Use this when asked about library architecture or crate changes.
Guide for developing and debugging Nanvix daemons, including guest daemons and host linuxd behavior. Use this when asked about daemon architecture or daemon changes.
Guide for modifying and debugging the Nanvix kernel architecture and kernel-call paths. Use this when asked about kernel internals or kernel implementation changes.
Guide for writing, running, and debugging Nanvix unit, integration, and system tests in Rust and C/C++. Use this when asked about test implementation or failures.