A workspace member with several crate types fails builds of unrelated packages
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- build-system
Hướng nghiên cứu
Start by locating the client-side workspace crate-type check: the report says it runs before the daemon starts and appears to inspect every workspace member. Trace how cargo rustd build -p app selects packages, then compare that with the crate-type validation. Done means the unrelated ffi member no longer blocks app; the report also describes the expected behavior when ffi is a dependency.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
cargo rustd build -p <crate> fails for the whole workspace when any workspace member declares more than one crate type, for example crate-type = ["lib", "cdylib", "staticlib"]. The failing member does not need to be a dependency of the crate being built.
This pattern is common for crates that expose an FFI surface (UniFFI, cbindgen, JNI) and also keep a lib target for Rust consumers.
Reproduction
Environment: macOS arm64 (Darwin), rustd from the nightly release, Rust 1.99.0 with rust-src.
Create a workspace with two members. app is a plain binary. ffi is a library with three crate types. app does not depend on ffi.
Cargo.toml
[workspace]
members = ["app", "ffi"]
resolver = "3"
ffi/Cargo.toml
[package]
name = "ffi"
version = "0.1.0"
edition = "2024"
[lib]
crate-type = ["lib", "cdylib", "staticlib"]
ffi/src/lib.rs
pub fn add(a: u32, b: u32) -> u32 {
a + b
}
app/Cargo.toml
[package]
name = "app"
version = "0.1.0"
edition = "2024"
app/src/main.rs
fn main() {
println!("{}", 1 + 2);
}
Then run:
cargo +1.99.0 rustd build -p app
Actual result
error: `ffi` is built as `lib` and `cdylib` and `staticlib`, which the daemon does not link yet: it builds a `lib`, an `rlib` or a `bin` alone
Expected result
Either of these would help:
- Building
appsucceeds, becauseffiis not in its dependency graph. - If
ffiis a dependency,rustdbuilds itslibtarget and ignores thecdylibandstaticliboutputs when no requested target needs them.
Notes from isolating it
| Variant | Result |
|---|---|
Both crates are workspace members, ffi has three crate types |
Fails, error above |
ffi removed from members (so it is not in the workspace) |
cargo rustd build -p app succeeds |
Both are members, ffi has the default crate type |
cargo rustd build -p app succeeds |
So the check seems to run over every workspace member, not only the packages selected by -p or the dependencies of those packages. I have not read the source, so this is an inference from the behavior.
I also saw that the error is printed even when the daemon is not running (cargo rustd stop reports daemon: not running), so the check looks like it happens in the client before the daemon starts. This is from observation only.
Why it matters
The README already lists "workspace crates built as cdylib, dylib or staticlib" under "What is not supported", so I understand this is a known limit. The part that may be unintended is its reach. A workspace that ships an FFI crate next to other packages cannot use rustd at all today, even for packages that do not touch that crate. The README does not say that the check applies to the whole workspace.
Related: #1 (macOS support). The trivial workspace above builds and runs under rustd on macOS arm64 once ffi is excluded, which is useful data for that issue.
Happy to test a fix or a branch.
- Ngôn ngữ chính
- Rust
- Star
- 248
- Fork
- 13
- Merge trung bình
- 7 giờ 52 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DioxusLabs/rustd
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
DioxusLabs/rustd#15 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
DioxusLabs/rustd#28 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
DioxusLabs/rustd#27 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Workspace fails to load: rquickjs types give layout of …: HasErrorType, and rustd never falls backĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
DioxusLabs/rustd#26 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
DioxusLabs/rustd#25 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DioxusLabs/rustd
Issue tương tự
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pbakaus/impeccable#1601 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RDF/XML writer: a blank node in two lists is left out of the secondCó thể đã có người làm @mrnolte đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
phillord/horned-owl#368 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mongodb/kingfisher#588 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bump Python to 3.14 or 3.15Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug rust
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày