Skip to content

Commit 7350e1a

Browse files
authored
chore(deps): Add 3rd party license file and CI checks (vectordotdev#17344)
* chore(deps): Add 3rd party license file and CI checks * Add comments on the external crate license overrides * Move installation of license tool to the environment prepare script
1 parent 58ba741 commit 7350e1a

File tree

9 files changed

+687
-2
lines changed

9 files changed

+687
-2
lines changed

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ jobs:
346346
- name: Check cargo deny advisories/licenses
347347
if: needs.changes.outputs.dependencies == 'true' || needs.changes.outputs.deny == 'true'
348348
run: make check-deny
349+
- name: Check that the 3rd-party license file is up to date
350+
if: needs.changes.outputs.dependencies == 'true'
351+
run: make check-licenses
349352
- name: Check Cue docs
350353
if: needs.changes.outputs.cue == 'true'
351354
run: make check-docs

LICENSE-3rdparty.csv

+618-1
Large diffs are not rendered by default.

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ check: ## Run prerequisite code checks
417417
check-all: ## Check everything
418418
check-all: check-fmt check-clippy check-docs
419419
check-all: check-version check-examples check-component-features
420-
check-all: check-scripts check-deny check-component-docs
420+
check-all: check-scripts check-deny check-component-docs check-licenses
421421

422422
.PHONY: check-component-features
423423
check-component-features: ## Check that all component features are setup properly
@@ -435,6 +435,10 @@ check-docs: ## Check that all /docs file are valid
435435
check-fmt: ## Check that all files are formatted properly
436436
${MAYBE_ENVIRONMENT_EXEC} cargo vdev check fmt
437437

438+
.PHONY: check-licenses
439+
check-licenses: ## Check that the 3rd-party license file is up to date
440+
${MAYBE_ENVIRONMENT_EXEC} cargo vdev check licenses
441+
438442
.PHONY: check-markdown
439443
check-markdown: ## Check that markdown is styled properly
440444
${MAYBE_ENVIRONMENT_EXEC} cargo vdev check markdown

license-tool.toml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[overrides]
2+
"backon" = { origin = "https://github.com/Xuanwo/backon" }
3+
"bollard-stubs" = { origin = "https://github.com/fussybeaver/bollard" }
4+
"openssl-macros" = { origin = "https://github.com/sfackler/rust-openssl" }
5+
"serde_nanos" = { origin = "https://github.com/caspervonb/serde_nanos" }
6+
7+
# These can go away once Vector starts using a release of the VRL crate with a
8+
# library field set up.
9+
"vrl" = { license = "MPL-2.0" }
10+
"vrl-compiler" = { license = "MPL-2.0" }
11+
"vrl-core" = { license = "MPL-2.0" }
12+
"vrl-diagnostic" = { license = "MPL-2.0" }
13+
"vrl-parser" = { license = "MPL-2.0" }
14+
"vrl-tests" = { license = "MPL-2.0" }
15+
16+
# `ring` has a custom license that is mostly "ISC-style" but parts of it also fall under OpenSSL licensing.
17+
"ring-0.16.20" = { license = "ISC AND Custom" }
18+
19+
# `rustls-webpki` doesn't specify their license in the metadata, but the file contains the ISC terms.
20+
"rustls-webpki-0.100.1" = { license = "ISC" }
21+
22+
# `webpki` doesn't specify their license in the metadata, but the file contains the ISC terms.
23+
"webpki-0.21.4" = { license = "ISC" }
24+
"webpki-0.22.0" = { license = "ISC" }
25+
26+
# `zerocopy` et al don't specify their licenses in the metadata, but the file contains the 2-clause BSD terms.
27+
"zerocopy-0.6.1" = { license = "BSD-2-Clause" }
28+
"zerocopy-derive-0.3.2" = { license = "BSD-2-Clause" }

scripts/environment/prepare.sh

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ fi
1717
if ! cargo deny --version >& /dev/null ; then
1818
rustup run stable cargo install cargo-deny --force --locked
1919
fi
20+
if ! rust-license-tool --help >& /dev/null ; then
21+
cargo install --git https://github.com/DataDog/rust-license-tool
22+
fi
2023

2124
cd scripts
2225
bundle install

vdev/src/commands/build/licenses.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use anyhow::Result;
2+
3+
use crate::app;
4+
5+
/// Rebuild the 3rd-party license file.
6+
#[derive(clap::Args, Debug)]
7+
#[command()]
8+
pub struct Cli {}
9+
10+
impl Cli {
11+
pub fn exec(self) -> Result<()> {
12+
app::exec("rust-license-tool", ["write"], true)
13+
}
14+
}

vdev/src/commands/build/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
crate::cli_subcommands! {
22
"Build, generate or regenerate components..."
33
component_docs,
4+
mod licenses,
45
manifests,
56
mod publish_metadata,
67
release_cue,

vdev/src/commands/check/licenses.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use anyhow::Result;
2+
3+
use crate::app;
4+
5+
/// Check that the 3rd-party license file is up to date
6+
#[derive(clap::Args, Debug)]
7+
#[command()]
8+
pub struct Cli {}
9+
10+
impl Cli {
11+
pub fn exec(self) -> Result<()> {
12+
app::exec("rust-license-tool", ["check"], true)
13+
}
14+
}

vdev/src/commands/check/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ crate::cli_subcommands! {
77
events,
88
mod examples,
99
mod fmt,
10+
mod licenses,
1011
mod markdown,
1112
mod rust,
1213
mod scripts,

0 commit comments

Comments
 (0)