Skip to content

Audit color-eyre and its dependencies #76

@Shnatsel

Description

@Shnatsel

color-eyre is a popular crate for error handling, with over 1 million downloads, and the eyre itself has over 3 million downloads.

It relies on a surprising amount of unsafe code, even with default-features = false:

0/0        0/0          0/0    0/0     0/0      ❓ └── color-eyre 0.6.1
7/22       218/779      2/6    0/0     2/5      ☢️      ├── backtrace 0.3.64
0/0        11/26        0/0    0/0     0/0      ☢️      │   ├── addr2line 0.17.0
0/0        29/48        1/3    1/1     0/0      ☢️      │   │   ├── gimli 0.26.1
0/0        24/26        0/0    1/1     0/0      ☢️      │   │   ├── object 0.27.1
20/37      1320/2140    0/0    0/0     16/16    ☢️      │   │   │   └── memchr 2.4.1
0/20       12/327       0/2    0/0     2/30     ☢️      │   │   │       └── libc 0.2.119
0/0        0/0          0/0    0/0     0/0      ❓     │   │   └── rustc-demangle 0.1.21
0/0        0/0          0/0    0/0     0/0      ❓     │   ├── cfg-if 1.0.0
0/20       12/327       0/2    0/0     2/30     ☢️      │   ├── libc 0.2.119
0/0        0/0          0/0    0/0     0/0      🔒     │   ├── miniz_oxide 0.4.4
0/0        0/0          0/0    0/0     0/0      🔒     │   │   └── adler 1.0.2
0/0        24/26        0/0    1/1     0/0      ☢️      │   ├── object 0.27.1
0/0        0/0          0/0    0/0     0/0      ❓     │   └── rustc-demangle 0.1.21
10/10      220/220      0/0    0/0     1/1      ☢️      ├── eyre 0.6.7
0/0        0/0          0/0    0/0     0/0      ❓     │   ├── indenter 0.3.3
1/1        74/93        4/6    0/0     2/3      ☢️      │   └── once_cell 1.10.0
0/0        0/0          0/0    0/0     0/0      ❓     ├── indenter 0.3.3
1/1        74/93        4/6    0/0     2/3      ☢️      ├── once_cell 1.10.0
0/0        16/16        0/0    0/0     0/0      ☢️      └── owo-colors 3.2.0

A number of dependencies look like they shouldn't need custom unsafe code - such as owo-colors, object, gimli, as well as eyre itself.

It would be nice to remove unsafe code where reasonable.

I haven't looked at the details yet, but the object and gimli crates might be possible to switch to bytemuck instead of custom code, and owo-colors should not need any unsafe at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions