Skip to content

Commit c61b543

Browse files
authored
Add unicode-ident workaround (#268)
* Update MSRV in README * Add unicode-ident workaround * Update to the sparse path
1 parent 64f94ce commit c61b543

File tree

5 files changed

+54
-3
lines changed

5 files changed

+54
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![Crates.io](https://img.shields.io/crates/v/cargo-about.svg)](https://crates.io/crates/cargo-about)
1212
[![API Docs](https://docs.rs/cargo-about/badge.svg)](https://docs.rs/cargo-about)
1313
[![SPDX Version](https://img.shields.io/badge/SPDX%20Version-3.25.0-blue.svg)](https://spdx.org/licenses/)
14-
[![Minimum Stable Rust Version](https://img.shields.io/badge/Rust-1.74.0-blue?color=fc8d62&logo=rust)](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1740-2023-11-16)
14+
[![Minimum Stable Rust Version](https://img.shields.io/badge/Rust-1.81.0-blue?color=fc8d62&logo=rust)](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1810-2024-09-05)
1515
[![dependency status](https://deps.rs/repo/github/EmbarkStudios/cargo-about/status.svg)](https://deps.rs/repo/github/EmbarkStudios/cargo-about)
1616
[![Build Status](https://github.com/EmbarkStudios/cargo-about/workflows/CI/badge.svg)](https://github.com/EmbarkStudios/cargo-about/actions?workflow=CI)
1717

about.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ignore-build-dependencies = false
1212
ignore-dev-dependencies = false
1313
ignore-transitive-dependencies = false
1414
filter-noassertion = true
15-
workarounds = ["ring", "chrono", "rustls"]
15+
workarounds = ["ring", "chrono", "rustls", "unicode-ident"]
1616

1717
[codespan.clarify]
1818
license = "Apache-2.0"

src/cargo-about/clarify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn cmd(args: Args) -> anyhow::Result<()> {
7171
let root = PathBuf::from_path_buf(
7272
home::cargo_home()
7373
.context("unable to find CARGO_HOME directory")?
74-
.join("registry/src/github.com-1ecc6299db9ec823"),
74+
.join("registry/src/index.crates.io-6f17d22bba15001f"),
7575
)
7676
.map_err(|_e| anyhow::anyhow!("CARGO_HOME directory is not utf-8"))?;
7777

src/licenses/workarounds.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ mod rustls;
1515
mod sentry;
1616
mod tonic;
1717
mod tract;
18+
mod unicode_ident;
1819
mod wasmtime;
1920

2021
pub(crate) fn apply_workarounds<'krate>(
@@ -88,5 +89,6 @@ const WORKAROUNDS: &[(
8889
("sentry", &self::sentry::get),
8990
("tonic", &self::tonic::get),
9091
("tract", &self::tract::get),
92+
("unicode-ident", &self::unicode_ident::get),
9193
("wasmtime", &self::wasmtime::get),
9294
];
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
use super::ClarificationFile;
2+
use anyhow::Context as _;
3+
4+
pub fn get(krate: &crate::Krate) -> anyhow::Result<Option<super::Clarification>> {
5+
if krate.name != "unicode-ident" {
6+
return Ok(None);
7+
}
8+
9+
Ok(Some(super::Clarification {
10+
license: spdx::Expression::parse("(MIT OR Apache-2.0) AND Unicode-DFS-2016")
11+
.context("failed to parse license expression")?,
12+
override_git_commit: None,
13+
git: Vec::new(),
14+
files: vec![
15+
ClarificationFile {
16+
path: "LICENSE-UNICODE".into(),
17+
license: Some(
18+
spdx::Expression::parse("Unicode-DFS-2016")
19+
.context("failed to parse license expression")?,
20+
),
21+
checksum: "68f5b9f5ea36881a0942ba02f558e9e1faf76cc09cb165ad801744c61b738844"
22+
.to_owned(),
23+
start: None,
24+
end: None,
25+
},
26+
ClarificationFile {
27+
path: "LICENSE-APACHE".into(),
28+
license: Some(
29+
spdx::Expression::parse("Apache-2.0")
30+
.context("failed to parse license expression")?,
31+
),
32+
checksum: "62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a"
33+
.to_owned(),
34+
start: None,
35+
end: None,
36+
},
37+
ClarificationFile {
38+
path: "LICENSE-MIT".into(),
39+
license: Some(
40+
spdx::Expression::parse("MIT").context("failed to parse license expression")?,
41+
),
42+
checksum: "23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3"
43+
.to_owned(),
44+
start: None,
45+
end: None,
46+
},
47+
],
48+
}))
49+
}

0 commit comments

Comments
 (0)