Skip to content

[python] Migrate distribution to Nanvix SDK#319

Merged
ppenna merged 1 commit into
mainfrom
migration/nanvix-sdk
Jul 12, 2026
Merged

[python] Migrate distribution to Nanvix SDK#319
ppenna merged 1 commit into
mainfrom
migration/nanvix-sdk

Conversation

@ppenna

@ppenna ppenna commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • consume the exact SDK-built CPython 3.12.3 release resolved by zutils
  • use the verified Nanvix SDK digest and its host Python 3.12 for deterministic bytecode
  • keep downloaded Nanvix artifacts runtime-only and remove runtime linker-script assumptions
  • preserve bytecode-only ramfs, cold/warm start, Linux/Windows release, and package flows
  • target Nanvix v0.20.0 microvm standalone at 256mb

Local validation

  • clean setup/build with exact CPython dependency
  • 113 functional tests and final smoke test
  • benchmark
  • SDK bytecode magic and ramfs policy checks
  • Python formatting and strict type checks
  • shell checks
  • release tar/zip and Windows CPython bundle validation

Consume the SDK-built CPython release, generate bytecode with the pinned SDK, and keep Nanvix downloads runtime-only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3a354ddf-0f65-44b2-a2cb-81d4662a3587
Copilot AI review requested due to automatic review settings July 12, 2026 20:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the nanvix-python distribution flow to consume an SDK-built CPython 3.12.3 artifact resolved by zutils, pinning the Nanvix SDK image digest to make bytecode generation deterministic and aligning bundle/runtime docs and CI around the microvm standalone 256 MB target.

Changes:

  • Switch setup to reuse cached zutils-resolved CPython artifacts and extract only runtime files into the sysroot.
  • Move bytecode generation to the pinned nanvix-sdk-c-clang container and standardize temp/log directories under ignored test output.
  • Update docs, quick-start instructions, and CI to the microvm standalone 256 MB distribution and pinned SDK digest.
Show a summary per file
File Description
scripts/get-nanvix-python.sh Updates quick-start extraction/run instructions for the microvm standalone bundle.
README.md Updates prerequisites and setup command to use pinned SDK image for bytecode generation.
doc/release.md Updates release output directory, bundle layout, and run instructions for standalone microvm.
doc/contributing.md Updates contributor workflow to reference new SDK setup flow and CI scope.
doc/ci.md Updates CI description/matrix to microvm standalone 256 MB and SDK-based bytecode flow.
doc/building.md Updates build guide to SDK-built CPython dependency and pinned SDK image usage.
.nanvix/src/test.py Updates smoke/functional test logging/temp handling and adjusts precompile behavior by mode.
.nanvix/src/setup.py Reworks CPython installation to extract from cached dependency artifacts with safer extraction.
.nanvix/src/lib.py Introduces shared SDK image constant and centralized temp/log directory helpers; adjusts sysroot requirements.
.nanvix/src/build.py Switches .pyc generation to pinned SDK container and refactors precompile pipeline options.
.nanvix/src/benchmark.py Updates benchmark temp/log directory handling via shared helpers.
.nanvix/nanvix.toml Bumps nanvix-version to 0.20.0 and constrains build matrix to microvm standalone 256 MB.
.github/workflows/ci.yml Pins CI docker image to the nanvix-sdk-c-clang digest.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 13/13 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment thread .nanvix/src/setup.py
Comment on lines +66 to +72
candidates = [
path
for path in cache_dir.iterdir()
if path.is_file()
and path.name.startswith(prefix)
and path.name.endswith((".tar.bz2", ".tar.gz", ".zip"))
]
Comment thread .nanvix/src/build.py
Comment on lines 315 to 318
# Remove native/build source from site-packages
for ext in ("*.pyx", "*.pxd", "*.c", "*.h", "*.cpp"):
for f in site_pkg.rglob(ext):
for f in pylib.rglob(ext):
f.unlink(missing_ok=True)
Comment thread .nanvix/src/test.py
Comment on lines +365 to 369
# Standalone tests consume the bytecode-only ramfs produced by build.
# Other modes need an opt-0 cache beside the source tree.
if self.config.deployment_mode != "standalone":
self._precompile_pyc(sysroot, legacy=False, strip_sources=False)

@ppenna ppenna merged commit be4aede into main Jul 12, 2026
13 checks passed
@ppenna ppenna deleted the migration/nanvix-sdk branch July 12, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants