.github/skills/build/SKILL.md
Guide for building, formatting, linting, and spell-checking Nanvix with z. Use this when asked to build or validate the repository.
npx skillsauth add nanvix/nanvix buildInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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, hyperlight | microvm |
| TARGET | x86 | x86 |
| RELEASE | yes, no | no |
| LOG_LEVEL | trace, debug, | error |
| | info, warn, | |
| | error, panic | |
| PROFILER | yes, no | no |
| DEPLOYMENT_MODE| standalone, | multi-process |
| | single-process, | |
| | multi-process, l2 | |
Example with custom parameters:
./z build -- all MACHINE=hyperlight \
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).testing
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.
development
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.
development
Guide for diagnosing Nanvix build, runtime, and test failures, including cleanup and debugging workflows. Use this when asked to investigate errors or unstable behavior.
testing
Guide for running Nanvix tests with z. Use this when asked to run unit tests, integration tests, or the full test suite.