utooland / utooland/utoo

feat(pm): reject non-optional platform-incompatible packages / 拒绝非 optional 的平台不兼容依赖

Open
#3,175 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Pkg Manager OSS-Medium OSS26-Team S-Feature S-Needs discussion
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.rs
  • crates/pm/src/service/install.rs
  • crates/pm/src/service/package.rs
  • e2e/pm-arborist.sh
  • e2e/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 / cpu constraint when available.
  • Unskip or update the platform-specification Arborist fixture.
Acceptance Criteria
  • optional-platform-specification still passes.
  • platform-specification fails for the expected reason.
  • Behavior is covered by tests.
  • cargo fmt and cargo clippy --all-targets -- -D warnings --no-deps pass.

中文

实现 npm 兼容的非 optional 依赖平台不匹配处理。

当前 Arborist fixture platform-specification 处于 skip 状态。utoo 已经有平台兼容性判断 helper,并且在物化安装时会跳过不兼容条目;但对于非 optional 的平台不兼容依赖,不应该静默跳过,而应给出清晰的平台不匹配错误。

组队人数

2 人。

基本要求
  • 熟悉 Rust 错误处理。
  • 能追踪依赖 metadata 从解析、lockfile 到安装物化的流转。
  • 能区分 optional 与非 optional 的行为差异。
建议关注代码
  • crates/ruborist/src/model/compatibility.rs
  • crates/pm/src/service/install.rs
  • crates/pm/src/service/package.rs
  • e2e/pm-arborist.sh
  • e2e/pm/arborist/README.md
目标产出
  • optional 平台不兼容依赖继续优雅跳过。
  • 非 optional 平台不兼容依赖给出明确错误。
  • 错误信息尽量包含包名以及不兼容的 os / cpu 约束。
  • 解除或更新 platform-specification Arborist fixture 的 skip 状态。
验收标准
  • optional-platform-specification 仍然通过。
  • platform-specification 因预期的平台不匹配原因失败。
  • 行为有测试覆盖。
  • cargo fmtcargo clippy --all-targets -- -D warnings --no-deps 通过。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.