Skip to content

Commit eccca45

Browse files
ppennaCopilot
andcommitted
nvx-rs: declare 0.2.0-alpha.1, the breaking release, and its changelog
The breaking release of #1076 must declare its version and record what it breaks (#1132). crates.io holds 0.1.0-alpha.1 to 0.1.0-alpha.16, and dev's nightly runs take the next number of the 0.1.0-alpha series whenever the crate changes there, until this work reaches dev. The crate now declares 0.2.0-alpha.1, the first version of a series that nothing has published, which doc/distribution.md describes for a new series: the full run of dev that first packs this commit publishes exactly that version, whatever numbers the nightlies took meanwhile, and a requirement such as nvx = "0.1.0-alpha.7", which Cargo also resolves to later 0.1.0 pre-releases, never resolves to it. The new root CHANGELOG.md records the release in one entry, which lists its breaking changes and links doc/migrate-from-alpha.7.md for the details. doc/distribution.md names the two series. Tests: ChangelogTests keeps the changelog's newest entry equal to the version that nvx-rs/Cargo.toml declares, so a pull request that starts another series adds its entry. Part of #1132 (SL8.1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 21018ae commit eccca45

5 files changed

Lines changed: 73 additions & 9 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Changelog
2+
3+
This file lists NVX's breaking releases: those of the
4+
[`nvx` crate](nvx-rs/README.md), with the guest artifacts of the same commit.
5+
CI publishes the crate's other versions every night, as
6+
[crates.io releases](doc/ci.md#cratesio-releases) describes.
7+
8+
## 0.2.0-alpha.1
9+
10+
`nvx` becomes a library of mechanisms and value types for microVMs, on which
11+
NVX's own programs and other users build
12+
([microsoft/nvx#1076](https://github.com/microsoft/nvx/issues/1076)). The
13+
release is not backward compatible: users that need `0.1.0-alpha.7` stay on it.
14+
[Migrating from alpha.7](doc/migrate-from-alpha.7.md) maps each removed or
15+
changed item to its replacement, or to what its caller now does.
16+
17+
### Breaking changes
18+
19+
- **No durable state.** The sandbox and template stores, the instance layer and
20+
the supervisor are gone from `nvx::host`. A caller keeps its own state from the
21+
values that `nvx::host::vm` returns.
22+
- **One launch.** The old configurations and launch paths, such as
23+
`LaunchSpec`, `SandboxPlan` and `ClonePlan`, are gone: `nvx::host::vm::create`
24+
takes a `VmConfig` and, for a restore, a `Snapshot`.
25+
- **No exec.** The exec engine, `nvx::exec`, and the guest's process modules,
26+
`nvx::guest::{exec, spawn, process, cgroup, entry}`, are gone. A guest's init
27+
runs its executions itself.
28+
- **The guest's space is private.** nvx-init's space, `nvx::guest::{root, gpt}`
29+
and the mapper of `nvx::guest::mappings`, is private to `nvx`.
30+
`resolve_guest_path` is gone, and `ExportPlan` holds paths only.
31+
- **NVXC is private.** NVX's own protocol is private to `nvx`, and speaks only
32+
version 2: version 1 and its `FEATURES` request are gone.
33+
- **Errors.** `ErrorCode` and `Error`'s constructors are private: callers tell
34+
errors apart by their `ErrorKind`.
35+
- **NVX's programs are private.** Each binary calls a hidden `main`, which is all
36+
that the programs add to the public API. Artifact discovery (`nvx::Artifacts`),
37+
image staging, the control session and the platform layer are private to them.
38+
- **Features.** The `bundled` feature is gone, with its build script.
39+
- **Fresh state.** The CLI reads a sandbox's configuration only in format 10,
40+
which requires `export_pins`: deprovision each sandbox that an earlier build
41+
provisioned, and provision it again. Nothing reads alpha.7's records, keys or
42+
snapshots, so a deploy captures its snapshots again.
43+
- **The guest's `/init`** fails closed on OpenVMM's workload identity: a command
44+
line with `nvx_workload_uid=` or `nvx_workload_gid=` boots only when
45+
`nvx_identity=` names the same UID and GID.
46+
- **The guest kernel** no longer sets `CONFIG_MAGIC_SYSRQ`.

‎doc/distribution.md‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,18 @@ released first-parent ancestor.
154154
## The nvx crate
155155

156156
[`nvx-rs/`](../nvx-rs/README.md) is also published on crates.io as the `nvx`
157-
crate, a preview whose versions are pre-releases, `0.1.0-alpha.N`, which Cargo
158-
selects only for a requirement that names a pre-release. The nightly CI run
159-
publishes a new version from `dev` whenever the crate changed, with the next
160-
number, as [crates.io releases](ci.md#cratesio-releases) describes, so a
161-
change reaches crates.io within a day of its merge.
157+
crate, a preview whose versions are pre-releases, which Cargo selects only for
158+
a requirement that names a pre-release: `0.2.0-alpha.N` since the breaking
159+
release that the [changelog](../CHANGELOG.md) records, and `0.1.0-alpha.N`
160+
before it. The nightly CI run publishes a new version from `dev` whenever the
161+
crate changed, with the next number, as
162+
[crates.io releases](ci.md#cratesio-releases) describes, so a change reaches
163+
crates.io within a day of its merge.
162164

163165
The version that `nvx-rs/Cargo.toml` declares is the lowest that CI
164-
publishes. A pull request changes it to start another series, such as
165-
`0.2.0-alpha.1`. Only `nvx`'s version changes in `nvx-rs/Cargo.lock`.
166+
publishes. A pull request changes it to start another series, as the breaking
167+
release started `0.2.0-alpha.1`. Only `nvx`'s version changes in
168+
`nvx-rs/Cargo.lock`.
166169

167170
When CI cannot publish, as when the newest version on crates.io records no
168171
commit that `dev` holds, a pull request declares the next version as above,

‎nvx-rs/Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎nvx-rs/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nvx"
3-
version = "0.1.0-alpha.3"
3+
version = "0.2.0-alpha.1"
44
edition = "2024"
55
rust-version = "1.89"
66
description = "NVX mechanics: the OpenVMM control protocol and the launch, policy lowering, and supervision of NVX microVMs"

‎scripts/test_crate_release.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,21 @@ def test_publish_checks_what_crates_io_serves(self):
14341434
self.publish()
14351435

14361436

1437+
class ChangelogTests(unittest.TestCase):
1438+
def test_the_newest_entry_is_the_series_that_the_crate_declares(self):
1439+
# CHANGELOG.md lists the breaking releases, each the first version of
1440+
# the series whose floor nvx-rs/Cargo.toml then declares, so a pull
1441+
# request that starts another series adds its entry.
1442+
root = BuildConstants.REPO_ROOT
1443+
manifest = crate_release.read_manifest(
1444+
(root / "nvx-rs" / "Cargo.toml").read_bytes(), "nvx-rs/Cargo.toml"
1445+
)
1446+
entries = re.findall(
1447+
r"(?m)^## (\S+)$", (root / "CHANGELOG.md").read_text(encoding="utf-8")
1448+
)
1449+
self.assertEqual(entries[:1], [str(manifest.version)])
1450+
1451+
14371452
class CommandLineTests(unittest.TestCase):
14381453
def test_runs_the_step_on_the_crate(self):
14391454
with (

0 commit comments

Comments
 (0)