Rust licenses (#292)

* Add license specifier to all Cargo.toml files

Explicitly specify `license = "GPL-2.0-only"` in each Cargo.toml
file. The wording is from the SPX guidelines.

* Add shell script to check licenses of Rust projects

rust/check_licenses.sh automatically verifies all dependencies
for accidental usage of GPLv3. Since basically nobody in the
universe uses GPLv3, it tends not to do much.
This commit is contained in:
Herbert "TheBracket 2023-03-23 13:48:03 -05:00 committed by GitHub
parent 67c2ef7a24
commit c17d269ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 40 additions and 0 deletions

View File

@ -2,6 +2,7 @@
name = "lqos_rs"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]

24
src/rust/check_licenses.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# Checks all Rust projects for accidental inclusion of something GPL-3
# licensed.
PROJECTS="lqos_anonymous_stats_server lqos_bus lqos_config lqos_heimdall lqos_node_manager lqos_python lqos_queue_tracker lqos_setup lqos_sys lqos_utils lqosd lqusers xdp_iphash_to_cpu_cmdline xdp_pping"
TOOL="cargo license --help"
# Check that the tool exists
if ! $TOOL &> /dev/null
then
echo "Cargo License Tool not Found. Installing it."
cargo install cargo-license
fi
# Check every project
for project in $PROJECTS
do
pushd $project > /dev/null
if cargo license | grep "GPL-3"; then
echo "Warning: GPL3 detected in dependencies for $project"
fi
popd > /dev/null
done

View File

@ -2,6 +2,7 @@
name = "lqos_anonymous_stats_server"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
tokio = { version = "1.25.0", features = ["full"] }

View File

@ -2,6 +2,7 @@
name = "lqos_bus"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[features]
default = ["equinix_tests"]

View File

@ -2,6 +2,7 @@
name = "lqos_config"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
thiserror = "1"

View File

@ -2,6 +2,7 @@
name = "lqos_heimdall"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
lqos_utils = { path = "../lqos_utils" }

View File

@ -2,6 +2,7 @@
name = "lqos_node_manager"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[features]
default = ["equinix_tests"]

View File

@ -2,6 +2,7 @@
name = "lqos_python"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[lib]
name = "lqos_python"

View File

@ -2,6 +2,7 @@
name = "lqos_queue_tracker"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
thiserror = "1"

View File

@ -2,6 +2,7 @@
name = "lqos_setup"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
colored = "2"

View File

@ -2,6 +2,7 @@
name = "lqos_sys"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
nix = "0"

View File

@ -2,6 +2,7 @@
name = "lqos_utils"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
serde = { version = "1.0", features = ["derive"] }

View File

@ -2,6 +2,7 @@
name = "lqosd"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[features]
default = ["equinix_tests"]

View File

@ -2,6 +2,7 @@
name = "lqtop"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
tokio = { version = "1", features = [ "rt", "macros", "net", "io-util", "time" ] }

View File

@ -2,6 +2,7 @@
name = "lqusers"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
clap = { version = "4", features = ["derive"] }

View File

@ -2,6 +2,7 @@
name = "xdp_iphash_to_cpu_cmdline"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
clap = { version = "4", features = ["derive"] }

View File

@ -2,6 +2,7 @@
name = "xdp_pping"
version = "0.1.0"
edition = "2021"
license = "GPL-2.0-only"
[dependencies]
tokio = { version = "1", features = [ "rt", "macros", "net", "io-util", "time" ] }