Skip to content

Fix cross-platform Cargo workspace modeling#6761

Open
TheHypnoo wants to merge 5 commits into
mainfrom
fix/multiplatform-workspace
Open

Fix cross-platform Cargo workspace modeling#6761
TheHypnoo wants to merge 5 commits into
mainfrom
fix/multiplatform-workspace

Conversation

@TheHypnoo

@TheHypnoo TheHypnoo commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • gate each platform UI crate and its native dependencies with the matching Cargo target cfg
  • keep platform distribution crates in the workspace while preventing foreign backends from compiling on the host
  • restrict the shared miniaudio backend to Linux, Windows, and Android
  • update the legacy container-compose FFI and the stale codegen regression initializer

Validation

  • cargo metadata --no-deps --format-version 1
  • cargo fmt --all -- --check
  • cargo check
  • cargo check --workspace --all-targets --all-features
  • cargo check -p perry --no-default-features --features dev-cli
  • cargo test -p perry-codegen --test i64_spec_ternary_recursion

Platform note

A Windows MSVC cross-check from macOS still requires the Windows C/C++ SDK headers. This change does not install or emulate foreign platform SDKs. Platform CI continues to validate each native distribution target.

Summary by CodeRabbit

  • Bug Fixes
    • Improved cross-platform builds by restricting platform-specific UI and audio components to their applicable targets, reducing host build failures from missing SDKs or system libraries.
    • Updated container Compose integration for the current engine API, including more robust service filtering and improved service logs/command execution handling.
  • Tests
    • Added unit test coverage for the service filter argument parsing.
  • Documentation
    • Updated the changelog entry to reflect the new mult-platform workspace build behavior.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e55eee41-5492-4ea7-b37a-d216e7e47226

📥 Commits

Reviewing files that changed from the base of the PR and between ba15830 and 8a015d3.

📒 Files selected for processing (1)
  • crates/perry-container-compose/src/ffi.rs

📝 Walkthrough

Walkthrough

The changes gate platform-specific crates and native audio dependencies by target, update Compose FFI calls for current engine APIs, align a codegen test helper with the current compile options, and document workspace build behavior.

Changes

Platform target gating

Layer / File(s) Summary
Target-specific platform dependencies
crates/perry-audio-miniaudio/Cargo.toml, crates/perry-ui-*/Cargo.toml
Platform dependencies are scoped to Linux, Windows, Android, iOS, macOS, tvOS, visionOS, or watchOS targets; the Windows feature declaration remains defined.
Platform source and audio build gates
crates/perry-audio-miniaudio/build.rs, crates/perry-audio-miniaudio/src/lib.rs, crates/perry-ui-*/src/lib.rs
Platform crate roots compile only for their applicable targets, and unsupported miniaudio targets skip backend compilation and link directives.
Workspace build metadata
Cargo.toml, changelog.d/6761-multiplatform-workspace.md
Workspace comments and changelog text describe target-gated platform builds and the Compose FFI update.

Compose FFI updates

Layer / File(s) Summary
Compose engine and FFI call updates
crates/perry-container-compose/src/ffi.rs
Project configuration uses the constructor API, logs validate service arrays and serialize results through JSON, exec passes expanded engine arguments, and parser behavior is covered by unit tests.

Workspace and tooling cleanup

Layer / File(s) Summary
Codegen test option cleanup
crates/perry-codegen/tests/i64_spec_ternary_recursion.rs
The test helper no longer initializes the removed CompileOptions field.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

  • PerryTS/perry#6645: Both changes remove the obsolete CompileOptions.namespace_reexport_named_imports initialization from codegen test helpers.
  • PerryTS/perry#6646: Both changes touch the macOS UI crate root; this PR’s crate-level gate affects compilation of the added FFI module.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: cross-platform Cargo workspace modeling and build gating.
Description check ✅ Passed The description covers the core summary and validation well, with only some template sections left unfilled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/multiplatform-workspace

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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

🤖 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 `@crates/perry-container-compose/src/ffi.rs`:
- Around line 145-147: Update the services parsing in the FFI entrypoint to
distinguish absent or empty filters from malformed JSON. When a non-empty
service filter fails to parse as a JSON array of strings, return json_err(...)
instead of defaulting to an empty Vec; preserve the existing empty-filter
behavior that allows ComposeEngine::logs to request all services.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d042454e-99c3-46f6-92f5-288e03bd7d38

📥 Commits

Reviewing files that changed from the base of the PR and between de8b8b4 and ba15830.

📒 Files selected for processing (25)
  • Cargo.toml
  • changelog.d/6761-multiplatform-workspace.md
  • crates/perry-audio-miniaudio/Cargo.toml
  • crates/perry-audio-miniaudio/build.rs
  • crates/perry-audio-miniaudio/src/lib.rs
  • crates/perry-codegen/tests/i64_spec_ternary_recursion.rs
  • crates/perry-container-compose/src/ffi.rs
  • crates/perry-ui-android/Cargo.toml
  • crates/perry-ui-android/src/lib.rs
  • crates/perry-ui-gtk4/Cargo.toml
  • crates/perry-ui-gtk4/src/lib.rs
  • crates/perry-ui-ios/Cargo.toml
  • crates/perry-ui-ios/src/lib.rs
  • crates/perry-ui-macos/Cargo.toml
  • crates/perry-ui-macos/src/lib.rs
  • crates/perry-ui-tvos/Cargo.toml
  • crates/perry-ui-tvos/src/lib.rs
  • crates/perry-ui-visionos/Cargo.toml
  • crates/perry-ui-visionos/src/lib.rs
  • crates/perry-ui-watchos/Cargo.toml
  • crates/perry-ui-watchos/src/lib.rs
  • crates/perry-ui-windows-winui/Cargo.toml
  • crates/perry-ui-windows-winui/src/lib.rs
  • crates/perry-ui-windows/Cargo.toml
  • crates/perry-ui-windows/src/lib.rs
💤 Files with no reviewable changes (1)
  • crates/perry-codegen/tests/i64_spec_ternary_recursion.rs

Comment thread crates/perry-container-compose/src/ffi.rs Outdated
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