Repository navigation
nvx-rs: remove the CPython emulation in nvx::host::python #731
Copy link
Copy link
Open
Description
Goal
Once no test compares nvx-rs with recorded Python behavior, remove nvx::host::python, whose 5,199 lines emulate CPython 3.14 so that the ports kept Python's behavior byte for byte, and use Rust's own facilities with the behavior that #722 decided.
Tasks
| Module | Lines | Becomes |
|---|---|---|
golden.rs, unicode.rs, and mod.rs |
583 | Deleted, with tests/fixtures/python.json |
builtins.rs |
614 | Rust's quoting, an ASCII decimal parser with explicit ranges, and the separators of #723 for values that become kernel tokens |
json.rs |
872 | serde_json, refusing duplicate keys, with limits on depth and integer size |
dumps.rs |
212 | serde_json's pretty printer over sorted maps |
path.rs |
925 | std::path, with one specified function that makes a path absolute |
fs.rs and windows.rs |
1,195 | std::fs, and the file identities of nvx::host::platform |
text.rs |
287 | str, since paths that aren't valid Unicode, and unpaired surrogates, are refused |
uuid.rs |
98 | A canonical UUID parser, or the uuid crate (#646) |
value.rs |
292 | Typed serde structures of config.json formats 1 to 6 |
shell.rs |
121 | Kept, outside python, for the >> COMMAND line |
- Replace each module as the table says, and delete
nvx::host::python. - Simplify
nvx::host::cli::argsonce nvx.py: retire the sandbox and run commands in favor of nvx-rs #725 removes--progand the emulation ofargparse's layout. - Docs: remove the README's "Python parity" section, update its module table and its "Other differences from nvx.py" and Testing sections, and update
doc/project-structure.md. - After measuring the coverage gate below, retire the
nvx-rs coverageworkflow of nvx-rs: measure line, branch, and mutation coverage on Linux and Windows #726, whose last family of golden tests this step deletes: delete.github/workflows/nvx-rs-coverage.yml,scripts/nvx_rs_coverage.py, its tests, and the "nvx-rs coverage" section ofdoc/ci.md, and updatevalidate-nvx,doc/project-structure.md, and the README's Testing section. Keepnvx-rs-mutants.yml, moving its tests out ofscripts/test_nvx_rs_coverage.py, and keepnvx-rsandnvx-fake-openvmmreturning their exit statuses frommain, without which coverage builds write no profile on Windows.
Gate
- The lines and branches that only
python.jsonreaches, 6 and 12 on Windows, are reached by other tests or deleted. - The scenario tests of nvx-rs: replace the golden CLI scenarios with structured scenario tests #728 pass on Linux and Windows, and so do the tests of
aci_edge_sandboxesand of the runtime adapter intests/runtime-adapter/. - The crate still builds with its minimum supported Rust version.
Coordination
- nvx-rs: prepare the CLI's move onto the store and supervisor #675, for nvx-rs: share the VMM supervisor and the sandbox store #620, moves the CLI's lifecycle onto the sandbox store, and removes part of
fs.rsandwindows.rs.
Acceptance criteria
-
nvx::host::pythonandtests/fixtures/python.jsonare gone.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity