[halidoscope] Add pip packaging via maturin - #9413
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## parkerziegler/halidoscope #9413 +/- ##
============================================================
Coverage ? 70.09%
============================================================
Files ? 261
Lines ? 79579
Branches ? 19399
============================================================
Hits ? 55781
Misses ? 17895
Partials ? 5903 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Follow-up worth tracking separately from this packaging PR: on Linux, This undercuts the "non-interactive CLI" pitch for |
Packages the Tauri binary (GUI + CLI) as a platform wheel using maturin's bin bindings, so `pip install halidoscope` puts it on PATH. The compiled binary only embeds dist/ instead of falling back to Tauri's dev server when built with the tauri/custom-protocol Cargo feature, which plain `cargo build`/`maturin build` don't enable by default -- pyproject.toml sets it explicitly. Halidoscope's version is kept in lockstep with Halide's release version via tbump, matching the other Python packages, but it has no dependency on them: it's a standalone companion tool. Adds a CI workflow that builds and smoke-tests wheels for all four platforms; wiring it into pip.yml's nightly publish job is left for a follow-up once this build has been verified in CI. Also relabels a handful of pre-existing usage examples in README.md from bash to text fences: they use <placeholder> notation that mdformat-shfmt was silently mis-parsing as shell redirection syntax and corrupting. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI caught a real issue: tauri::Builder::run() initializes tao's
GTK-backed event loop before lib.rs's setup() closure ever dispatches to
a CLI subcommand, so on Linux even `halidoscope --version` panics with
no display attached ("Failed to initialize GTK backend"). This is true
of the compiled binary generally, not something packaging can paper
over -- it also means the README's claim that the CLI "works anywhere
the wheel installs" was wrong for headless Linux.
Runs the Linux smoke-test step under Xvfb (apt-installed alongside the
other Tauri system deps) and rewords the README to describe the actual
behavior instead of asserting the opposite. Unverified locally -- can't
reproduce the Linux GTK path on macOS -- so this is best-effort based on
reading the CI failure and the tao/tauri source.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
612b2ab to
539691c
Compare
Adds pip packaging for Halidoscope, stacked on #9356.
Packages the compiled Tauri binary (GUI + CLI) as a platform wheel using maturin's
binbindings, sopip install halidoscopeputs thehalidoscopeexecutable onPATH.The one non-obvious part: a plain
cargo build --release(ormaturin buildwithout extra config) compiles fine, but the resulting binary always falls back to loading its UI from Tauri's dev server instead of embeddingdist/, silently shipping a broken GUI. Enabling thetauri/custom-protocolCargo feature (set inpyproject.toml) fixes this -- confirmed empirically by grepping the built binary for the compiled JS bundle's hash before/after.Verified locally end-to-end:
pnpm build->maturin build --release-> fresh venv ->pip installthe wheel ->halidoscope --version/--helpboth work, and the installed binary now contains the embedded frontend assets.Halidoscope's version is kept in lockstep with Halide's release version via
tbump(matchinghalide/halide-bin/halide-runtime), but it has no dependency on those packages -- it's a standalone companion tool.Adds
.github/workflows/pip-halidoscope.yml: builds and smoke-tests wheels on all four platforms, decoupled frompip.yml's existing publish job. This workflow is unverified in CI (can't run GitHub Actions locally) and deliberately does not wire into the nightly publish pipeline yet -- that's a follow-up once a real run has been checked.Also relabels a handful of pre-existing usage examples in
tools/halidoscope/README.mdfrombashtotextcode fences: they use<placeholder>notation thatmdformat-shfmtwas silently mis-parsing as shell redirection syntax and corrupting (confirmed directly withshfmt). No content changed, just the fence language.Breaking changes
None.
Checklist