Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error output when license hash does not match #577

Open
tgross35 opened this issue Nov 30, 2023 · 0 comments
Open

Improve error output when license hash does not match #577

tgross35 opened this issue Nov 30, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@tgross35
Copy link

Is your feature request related to a problem? Please describe.

I tried changing the hash = ... value for a dependency and was expecting to see a simple message about a hash mismatch. Instead, I get a couple errors that don't mention it:

error[unlicensed]: ring = 0.17.6 is unlicensed
  ┌─ ring 0.17.6 (registry+https://github.com/rust-lang/crates.io-index):2:9
  │
2 │ name = "ring"
  │         ^^^^ a valid license expression could not be retrieved for the crate
3 │ version = "0.17.6"
4 │ license = ""
  │            - license expression was not specified
5 │ license-files = [
6 │     { path = "/Users/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.6/LICENSE", hash = 0xbd0eed23, score = 0.67, license = "OpenSSL" },
  │                                                                                                                                    ---- low confidence in the license text
  │
  = ring v0.17.6
    ├── rustls v0.21.9
    │   └── ureq v2.9.1
    │       ├── clevis v0.4.3
    │       │   └── keymgt-clevis v0.1.0
    │       └── keymgt-clevis v0.1.0 (*)
    ├── rustls-webpki v0.101.7
    │   ├── rustls v0.21.9 (*)
    │   └── ureq v2.9.1 (*)
    └── sct v0.7.1
        └── rustls v0.21.9 (*)

warning[license-exception-not-encountered]: license exception was not encountered
   ┌─ /Users/me/Documents/projects/mdb/mariadb-server/rust/deny.toml:32:35
   │
32 │     { allow = ["OpenSSL"], name = "ring", version = "*" },
   │                                   ^^^^^^ unmatched license exception

licenses FAILED

It seems like if the hash is incorrect it falls back to other methods?

Describe the solution you'd like

It may still be OK to fall back to other methods, but a notice would help. Maybe something like:

hash mismatch: 0xbd0eed23 was specified but 0x1234abcd was calculated.
    falling back to other predicates

This is also nice because you can copy and paste the new hash if you are OK with the new file.

@tgross35 tgross35 added the enhancement New feature or request label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant