Skip to content

[codex] package pyvirtualcam-core crate artifacts#6

Merged
chris-piekarski merged 3 commits into
mainfrom
codex/package-pyvirtualcam-core-crate
Jun 6, 2026
Merged

[codex] package pyvirtualcam-core crate artifacts#6
chris-piekarski merged 3 commits into
mainfrom
codex/package-pyvirtualcam-core-crate

Conversation

@chris-piekarski

@chris-piekarski chris-piekarski commented Jun 5, 2026

Copy link
Copy Markdown

Summary

Packages pyvirtualcam-core as a publishable Rust crate by vendoring the libyuv sources it needs, tightening the crate include list, and documenting the vendored build path.

Updates CI so the Rust crate is tested, packaged, uploaded as an artifact, and attached to tagged GitHub releases alongside the Python wheels.

Why

The Linux backend now builds through Rust/PyO3, but the core crate needs its libyuv dependency present inside the crate package. Without vendoring these files under the crate and validating cargo package, GitHub release artifacts could miss the Rust crate or produce an incomplete package.

Impact

Python API behavior is unchanged. Linux builds continue to use libyuv-backed conversions, while release CI now also produces a pyvirtualcam-core crate artifact.

Validation

  • cargo fmt --check
  • cargo test -p pyvirtualcam-core --locked
  • cargo package -p pyvirtualcam-core --allow-dirty --locked
  • python -m pytest -q test/test_backend_contract.py test/test_util.py
  • git diff --check

Note: actionlint was not available locally. The commit is unsigned because local GPG signing failed twice after refreshing the agent TTY.

Summary by CodeRabbit

  • New Features

    • Rust crate is now built, packaged, and published alongside Python wheels; releases include the .crate artifact.
  • Documentation

    • README adds Rust usage instructions and Linux setup guidance.
  • Chores

    • Vendored LibYuv source and license added to the project to improve build portability and provide conversion/decoding utilities.
    • CI workflow updated to build/package the Rust crate and attach artifacts to releases.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: da2f82dc-b8be-4b80-bd17-1d8f1193dbea

📥 Commits

Reviewing files that changed from the base of the PR and between 7e86208 and a52143b.

📒 Files selected for processing (2)
  • .github/lux-ci-config.json
  • .github/workflows/luxie-tronic.yml
💤 Files with no reviewable changes (2)
  • .github/lux-ci-config.json
  • .github/workflows/luxie-tronic.yml

📝 Walkthrough

Walkthrough

Adds vendored libyuv into the Rust crate, updates crate metadata/build paths and README, adds many libyuv headers and source implementations (conversion, CPU detection, MJPEG), and extends CI to build/package the crate and upload .crate alongside wheels to releases.

Changes

Core crate, vendored libyuv, and CI publishing

Layer / File(s) Summary
Crate metadata, packaging, and build path switch
MANIFEST.in, crates/pyvirtualcam-core/Cargo.toml, crates/pyvirtualcam-core/README.md, crates/pyvirtualcam-core/build.rs, crates/pyvirtualcam-core/vendor/libyuv/LICENSE
Expands packaged files, updates crate metadata/docs, switches build.rs to vendor/libyuv, and adds libyuv LICENSE.
Vendored libyuv public headers
crates/pyvirtualcam-core/vendor/libyuv/include/...
Introduces libyuv umbrella and extensive public headers (basic types, convert., convert_from., convert_argb., cpu_id.h, rotate., scale.*, planar_functions.h, mjpeg_decoder.h, video_common.h, version.h, etc.).
CPU feature detection and compare primitives (sources)
crates/pyvirtualcam-core/vendor/libyuv/source/compare*, .../cpu_id.cc
Implements hashing, Hamming/SSE/PSNR/SSIM primitives with SIMD/backends and CPU feature detection for x86/ARM/MIPS.
Core format conversions (sources)
crates/pyvirtualcam-core/vendor/libyuv/source/convert*.cc (many files)
Adds broad YUV↔RGB conversion implementations across 8/10/12-bit and packed/semi-planar formats and platform-optimized variants.
High-level ConvertTo and MJPEG decode*
crates/pyvirtualcam-core/vendor/libyuv/source/convert_to_*.cc, .../convert_jpeg.cc, .../mjpeg_*.cc
Adds ConvertToI420/ConvertToARGB entry points and a full MJPEG decoder with decode-to-buffers/callbacks and validation.
CI: build and publish Rust crate artifact
.github/workflows/ci.yml
Adds rust-crate job that tests and packages pyvirtualcam-core and uploads .crate; publish-wheels now depends on it and uploads .crate with wheels to the GitHub Release.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant RustCrateJob
  participant Artifacts
  participant PublishJob
  GitHubActions->>RustCrateJob: run tests & cargo package
  RustCrateJob->>Artifacts: upload crate-pyvirtualcam-core (*.crate)
  PublishJob->>Artifacts: download crate-pyvirtualcam-core
  PublishJob->>GitHubActions: attach dist/*.whl and dist/*.crate to Release
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • LuxTronic/pyvirtualcam#5: Adjusts libyuv integration paths in build.rs; directly connected to the vendor path switch and packaging introduced here.

Poem

A bunny compiles in the moonlit glade,
Crates in a basket, releases made.
YUVs twirl, pixels flip and flow,
Rust sings softly where frames now go.
Hop, test, pack—artifacts alight— 🐇✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/package-pyvirtualcam-core-crate

@chris-piekarski chris-piekarski marked this pull request as ready for review June 5, 2026 14:25

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

421-447: ⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoff

Update CI workflow actions for security and compatibility (pin SHAs + fix outdated runner)

  • Supply-chain: actions/download-artifact@v4 and softprops/action-gh-release@v1 aren’t pinned to commit SHAs—pin to specific SHA versions.
  • Compatibility: softprops/action-gh-release@v1 is flagged as using an outdated runner; update it to a supported version.
  • Remove the persist-credentials suggestion: there’s no persist-credentials configured anywhere in .github/workflows/ci.yml.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 421 - 447, The CI steps "Download
wheels from artifact storage", "Download Rust crate from artifact storage", and
"Create Release and Upload Artifacts" reference third‑party actions that must be
pinned to commit SHAs and the release action must be moved to a supported
release (non‑deprecated) version: replace uses: actions/download-artifact@v4 for
both download steps with the same actions/download-artifact@<commit-sha> pin,
and replace uses: softprops/action-gh-release@v1 with a supported softprops
release (e.g., softprops/action-gh-release@v2 or the maintained tag) pinned to
its commit SHA; update the uses lines accordingly to point to the exact SHAs for
those action repos.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 239-245: Update the CI steps that run Cargo for the
pyvirtualcam-core package to include the --locked flag: add --locked to the
existing cargo test invocation (cargo test -p pyvirtualcam-core) and to both
cargo package invocations (cargo package -p pyvirtualcam-core --list and cargo
package -p pyvirtualcam-core) so they become reproducible and fail if Cargo.lock
is out of sync.

---

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 421-447: The CI steps "Download wheels from artifact storage",
"Download Rust crate from artifact storage", and "Create Release and Upload
Artifacts" reference third‑party actions that must be pinned to commit SHAs and
the release action must be moved to a supported release (non‑deprecated)
version: replace uses: actions/download-artifact@v4 for both download steps with
the same actions/download-artifact@<commit-sha> pin, and replace uses:
softprops/action-gh-release@v1 with a supported softprops release (e.g.,
softprops/action-gh-release@v2 or the maintained tag) pinned to its commit SHA;
update the uses lines accordingly to point to the exact SHAs for those action
repos.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4aa41b00-be42-495e-91fe-64d9bc83c572

📥 Commits

Reviewing files that changed from the base of the PR and between a7b63d9 and 1769d15.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (78)
  • .github/workflows/ci.yml
  • MANIFEST.in
  • crates/pyvirtualcam-core/Cargo.toml
  • crates/pyvirtualcam-core/README.md
  • crates/pyvirtualcam-core/build.rs
  • crates/pyvirtualcam-core/vendor/libyuv/LICENSE
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/basic_types.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/compare.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/compare_row.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/convert.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/convert_argb.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/convert_from.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/convert_from_argb.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/cpu_id.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/macros_msa.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/mjpeg_decoder.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/planar_functions.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/rotate.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/rotate_argb.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/rotate_row.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/row.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/scale.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/scale_argb.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/scale_row.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/scale_uv.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/version.h
  • crates/pyvirtualcam-core/vendor/libyuv/include/libyuv/video_common.h
  • crates/pyvirtualcam-core/vendor/libyuv/source/compare.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/compare_common.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/compare_gcc.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/compare_mmi.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/compare_msa.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/compare_neon.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/compare_neon64.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/compare_win.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/convert.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/convert_argb.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/convert_from.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/convert_from_argb.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/convert_jpeg.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/convert_to_argb.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/convert_to_i420.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/cpu_id.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/mjpeg_decoder.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/mjpeg_validate.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/planar_functions.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate_any.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate_argb.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate_common.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate_gcc.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate_mmi.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate_msa.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate_neon.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate_neon64.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/rotate_win.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/row_any.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/row_common.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/row_gcc.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/row_mmi.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/row_msa.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/row_neon.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/row_neon64.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/row_win.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_any.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_argb.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_common.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_gcc.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_mmi.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_msa.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_neon.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_neon64.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_uv.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/scale_win.cc
  • crates/pyvirtualcam-core/vendor/libyuv/source/video_common.cc
  • crates/pyvirtualcam-py/src/lib.rs

Comment thread .github/workflows/ci.yml Outdated
@chris-piekarski chris-piekarski removed the request for review from luxie-tronic June 5, 2026 16:13
@chris-piekarski chris-piekarski merged commit adc4e18 into main Jun 6, 2026
114 of 115 checks passed
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