Closed abernix closed 2 years ago
cargo-about can generate a license list from a template, that looks like that:
and it requires a toml file listing the accepted licenses:
accepted = [
"Apache-2.0",
"MIT",
"CC0-1.0",
"ISC",
"BSD-3-Clause"
]
cargo-license generates the list as text directly:
$ cargo license
0BSD OR Apache-2.0 OR MIT (1): adler
Apache-2.0 (15): fragile, insta, normalize-line-endings, openssl, opentelemetry, opentelemetry-http, opentelemetry-jaeger, opentelemetry-otlp, opentelemetry-semantic-conventions, prost, prost-build, prost-derive, prost-types, similar, thrift
Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT (2): wasi, wasi
Apache-2.0 OR BSD-2-Clause OR MIT (1): wepoll-ffi
Apache-2.0 OR BSL-1.0 (1): ryu
Apache-2.0 OR MIT (245): anyhow, ascii-canvas, assert_fs, async-channel, async-compression, async-executor, async-global-executor, async-io, async-lock, async-mutex, async-process, async-std, async-task, async-trait, atomic-waker, autocfg, base64, bit-set, bit-vec, bitflags, block-buffer, blocking, bstr, buf_redux, bumpalo, cache-padded, camino, cargo-platform, cast, cc, cfg-if, cfg-if, chrono, concurrent-queue, core-foundation, core-foundation-sys, countme, cpufeatures, crc32fast, criterion, criterion-plot, crossbeam-channel, crossbeam-deque, crossbeam-epoch, crossbeam-utils, ctor, derivative, diff, digest, directories, dirs-next, dirs-sys, dirs-sys-next, displaydoc, dtoa, either, ena, encode_unicode, encoding_rs, env_logger, event-listener, fastrand, filetime, fixedbitset, flate2, fnv, foreign-types, foreign-types-shared, form_urlencoded, futures, futures-channel, futures-core, futures-executor, futures-io, futures-lite, futures-macro, futures-sink, futures-task, futures-util, getrandom, getrandom, glob, gloo-timers, half, hashbrown, heck, hermit-abi, hotwatch, http, httparse, httpdate, humantime, hyper-timeout, hyper-tls, idna, indexmap, input_buffer, iovec, ipnet, itertools, itoa, js-sys, kv-log-macro, lalrpop, lalrpop-util, lazy_static, lazycell, libc, libnghttp2-sys, libz-sys, linked-hash-map, lock_api, log, maplit, mime, mio-extras, miow, miow, mockall, mockall_derive, multimap, multipart, native-tls, net2, ntapi, num-integer, num-traits, num_cpus, once_cell, opaque-debug, openssl-probe, parking, parking_lot, parking_lot_core, percent-encoding, pest, petgraph, pin-project, pin-project-internal, pin-project-lite, pin-utils, pkg-config, platforms, polling, ppv-lite86, predicates, predicates, predicates-core, predicates-tree, proc-macro-error, proc-macro-error-attr, proc-macro-hack, proc-macro-nested, proc-macro2, quick-error, quote, rand, rand, rand_chacha, rand_chacha, rand_core, rand_core, rand_hc, rand_hc, rayon, rayon-core, regex, regex-syntax, remove_dir_all, reqwest, rowan, rustc-hash, rustc_version, rustc_version, rustversion, safemem, scoped-tls, scopeguard, security-framework, security-framework-sys, semver, semver, semver-parser, serde, serde_cbor, serde_derive, serde_json, serde_json_traversal, serde_regex, serde_urlencoded, serde_yaml, sha-1, signal-hook, signal-hook-registry, siphasher, smallvec, socket2, static_assertions, string_cache, structopt, structopt-derive, syn, tar, tempfile, term, terminal_size, text-size, thiserror, thiserror-impl, thread_local, threadpool, time, tinytemplate, tokio-io-timeout, tungstenite, twoway, typed-builder, typenum, ucd-trie, unicase, unicode-bidi, unicode-normalization, unicode-segmentation, unicode-width, unicode-xid, url, utf-8, uuid, value-bag, vcpkg, vec_map, version_check, waker-fn, wasm-bindgen, wasm-bindgen-backend, wasm-bindgen-futures, wasm-bindgen-macro, wasm-bindgen-macro-support, wasm-bindgen-shared, web-sys, winapi, winapi-i686-pc-windows-gnu, winapi-x86_64-pc-windows-gnu, xattr, yaml-rust
Apache-2.0 OR MIT OR Zlib (3): miniz_oxide, tinyvec, tinyvec_macros
BSD-3-Clause (5): alloc-no-stdlib, alloc-stdlib, fuchsia-zircon, fuchsia-zircon-sys, instant
BSD-3-Clause OR MIT (2): brotli, brotli-decompressor
CC0-1.0 (2): notify, tiny-keccak
ISC (2): inotify, inotify-sys
MIT (98): ansi_term, ansi_term, assert-json-diff, async-object-pool, async-stream, async-stream-impl, atty, basic-cookies, bytes, cargo_metadata, castaway, clap, console, convert_case, crunchy, curl, curl-sys, deno_core, derive_more, difference, difflib, doc-comment, downcast, float-cmp, fsevent, fsevent-sys, fslock, generic-array, globwalk, h2, headers, headers-core, http-body, httpmock, hyper, include_dir, include_dir_impl, integer-encoding, isahc, kernel32-sys, levenshtein, matchers, matches, memoffset, mime_guess, mio, mio, new_debug_unreachable, oorandom, openssl-sys, ordered-float, phf_shared, pico-args, plotters, plotters-backend, plotters-svg, precomputed-hash, qstring, redox_syscall, redox_users, router-bridge, rusty_v8, schannel, serde_v8, sharded-slab, slab, sluice, strsim, termtree, textwrap, tokio, tokio-macros, tokio-native-tls, tokio-stream, tokio-tungstenite, tokio-util, tonic, tonic-build, tower, tower-layer, tower-service, tracing, tracing-attributes, tracing-core, tracing-futures, tracing-log, tracing-opentelemetry, tracing-serde, tracing-subscriber, try-lock, want, warp, which, winapi, winapi-build, winreg, ws2_32-sys, zip
MIT OR Unlicense (12): aho-corasick, byteorder, csv, csv-core, globset, ignore, memchr, regex-automata, same-file, termcolor, walkdir, winapi-util
N/A (4): apollo-parser, apollo-router, apollo-router-core, xtask
I'm halfway through generating a license, and adding a CI step to make sure the license file is up to date.
Are we fine with an HTML output, with inline CSS?
We should generate this file based on our dependencies — perhaps using
cargo-about
?) — and include this file in the packaged distributions. OurLICENSE
should also be included.