getsentry / pdb

A parser for Microsoft PDB (Program Database) debugging information
https://docs.rs/pdb/
Apache License 2.0
385 stars 69 forks source link

Remove the reqwest dependency. #71

Closed RazrFalcon closed 2 years ago

RazrFalcon commented 4 years ago

For some reasons, cargo builds some reqwest's dependencies even if we don't need them. I'm not sure if this is a known cargo bug or something else.

Here is a default build log:

cargo build
   Compiling proc-macro2 v0.4.27
   Compiling libc v0.2.49
   Compiling autocfg v0.1.2
   Compiling semver-parser v0.7.0
   Compiling unicode-xid v0.1.0
   Compiling rand_core v0.4.0
   Compiling fallible-iterator v0.1.6
   Compiling semver v0.9.0
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.3
   Compiling rand_isaac v0.1.1
   Compiling rand_hc v0.1.0
   Compiling rand_xorshift v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling rand_chacha v0.1.1
   Compiling rand v0.6.5
   Compiling rustc_version v0.2.3
   Compiling scroll v0.9.2
   Compiling quote v0.6.11
   Compiling rand_os v0.1.2
   Compiling syn v0.15.27
   Compiling uuid v0.7.2
   Compiling scroll_derive v0.9.5
   Compiling pdb v0.5.0 
    Finished dev [unoptimized + debuginfo] target(s) in 5.57s

As you can see, we have a lot of rand_* crates. But we don't need them. They are optional dependencies of the uuid.

Bu removing reqwest we will get just:

cargo build
   Compiling proc-macro2 v0.4.27
   Compiling semver-parser v0.7.0
   Compiling unicode-xid v0.1.0
   Compiling uuid v0.7.2
   Compiling fallible-iterator v0.1.6
   Compiling semver v0.9.0
   Compiling rustc_version v0.2.3
   Compiling scroll v0.9.2
   Compiling quote v0.6.11
   Compiling syn v0.15.27
   Compiling scroll_derive v0.9.5
   Compiling pdb v0.5.0 
    Finished dev [unoptimized + debuginfo] target(s) in 5.38s

By removing reqwest we have to download the test pdb file manually, which is unfortunate. But downloading some stuff in tests isn't that great of idea either...

This also makes Cargo.lock way cleaner. And reduces CI build time in half.

jan-auer commented 4 years ago

This ties neatly into the discussion over at https://github.com/m4b/goblin/issues/185

I think the general approach is fine, although we might want more tooling to download the required file or files on a local machine.

jan-auer commented 2 years ago

Superseeded by #128. Thank you for the contribution!