Dynamo integration Branch#7
Open
biswapanda wants to merge 2 commits intocrusoecloud:mainfrom
Open
Conversation
Add [features] section to Cargo.toml with pcre2 as a default feature. Gate all pcre2-related code in split.rs behind #[cfg(feature = pcre2)] so consumers can opt out with default-features = false. Add feature-gated tests for both pcre2-on and fallback paths. Document the feature flag in README.md and add CONTRIBUTING.md with build/test instructions.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry pick PRs for dynamo <> fastokens integration
Details
1. deps: reduce hf-hub's transitive dependencies: #5
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:
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:
After:
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
2. feat: make pcre2 an optional cargo feature with docs: PR - #6
Add [features] section to Cargo.toml with pcre2 as an optinal and default feature.
Gate all pcre2-related code in split.rs behind #[cfg(feature = pcre2)] so consumers can opt out with default-features = false.
Add feature-gated tests for both pcre2-on and fallback paths.
Document the feature flag in README.md and add CONTRIBUTING.md with build/test instructions.
Related Dynamo CI failure - https://github.com/ai-dynamo/dynamo/actions/runs/23101799392/job/67103786703
This will allow disabling strict pcre2 (libpcre2-dev) dependency -
=================================== FAILURES ===================================
_______________________ test_no_bundled_shared_libraries _______________________
tests/basic/test_wheel_contents.py:34: in test_no_bundled_shared_libraries
assert (
E AssertionError: Unexpected shared libraries bundled in ai-dynamo-runtime:
E ai_dynamo_runtime.libs/libpcre2-8-516f4c9d.so.0
E assert not ['ai_dynamo_runtime.libs/libpcre2-8-516f4c9d.so.0']
bundled_libs = ['ai_dynamo_runtime.libs/libpcre2-8-516f4c9d.so.0']
installed_files = [PackagePath('ai_dynamo_runtime-1.0.0.dist-info/INSTALLER'), PackagePath('ai_dynamo_runtime-1.0.0.dist-info/METADATA')...Path('ai_dynamo_runtime-1.0.0.dist-info/WHEEL'), PackagePath('ai_dynamo_runtime-1.0.0.dist-info/direct_url.json'), ...]