package stages a release directory, dist/<version> by default, from the
built OpenVMM binary, nvx executable, and guest artifacts.
Release packages lists the artifacts and
provenance it requires, the executables of each platform's package, and the
binary release layout. Every package is either binary-only or
source-inclusive, and you must choose one.
Every package ships the release build of nvx, the Rust command-line
interface that runs NVX's microVMs and sandboxes (Usage):
bin/nvx, a
static x86_64-unknown-linux-musl executable, in the Linux packages, and
bin/nvx.exe, an x86_64-pc-windows-msvc executable with a static C
runtime, in the Windows package. provenance/nvx.provenance.json binds it
to the digest of the nvx sources that built it, the Rust release, the
target, and the cli feature, and the packaged SOURCE-MANIFEST.json records
the same in its nvx section with the executable's SHA-256. package
requires nvx/target/release/nvx[.exe] and its provenance in build/,
which must describe it as such a build of the checkout's sources; see
record-nvx-provenance.
Stage a binary release and SHA-256 manifest:
python3 scripts/nvx.py package --binary-onlyBinary-only mode requires an explicit acknowledgement because the matching Linux, Alpine, Ubuntu, and Azure Linux source must be published separately.
First materialize the release sources:
python3 scripts/nvx.py collect-sourcescollect-sources reads the package manifests of the built guest artifacts, so
run build-guest --guest all first. It requires the kernel, Alpine, and Ubuntu
artifacts, but not the Azure Linux ones. It also needs Docker with the Linux
engine, which fetches and verifies the Alpine upstream sources in an Alpine
container and builds the Linux source archive, and gpgv, which authenticates
the Ubuntu source indexes.
This produces a patched Linux corresponding-source archive under
build/sources/linux, exact Alpine recipes/upstream sources under
build/sources/alpine, and exact Ubuntu .dsc plus referenced source members
under build/sources/ubuntu. Then stage the binary release with four separate
source artifacts:
python3 scripts/nvx.py package --include-sourceThe release contains:
source/nvx-project-source-0.1.0.tar.gz
source/nvx-linux-source-6.18.38.tar.gz
source/nvx-alpine-source-0.1.0.tar.gz
source/nvx-ubuntu-source-0.1.0.tar.gz
collect-sources does not collect Azure Linux corresponding source, so
--include-source omits initramfs-azurelinux.cpio.gz and its package
manifest from the staged release and from the packaged SOURCE-MANIFEST.json.
Distribute the Azure Linux guest only from a binary-only package while its
corresponding source is published separately.
Linux is GPL-2.0-only, so a distributor of vmlinux must make its complete
corresponding source available. Alpine packages retain their individual
licenses. The collector uses the exact aports commit embedded in every
installed APK and runs abuild fetch plus abuild verify. Its manifest lists
the executable recipe files, and the Alpine source archive takes its file modes
from that list rather than from the collecting host, which may not store them.
Ubuntu artifacts use Ubuntu userland with the NVX kernel. The collector
deduplicates exact source package name/version pairs from both Ubuntu
manifests, downloads the matching .dsc and source members from Canonical's
archive, verifies each source index through its signed InRelease file and the
pinned Ubuntu archive keyring, and then verifies the indexed SHA-256 metadata
before packaging. Source collection and release staging also require each
Ubuntu artifact to match the artifact name and SHA-256 embedded in its companion
manifest. Exact versions that have left the live suite indexes are located
through Canonical's Launchpad publishing history and resolved from a signed
historical snapshot.ubuntu.com index. The signed release metadata, keyring,
and raw Launchpad responses are retained with their URLs and SHA-256 digests.
Newer source versions are never substituted.
OpenVMM is MIT licensed: retain its notice, but its source does not have to be
published merely because it is aggregated with Linux. See
THIRD_PARTY_NOTICES.md.
The nvx executables and the guest binaries are MIT licensed NVX code,
built from the nvx package, that statically links the Rust standard library
and permissively licensed crates, with musl and LLVM's libunwind on Linux and
the Microsoft C runtime on Windows. THIRD_PARTY_NOTICES.md lists each with
its license; nvx/Cargo.lock pins every crate by checksum. See
The nvx package for the license inputs and the
tests that keep the notices in step with the lockfile.
Turn a staged release directory into one deterministic archive:
python3 scripts/nvx.py archive-release \
--source dist/0.1.0 \
--destination dist/nvx-0.1.0.tar.gzarchive-release checks the staged files against their SHA256SUMS before
it writes a .tar.gz or .zip archive outside the staged directory; see
archive-release. SHA256SUMS lists every
packaged file, bin/nvx[.exe] and its provenance included, and every
archive marks the executables in bin/ executable.
download of nvx verifies the package against its
SHA256SUMS and installs OpenVMM, the guest artifacts, including the sandbox
scratch template when the package declares it, and their provenance into the
checkout, everything or nothing. It leaves the checkout's nvx,
which Cargo builds, alone, and so installs releases from before packages
shipped nvx too. It warns when a release, such as that of an ancestor,
declares other OpenVMM contracts than the nvx that installs it speaks,
such as another microVM ABI, time ABI, restore packet, or control contract,
and names each field of its manifest that differs.
CI follows the binary-only path. A package job for each of the linux-kvm,
linux-mshv, and windows-whp platforms stages
dist/nvx-<version>-<platform> with --binary-only, with the nvx and
provenance that the nvx build job of the platform's operating system built
and its NVX CLI job tested, and archives it as .tar.gz on Linux and .zip on
Windows; Release packages describes the jobs and
when they run. Only dev pushes upload the archives, so pull requests, merge
groups, and full runs prove that their packages build without publishing them.
The development release job checks that each package ships OpenVMM and
nvx before it publishes them.
Continuous integration describes the jobs that gate and publish the
resulting development release.
A documentation-only push, in which every changed path is under doc/ or ends
in .md, skips the platform and package jobs, as
Change classification describes. Such a commit
gets no packages and no development release, so
nvx download installs the package of its nearest
released first-parent ancestor.
nvx/ is also published on crates.io as the nvx
crate, a preview whose versions are pre-releases, which Cargo selects only for
a requirement that names a pre-release: 0.2.0-alpha.N since the breaking
release that the changelog records, and 0.1.0-alpha.N
before it. The nightly CI run publishes a new version from dev whenever the
crate changed, with the next number, as
crates.io releases describes, so a change reaches
crates.io within a day of its merge. The crate holds the files that Git tracks
in nvx/, among them the package's license, LICENSE, its README, and its
lockfile, Cargo.lock; its features, profiles, and binaries are those that
The nvx package lists.
The version that nvx/Cargo.toml declares is the lowest that CI
publishes. A pull request changes it to start another series, as the breaking
release started 0.2.0-alpha.1. Only nvx's version changes in
nvx/Cargo.lock.
When CI cannot publish, as when the newest version on crates.io records no
commit that dev holds, or a directory that its commit lacks, a pull request
declares the next version as above, and once it merges, a crate owner
publishes that version from a fresh clone of dev, which needs no submodule:
git clone --branch dev https://github.com/microsoft/nvx.git nvx-crate
cd nvx-crate/nvx
git ls-files --eol . | grep -E 'w/(crlf|mixed)' # prints nothing
cargo publish --locked --dry-run
cargo publish --lockedcargo publish packs the files of the working tree, refuses uncommitted
changes, and records the commit in the package's .cargo_vcs_info.json, but
Git does not count line endings as changes. .gitattributes checks nvx/
out with LF line endings on every platform, whatever core.autocrlf says,
since microsoft/nvx#764. A clone
that checked its files out with CRLF line endings before then keeps them until
it checks them out again, and packs them: 0.1.0-alpha.2 came from such a
clone, so its sources differ from the commit that it records. A fresh clone
packs the bytes of its commit, which the git ls-files check confirms.
The crate's guest feature builds NVX's guest programs, the ten nvx-*
binaries that NVX's guest images install under /sbin, and its guest
profile builds them small and stripped. A guest image that NVX does not build
installs them from the crate with cargo install, which builds the crate as
the root of its build, so that the crate's guest profile applies. On a Linux
host, with Rust 1.89 or later, the x86_64-unknown-linux-musl target, and a C
compiler driver, cc, this installs the announcer of the portable network,
nvx-ingress, as the static executable that NVX's images hold:
rustup target add x86_64-unknown-linux-musl
cargo install nvx --version VERSION --locked \
--no-default-features --features guest --profile guest \
--target x86_64-unknown-linux-musl --bin nvx-ingress--version VERSIONnames a version that crates.io publishes, such as0.2.0-alpha.1, the breaking release, or a later0.2.0-alpha.N. Every version is a pre-release, which Cargo selects only for a requirement that names one, socargo install nvxwithout it finds none.--no-default-features --features guestbuilds the guest programs without the defaulthostfeature, which no guest program uses.--profile guestbuilds them with the crate'sguestprofile, wherecargo installwould otherwise userelease.--lockedbuilds the dependency versions that the crate's lockfile pins, as NVX's own builds do.--target x86_64-unknown-linux-musllinks them statically, so that they need no C library in the guest. Without it, Cargo builds them for the host's own target, such asx86_64-unknown-linux-gnu, whose executables need the host's C library and dynamic loader.
Repeat --bin for each program, or pass --bins for all ten. Cargo installs
them in its own bin directory, or in DIRECTORY/bin with
--root DIRECTORY. Each program's command line, exit statuses, and output are
compatibility contracts, which
Guest binaries lists.