feat(pm): reject non-optional platform-incompatible packages / 拒绝非 optional 的平台不兼容依赖
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.5k
- Forks
- 128
- Avg merge
- 21h 39m
- Merged PRs (30d)
- 32
Description
English
Implement npm-compatible platform mismatch handling for non-optional dependencies.
The Arborist fixture platform-specification is currently skipped. utoo already has platform compatibility helpers and skips incompatible entries during materialization, but non-optional platform-incompatible dependencies should fail with a clear platform mismatch error instead of being silently skipped.
Team Size
2 contributors.
Basic Requirements
- Familiarity with Rust error handling.
- Ability to trace dependency metadata from resolution/lockfile to install materialization.
- Ability to compare optional vs non-optional behavior.
Suggested Code Areas
crates/ruborist/src/model/compatibility.rscrates/pm/src/service/install.rscrates/pm/src/service/package.rse2e/pm-arborist.she2e/pm/arborist/README.md
Expected Output
- Optional platform-incompatible dependencies continue to be skipped gracefully.
- Non-optional platform-incompatible dependencies fail with a clear error.
- Error message should include the package name and incompatible
os/cpuconstraint when available. - Unskip or update the
platform-specificationArborist fixture.
Acceptance Criteria
optional-platform-specificationstill passes.platform-specificationfails for the expected reason.- Behavior is covered by tests.
cargo fmtandcargo clippy --all-targets -- -D warnings --no-depspass.
中文
实现 npm 兼容的非 optional 依赖平台不匹配处理。
当前 Arborist fixture platform-specification 处于 skip 状态。utoo 已经有平台兼容性判断 helper,并且在物化安装时会跳过不兼容条目;但对于非 optional 的平台不兼容依赖,不应该静默跳过,而应给出清晰的平台不匹配错误。
组队人数
2 人。
基本要求
- 熟悉 Rust 错误处理。
- 能追踪依赖 metadata 从解析、lockfile 到安装物化的流转。
- 能区分 optional 与非 optional 的行为差异。
建议关注代码
crates/ruborist/src/model/compatibility.rscrates/pm/src/service/install.rscrates/pm/src/service/package.rse2e/pm-arborist.she2e/pm/arborist/README.md
目标产出
- optional 平台不兼容依赖继续优雅跳过。
- 非 optional 平台不兼容依赖给出明确错误。
- 错误信息尽量包含包名以及不兼容的
os/cpu约束。 - 解除或更新
platform-specificationArborist fixture 的 skip 状态。
验收标准
optional-platform-specification仍然通过。platform-specification因预期的平台不匹配原因失败。- 行为有测试覆盖。
cargo fmt和cargo clippy --all-targets -- -D warnings --no-deps通过。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with crates/ruborist/src/model/compatibility.rs, then trace dependency handling through crates/pm/src/service/install.rs and package.rs. Run the Arborist cases from e2e/pm-arborist.sh, comparing optional-platform-specification with platform-specification. Done means optional mismatches still pass, non-optional mismatches report the package and constraints, tests cover both behaviors, and the fixture is no longer skipped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100