Skip to content

fix(build): stop hiding the shared dependencies behind cfg(linux) - #581

Merged
EtienneLescot merged 1 commit into
mainfrom
fix/cargo-linux-only-deps
Sep 3, 2026
Merged

fix(build): stop hiding the shared dependencies behind cfg(linux)#581
EtienneLescot merged 1 commit into
mainfrom
fix/cargo-linux-only-deps

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Windows and macOS have not compiled since #559. My fault, and an editing mistake rather than a design one.

Adding ash and wgpu-hal placed the [target.'cfg(target_os = "linux")'.dependencies] header immediately after anyhow, so every dependency below it became Linux-only:

error[E0432]: unresolved import `serde`
error[E0433]: cannot find module or crate `ort` in this scope

wgpu, pollster, cosmic-text, ort, ndarray, serde, serde_json and image are back in [dependencies]. The header moved below them, with a note saying what it is for — because the failure mode is invisible on the platform you develop on. The Linux build never stopped working, which is exactly why this reached main.

Verified by manifest rather than by assertion:

cargo metadata --no-deps
  target-gated : ash, wgpu-hal        (and nothing else)
  shared       : wgpu, serde, ort, image, pollster

Linux still builds. I could not check the Windows and macOS builds locally — those targets are not installed on this machine — so this rests on the manifest structure and on CI. Worth a look at the two red checks on this PR before merging.

Found while checking why #579 and #580 were red: both showed the same two failures, and #579 only touches a .js file, so they could not have been caused by either.

Summary by CodeRabbit

  • Bug Fixes
    • Restored cross-platform builds by making shared rendering and media dependencies available across supported platforms.
    • Kept Linux-only Vulkan dependencies limited to Linux environments.

Windows and macOS have not compiled since #559. My fault, and a plain editing
mistake rather than a design one: adding `ash` and `wgpu-hal` put the
`[target.'cfg(target_os = "linux")'.dependencies]` header immediately after
`anyhow`, so everything below it — `wgpu`, `pollster`, `cosmic-text`, `ort`,
`ndarray`, `serde`, `serde_json`, `image` — became Linux-only.

    error[E0432]: unresolved import `serde`
    error[E0433]: cannot find module or crate `ort` in this scope

The two new crates belong under that header. Nothing else does. They are back in
`[dependencies]`, with the header moved below them and a note saying what it is
for, since the failure mode is silent on the platform you are developing on: the
Linux build never stopped working, which is why this reached main.

`cargo metadata` now reports exactly `ash` and `wgpu-hal` as target-gated, and
`wgpu`, `serde`, `ort`, `image`, `pollster` as shared. The Linux build still
compiles.

I could not verify the Windows and macOS builds locally — those targets are not
installed here — so this rests on the manifest structure and on CI.
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: bf620ac4-fb0c-4ede-97e1-789297b02379

📥 Commits

Reviewing files that changed from the base of the PR and between 855e0fa and d78a565.

📒 Files selected for processing (1)
  • crates/compositor/Cargo.toml

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The compositor manifest now declares shared dependencies for all platforms. The Linux target section contains only the ash and wgpu-hal Vulkan dependencies.

Changes

Compositor dependency configuration

Layer / File(s) Summary
Separate shared and Linux-specific dependencies
crates/compositor/Cargo.toml
Shared dependencies moved to [dependencies]. Linux-specific Vulkan dependencies remain under the Linux target section. A comment documents the required separation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to d78a5

Shared compositor dependencies are again available on all platforms, while Vulkan-only bindings remain Linux-specific. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: restoring shared Cargo dependencies that were incorrectly scoped to Linux.
Description check ✅ Passed The description explains the build failure, identifies the affected dependencies, describes the manifest correction, and documents testing limits and CI follow-up. It does not use all template heading…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Description check

Explanation

The description explains the build failure, identifies the affected dependencies, describes the manifest correction, and documents testing limits and CI follow-up. It does not use all template headings or checkbox fields, but it contains the required change and testing information.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cargo-linux-only-deps

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.

@EtienneLescot
EtienneLescot merged commit 9d9ad2a into main Sep 3, 2026
19 checks passed
@EtienneLescot
EtienneLescot deleted the fix/cargo-linux-only-deps branch September 3, 2026 12:57
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