Skip to content

Bundle and slim Unix Python runtime#6

Merged
seasonyuu merged 5 commits into
masterfrom
fix/unix-python-runtime-bundle
Apr 27, 2026
Merged

Bundle and slim Unix Python runtime#6
seasonyuu merged 5 commits into
masterfrom
fix/unix-python-runtime-bundle

Conversation

@seasonyuu
Copy link
Copy Markdown
Contributor

Summary

  • Bundle the Python runtime for Unix release artifacts so decode-runtime can load without depending on host Python installs.
  • Keep the macOS Python payload relocatable while reducing it from a full multi-version Python.framework to a minimal current-version framework plus one stdlib copy.
  • Add packaging validation that checks bundled Python dependencies, Unix/macOS runtime paths, and smoke-tests the packaged CLI.

Changes

  • Linux/macOS CI now uses actions/setup-python with Python 3.13 for packaging consistency.
  • Unix bundles include Python runtime files; dsview-core discovers bundled python/ as PYTHONHOME on non-Windows targets.
  • Native runtime RPATH/RUNPATH now points at bundled Python locations.
  • macOS packaging now:
    • copies only the active Python.framework/Versions/3.13/Python and required support dylibs,
    • avoids duplicating framework stdlib and standalone stdlib,
    • strips unnecessary stdlib payloads such as test, ensurepip, idlelib, tkinter, and turtledemo,
    • rewrites /Library/Frameworks/Python.framework/... dependencies to @loader_path/...,
    • ad-hoc signs modified Mach-O files so arm64 dlopen validation succeeds.
  • Bundle validation now fails if macOS artifacts regress to multi-version/full-framework packaging or retain non-relocatable Python framework links.

Verification

  • CI passed for the full matrix: https://github.com/LISTENAI/dsview-cli/actions/runs/24983112856
  • Local Linux package validation passed:
    • python3 -m py_compile tools/package-bundle.py tools/validate-bundle.py
    • tools/package-bundle.py produced target/dsview-cli-test-x86_64-unknown-linux-gnu.tar.gz
    • tools/validate-bundle.py reported Bundle validation passed
    • smoke checks passed for dsview-cli --help, devices list --help, and decode list --format json
  • Size check from the latest CI artifact:
    • dsview-cli-954859b-x86_64-apple-darwin.tar.gz: ~18 MB
    • extracted bundle: ~58 MB
    • python/: ~52 MB
    • Python.framework: ~24 MB

Notes

The previous macOS artifact from 264c79f was about 195 MB compressed and 821 MB extracted because it included four Python framework versions plus duplicate stdlib contents.

@seasonyuu seasonyuu merged commit 05667cb into master Apr 27, 2026
12 checks passed
@seasonyuu seasonyuu deleted the fix/unix-python-runtime-bundle branch April 27, 2026 09:13
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.

1 participant