There is an article on HN about curl
getting a portion of it ported over to Rust [1] [2] . I learned a couple things
- The new libcurl backend will be https://github.com/hyperium/hyper
- Determine number of owners/committers https://github.com/rust-secure-code/cargo-supply-chain
- Copy all the dependencies into a subfolder https://doc.rust-lang.org/cargo/commands/cargo-vendor.html
[1] https://news.ycombinator.com/item?id=24729218
[2] https://daniel.haxx.se/blog/2020/10/09/rust-in-curl-with-hyper/
git clone https://github.com/hyperium/hyper
cd hyper
cargo install cargo-vendor
# for counting lines of source
cargo install tokei
cargo vendor --offline ../hyper-vend
# ...
Vendoring winapi-util v0.1.5 (/Users/seg_lol/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-util-0.1.5) to ../hyper-vend/winapi-util
Vendoring winapi-x86_64-pc-windows-gnu v0.4.0 (/Users/seg_lol/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-x86_64-pc-windows-gnu-0.4.0) to ../hyper-vend/winapi-x86_64-pc-windows-gnu
Vendoring ws2_32-sys v0.2.1 (/Users/seg_lol/.cargo/registry/src/github.com-1ecc6299db9ec823/ws2_32-sys-0.2.1) to ../hyper-vend/ws2_32-sys
To use vendored sources, add this to your .cargo/config for this project:
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "../hyper-vend"
Hyper is like 23kloc, but the dependencies sum to over 700kloc.
(py38.env) zircon:hyper$ tokei .
-------------------------------------------------------------------------------
Language Files Lines Code Comments Blanks
-------------------------------------------------------------------------------
HTML 1 10 10 0 0
Markdown 4 2801 2801 0 0
Rust 78 26641 19408 3834 3399
Plain Text 1 139 139 0 0
TOML 1 217 174 4 39
-------------------------------------------------------------------------------
Total 85 29808 22532 3838 3438
-------------------------------------------------------------------------------
(py38.env) zircon:hyper$ tokei ../hyper-vend/
-------------------------------------------------------------------------------
Language Files Lines Code Comments Blanks
-------------------------------------------------------------------------------
Autoconf 1 45 29 11 5
Dockerfile 1 9 5 0 4
HTML 2 6 6 0 0
JSON 3 7801 7801 0 0
Markdown 104 12179 12179 0 0
Python 3 757 540 79 138
ReStructuredText 2 422 422 0 0
Rust 2322 822476 666449 105001 51026
Shell 10 218 93 72 53
Plain Text 6 18229 18229 0 0
TOML 94 3962 2709 868 385
YAML 8 225 184 1 40
-------------------------------------------------------------------------------
Total 2556 866329 708646 106032 51651
-------------------------------------------------------------------------------