Adding rsa dependency introduces non-additive lazy_static feature that breaks other code
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- rust
- Área
- build-system, cryptography
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 673
- Forks
- 190
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de RustCrypto/RSA
-
Bump MSRV to 1.89 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
RustCrypto/RSA#707 · 2 comentarios · 1 reacción ·
-
Dificultad 3/5 Medio día Aptitud para principiantes 74/100
RustCrypto/RSA#703 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
RustCrypto/RSA#686 · 4 comentarios ·
-
`rsa` v0.10 release tracking Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
RustCrypto/RSA#647 · 9 comentarios · 1 reacción ·
-
broken rust docs Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
RustCrypto/RSA#641 · 3 reacciones ·
Todos los issues de RustCrypto/RSA
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
TheLarkInn/aipm#2413 ·
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
todo:ticket
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
taikoxyz/taiko-mono#22168 · 1 comentario ·