[python] Migrate distribution to Nanvix SDK#319
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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-clangcontainer 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 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 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 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) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Local validation