Skip to content

Use make_initrd for functional tests and update nanvix version#36

Merged
ppenna merged 1 commit into
nanvix/v2.12.9from
enhancement-update-nanvix
May 17, 2026
Merged

Use make_initrd for functional tests and update nanvix version#36
ppenna merged 1 commit into
nanvix/v2.12.9from
enhancement-update-nanvix

Conversation

@ppenna

@ppenna ppenna commented May 17, 2026

Copy link
Copy Markdown

Summary

Refactor the build script to fix breaking changes when bumping Nanvix to v0.13.19. In standalone mode, nanvixd now requires an initrd image that bundles the application binary with system daemons, rather than accepting a raw ELF path directly.

Changes

z.py

  • Remove subprocess usage; use self.run() with docker=False for all tool invocations (mkramfs, nanvixd).
  • Split test() into standalone vs non-standalone paths: standalone mode runs smoke+integration via Makefile then delegates functional tests to new _run_functional_standalone() which uses self.make_initrd().
  • Non-standalone modes continue to delegate entirely to the Makefile.
  • Refactor _run_tests_windows() to use make_initrd for bundling test binaries with system daemons, catch SystemExit instead of checking return codes, and clean up initrd artifacts in finally blocks.

Makefile.nanvix

  • test-functional now dispatches by PROCESS_MODE: standalone delegates to ./z.sh (Python handles initrd creation); non-standalone runs test_libxml2.elf via nanvixd.elf directly (Docker and native paths).
  • This ensures test_libxml2.elf actually executes in all deployment modes, not just on Windows standalone.

Other files

  • nanvix.toml: bump nanvix-version to 0.13.19.
  • nanvix-ci.yml: bump zutil-version to v0.9.0.
  • z.sh / z.ps1: add version-mismatch re-bootstrap logic.

Related PRs

@ppenna ppenna self-assigned this May 17, 2026
@ppenna
ppenna requested a review from Copilot May 17, 2026 22:33
@ppenna ppenna changed the title enhancement: use make_initrd for functional tests and update nanvix version Use make_initrd for functional tests and update nanvix version May 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the libxml2 Nanvix build/test integration for Nanvix 0.13.19, whose standalone nanvixd now requires an initrd image bundling the test ELF with system daemons instead of a raw ELF path. Drives initrd creation through the shared make_initrd helper from nanvix-zutil 0.9.0 and reshapes the test pipeline so functional tests actually execute in every deployment mode.

Changes:

  • Bump nanvix-version to 0.13.19 and nanvix-zutil to v0.9.0 across CI, nanvix.toml, and the z.sh/z.ps1 bootstrappers (with auto re-bootstrap on version mismatch).
  • Refactor z.py to drop direct subprocess use, split test() into standalone vs. non-standalone paths, add _run_functional_standalone(), and rework _run_tests_windows() to use make_initrd + self.run.
  • Update Makefile.nanvix:test-functional to dispatch by PROCESS_MODE: standalone delegates back to ./z.sh, while Docker/native non-standalone modes run test_libxml2.elf directly via nanvixd.elf.
Show a summary per file
File Description
.nanvix/nanvix.toml Bumps pinned nanvix-version to 0.13.19.
.github/workflows/nanvix-ci.yml Bumps zutil-version to v0.9.0 in both CI job entries.
z.sh Pins zutil 0.9.0 and re-bootstraps on version mismatch.
z.ps1 PowerShell counterpart: pins 0.9.0 and re-bootstraps with a venv-presence check.
.nanvix/Makefile.nanvix Implements real functional test execution via nanvixd.elf + mkramfs.elf for Docker/native, delegates standalone to ./z.sh.
.nanvix/z.py Routes tests through make_initrd, adds _run_functional_standalone, and replaces subprocess calls with self.run(..., docker=False).

Copilot's findings

Tip

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

  • Files reviewed: 6/6 changed files
  • Comments generated: 6

Comment thread .nanvix/z.py
Comment thread .nanvix/z.py Outdated
Comment thread .nanvix/z.py
Comment thread .nanvix/z.py
Comment thread .nanvix/z.py Outdated
Comment thread .nanvix/Makefile.nanvix Outdated
Copilot AI review requested due to automatic review settings May 17, 2026 23:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 1

Comment thread .nanvix/nanvix.toml
…ersion

Refactor the build script to fix breaking changes when bumping Nanvix to
v0.13.19. In standalone mode, nanvixd now requires an initrd image that
bundles the application binary with system daemons, rather than accepting
a raw ELF path directly.

Changes to z.py:
- Remove subprocess usage; use self.run() with docker=False for all
  tool invocations (mkramfs, nanvixd).
- Split test() into standalone vs non-standalone paths: standalone mode
  honors self.targets to determine which phases to run, delegates
  functional tests to new _run_functional_standalone() which uses
  self.make_initrd(); non-standalone modes delegate to the Makefile.
- Factor sysroot validation into _get_sysroot() helper for actionable
  error messages when CFG_SYSROOT is unset.
- Refactor _run_tests_windows() to use make_initrd for bundling test
  binaries with system daemons; each self.run() call is wrapped
  separately so failure messages distinguish mkramfs vs nanvixd
  failures. Cleanup of initrd and copied ELFs is handled in finally
  blocks with FileExistsError guarded explicitly.
- Add inline comment clarifying that self.run() raises SystemExit on
  non-zero exit and nanvixd propagates the guest exit status.

Changes to Makefile.nanvix:
- test-functional now dispatches by PROCESS_MODE: standalone delegates
  to ./z.sh (Python handles initrd creation); non-standalone runs
  test_libxml2.elf via nanvixd.elf directly (Docker and native paths).
- Use mktemp -d + trap for robust /tmp cleanup on failure.
- This ensures test_libxml2.elf actually executes in all deployment
  modes, not just on Windows standalone.

Other files updated:
- nanvix.toml: bump nanvix-version to 0.13.19.
- nanvix-ci.yml: bump zutil-version to v0.9.0.
- z.sh/z.ps1: add version-mismatch re-bootstrap logic.
@ppenna
ppenna force-pushed the enhancement-update-nanvix branch from 1d5b610 to dd969f7 Compare May 17, 2026 23:31
@ppenna
ppenna merged commit d3f2316 into nanvix/v2.12.9 May 17, 2026
12 checks passed
@ppenna
ppenna deleted the enhancement-update-nanvix branch May 17, 2026 23:35
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