Adding rsa dependency introduces non-additive lazy_static feature that breaks other code
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- rust
- Lĩnh vực
- build-system, cryptography
Hướng nghiên cứu
Start by tracing the rsa to num-bigint-dig to lazy_static dependency chain and reproducing the failure with a non-Send lazy_static value like the example in image.rs. Determine how the non-additive spin_no_std feature is enabled and whether the dependency declarations expose a way to avoid it. Done means the rsa dependency no longer breaks unrelated workspace code and the regression is covered by a reproducible check.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This is the same problem as #219, but since that issue wasn't fully evaluated, I wanted to add my report, with a bit more context.
Dependency chain:
rsadepends onnum-bigint-dignum-bigint-digdepends onlazy_staticwithfeatures = ["spin_no_std"].
lazy_static's spin_no_std feature is non-additive; it causes lazy_static to replace use of std::sync::Once with spin:once::Once. This may seem like a harmless replacement, but:
spin::once::Once<T>has different trait bounds. Namely, it only implementsSyncwhereT: Send + Syncwhilelazy_staticusingstd::sync::Onceonly requiresT: Sync.- This means that anyone using
lazy_staticon a non-Sendtype will see their code break if thespin_no_stdfeature is enabled. - Adding
rsaas a dependency to a large workspace means that every crate in that workspace now gets the modifiedlazy_staticcode usingspinwith stricter trait bounds.
This is currently happening to me: I added rsa to a large workspace, and that change causes compile errors in unrelated (previously working) code:
error[E0277]: `*const u8` cannot be sent between threads safely
--> image.rs:25:1
|
25 | / lazy_static::lazy_static! {
26 | | pub(crate) static ref HELLO_IMAGE: Option<ImageBuffer> = {
27 | | let image_bytes = std::fs::read("hello.png").ok()?;
28 | |
... |
36 | | };
37 | | }
| |_^ `*const u8` cannot be sent between threads safely
I'm not sure how to handle this, but it would be nice if there were a feature in rsa (and num-bigint-dig) to disable this behavior. As it is, I'm unable to add an rsa dependency unless I fork+patch num-bigint-dig.
- Ngôn ngữ chính
- Rust
- Star
- 673
- Fork
- 190
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 RustCrypto/RSA
-
Bump MSRV to 1.89 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
RustCrypto/RSA#707 · 2 bình luận · 1 reaction ·
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 74/100
RustCrypto/RSA#703 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
RustCrypto/RSA#686 · 4 bình luận ·
-
`rsa` v0.10 release tracking Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
RustCrypto/RSA#647 · 9 bình luận · 1 reaction ·
-
broken rust docs Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
RustCrypto/RSA#641 · 3 reaction ·
Tất cả issue của RustCrypto/RSA
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
bug good first issue package: quic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
-
`dora trace view` sends a non-canonical full UUID as-is, so a valid trace ID shows "No spans found" Đang mởcli coordinator rust
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
area: tasks enhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Jason-jo17/Polybench#15 · 1 bình luận ·