Skip to content

Remove dependency on failure, update rand to use getrandom.

Blaž Hrastnik requested to merge archseer/users:master into master

The failure crate has fallen out of favor in the community, and there are plans to fix the stdlib Error trait: https://github.com/rust-lang/rust/issues/53487

This library uses failure very minimally, so it's easy to swap out and in the process remove failure (which also drops syntstructure/syn/quote/proc_macro/unicode-xid -- these are very heavy, with syn adding about 20s in compilation time).

Before:

redox_users v0.3.1
├── failure v0.1.5
│   ├── backtrace v0.3.35
│   │   ├── backtrace-sys v0.1.31
│   │   │   └── libc v0.2.62
│   │   │   [build-dependencies]
│   │   │   └── cc v1.0.41
│   │   ├── cfg-if v0.1.9
│   │   ├── libc v0.2.62 (*)
│   │   └── rustc-demangle v0.1.16
│   └── failure_derive v0.1.5
│       ├── proc-macro2 v0.4.30
│       │   └── unicode-xid v0.1.0
│       ├── quote v0.6.13
│       │   └── proc-macro2 v0.4.30 (*)
│       ├── syn v0.15.44
│       │   ├── proc-macro2 v0.4.30 (*)
│       │   ├── quote v0.6.13 (*)
│       │   └── unicode-xid v0.1.0 (*)
│       └── synstructure v0.10.2
│           ├── proc-macro2 v0.4.30 (*)
│           ├── quote v0.6.13 (*)
│           ├── syn v0.15.44 (*)
│           └── unicode-xid v0.1.0 (*)
├── rand_os v0.1.3
│   ├── libc v0.2.62 (*)
│   └── rand_core v0.4.2
├── redox_syscall v0.1.56
└── rust-argon2 v0.5.1
    ├── base64 v0.10.1
    │   └── byteorder v1.3.2
    ├── blake2b_simd v0.5.7
    │   ├── arrayref v0.3.5
    │   ├── arrayvec v0.4.11
    │   │   └── nodrop v0.1.13
    │   └── constant_time_eq v0.1.4
    └── crossbeam-utils v0.6.6
        ├── cfg-if v0.1.9 (*)
        └── lazy_static v1.4.0

After:

redox_users v0.3.1
├── rand_os v0.1.3
│   ├── libc v0.2.62
│   └── rand_core v0.4.2
├── redox_syscall v0.1.56
└── rust-argon2 v0.5.1
    ├── base64 v0.10.1
    │   └── byteorder v1.3.2
    ├── blake2b_simd v0.5.7
    │   ├── arrayref v0.3.5
    │   ├── arrayvec v0.4.11
    │   │   └── nodrop v0.1.13
    │   └── constant_time_eq v0.1.4
    └── crossbeam-utils v0.6.6
        ├── cfg-if v0.1.9
        └── lazy_static v1.4.0

I'd also love a redox_users alternative for dirs-sys-rs: https://github.com/soc/dirs-sys-rs/blob/c3e8767a38bb542dea712c85307b6834273f2de2/src/lib.rs#L81-L87

^ for such a simple usecase, pulling in failure (+syn, etc), rust-argon2 (+crossbeam_utils, etc) and rand_os feels a bit heavy.

Edited by Blaž Hrastnik

Merge request reports