Repository navigation
Closed
Description
Every default libperry_stdlib.a, plus perry-ext-http and perry-ext-net, links both rustls crypto providers: ring 0.17 and aws-lc-rs/aws-lc-sys. They also link two root stores, webpki-roots 1.0 and rustls-native-certs. libperry_runtime.a has no TLS dependency. Traced on d8f24f15ed with cargo tree --workspace --all-features -i <pkg>. Without --workspace, default-members hides the ext crates.
Why aws-lc is there
- Perry's own
rustls/tokio-rustlsdeclarations never setdefault-features = false, so rustls's defaultaws_lc_rsfeature comes in:- root
Cargo.toml:471-472 perry-ext-http/Cargo.toml:27-28perry-ext-net/Cargo.toml:23,28perry-stdlib/Cargo.toml:343-344
- root
- Four call sites install
aws_lc_rs::default_provider():perry-stdlib/src/tls.rs:378,perry-stdlib/src/ws.rs:48,perry-stdlib/src/net/mod.rs:665andperry-ext-net/src/tls.rs:419. By contrast,perry-ext-http/src/server/tls.rs:323-330andturnloop-tlsusering. - The legacy
mongodb3.9 driver inperry-ext-mongodbrequests the rustls defaults on its own. It goes away when the mongodb binding is deleted (mongodb: TypeError "Cannot read properties of undefined (reading 'default')" on connect #11043, tokio group J).
Finishing tokio removal does not fix points 1 and 2. Those declarations back the TLS implementation that stays.
Proposed convergence on ring + webpki-roots
- Set
default-features = falseon everyrustls/tokio-rustlsdeclaration, the workspace ones included. - Switch the four
aws_lc_rsinstall sites torustls::crypto::ring::default_provider(). - Once mongodb: TypeError "Cannot read properties of undefined (reading 'default')" on connect #11043 lands, delete
perry-ext-mongodb. - Decide on the root store deliberately.
tls.connect()and thenet.SocketTLS upgrade use the OS store throughrustls-native-certs. Node defaults to its bundled CA list, so moving towebpki-rootswould match Node more closely. That is a behaviour change and needs gap-test validation first. - Optionally tighten
deny.tomlmultiple-versionsfromwarntodenyafterwards.
Sequencing
- Wait for the in-flight lanes. Do this after tokio lanes A (ext-net/ext-http), H (turnloop(P8 H): move perry-stdlib's TLS off tokio-rustls onto a sans-I/O rustls session #11102) and L land, because they touch the same
tls.rs/ws.rs/netfiles. - Batch the root edit. The root
Cargo.tomledit changesbenchmarks/public_baseline.pySOURCE_PATHS, so it forces the ~2h baseline regeneration. Put it in the same commit as another regen.
Size
Not measured yet. Measure with:
cargo build --profile perry-dev -p perry-stdlib-static -p perry-runtime-static
nm --size-sort -S <target>/libperry_stdlib.a | grep -i aws_lc
webpki-roots 0.26 comes only from perry-ui-android's tungstenite 0.24 pin, which is Android-only and ships in none of the runtime, stdlib or ext archives.
Metadata
Metadata
Assignees
Labels
No labels
Activity