cargo_about/licenses/workarounds/
wasmtime.rs1use super::ClarificationFile;
2use anyhow::Context as _;
3
4pub fn get(krate: &crate::Krate) -> anyhow::Result<Option<super::Clarification>> {
5 if ![
6 "cranelift-bforest",
7 "cranelift-codegen",
8 "cranelift-codegen-meta",
9 "cranelift-codegen-shared",
10 "cranelift-entity",
11 "cranelift-frontend",
12 "cranelift-native",
13 "cranelift-wasm",
14 "regalloc",
17 "target-lexicon",
18 "wasi-cap-std-sync",
19 "wasi-common",
20 "wasmparser",
23 "wasmtime",
24 "wasmtime-environ",
25 "wasmtime-jit",
26 "wasmtime-runtime",
27 "wasmtime-types",
28 "wasmtime-wasi",
29 "wast",
32 "wiggle",
33 "wiggle-generate",
34 "wiggle-macro",
35 "winx",
36 ]
37 .contains(&krate.name.as_str())
38 {
39 return Ok(None);
40 }
41
42 if krate.name == "wasmparser" || krate.name == "wasmtime-types" || krate.name == "wast" {
45 Ok(Some(super::Clarification {
46 license: spdx::Expression::parse("Apache-2.0 WITH LLVM-exception")
47 .context("failed to parse license expression")?,
48 override_git_commit: None,
49 git: vec![ClarificationFile {
50 path: "LICENSE".into(),
51 license: None,
52 checksum: "268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5"
53 .to_owned(),
54 start: None,
55 end: None,
56 }],
57 files: Vec::new(),
58 }))
59 } else {
60 Ok(Some(super::Clarification {
61 license: spdx::Expression::parse("Apache-2.0 WITH LLVM-exception")
62 .context("failed to parse license expression")?,
63 override_git_commit: None,
64 files: vec![
65 ClarificationFile {
68 path: "LICENSE".into(),
69 license: None,
70 checksum: "268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5"
71 .to_owned(),
72 start: None,
73 end: None,
74 },
75 ],
76 git: Vec::new(),
77 }))
78 }
79}