Skip to content

deps: reduce hf-hub's transitive dependencies#5

Merged
AlonKejzman merged 1 commit into
crusoecloud:mainfrom
biswapanda:biswa-dynamo-hf-deps
Mar 15, 2026
Merged

deps: reduce hf-hub's transitive dependencies#5
AlonKejzman merged 1 commit into
crusoecloud:mainfrom
biswapanda:biswa-dynamo-hf-deps

Conversation

@biswapanda
Copy link
Copy Markdown
Collaborator

@biswapanda biswapanda commented Mar 14, 2026

Overview

Replace the default native-tls/OpenSSL backend for hf-hub with the pure-Rust rustls-tls + ureq feature set, removing a large number of platform-specific and OpenSSL-related transitive dependencies.

This pr removes native-tls and openssl-sys from the dependency tree

Related failure on dynamo side -
https://github.com/ai-dynamo/dynamo/actions/runs/23097117690/job/67091453263?pr=7387

Related comment in dynamo PR: ai-dynamo/dynamo#7387 (comment)

Details

Issue: The fastokens crate (v0.1.0) declares hf-hub = "0.4.3" with default features, which pulls in native-tls and openssl-sys. Dynamo's deny.toml explicitly bans both crates (lines 63-64), causing cargo-deny to fail in CI.

The dependency chain is:

fastokens -> hf-hub (default features) -> ureq -> native-tls -> openssl-sys

Dynamo's own hf-hub declaration uses default-features = false with rustls-tls, but Cargo's feature unification merges both — so native-tls still gets enabled.

Before:

hf-hub = "0.4.3"

After:

hf-hub = { version = "0.4.3", default-features = false, features = ["rustls-tls", "ureq"] }

This disables the default features (which include native-tls, tokio, num_cpus, etc.) and opts into the pure-Rust TLS stack (rustls + ureq) instead. The result is:

native-tls, openssl-sys, hyper-tls, tokio-native-tls, and several other platform-specific crates are completely removed from the dependency tree
The cargo-deny ban is no longer triggered
576 lines removed from Cargo.lock, 94 added — a significant dependency reduction overall

Replace the default native-tls/OpenSSL backend for hf-hub with the
pure-Rust rustls-tls + ureq feature set, removing a large number of
platform-specific and OpenSSL-related transitive dependencies.
@biswapanda biswapanda changed the title deps: switch hf-hub to rustls-tls and ureq, drop native-tls deps: switch hf-hub's transitive dependencies Mar 14, 2026
biswapanda added a commit to ai-dynamo/dynamo that referenced this pull request Mar 15, 2026
@biswapanda biswapanda changed the title deps: switch hf-hub's transitive dependencies deps: reduce hf-hub's transitive dependencies Mar 15, 2026
@AlonKejzman AlonKejzman merged commit 07a5742 into crusoecloud:main Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants