Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(license): Setup cargo-deny #43

Merged
merged 4 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/cargo-deny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: cargo-deny
on: [push, pull_request]
jobs:
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![CI Badge](https://github.com/ethanuppal/dumbname/actions/workflows/ci.yaml/badge.svg)](https://github.com/ethanuppal/dumbname/blob/main/.github/workflows/ci.yaml)
[![Code Style Badge](https://github.com/ethanuppal/dumbname/actions/workflows/lint.yaml/badge.svg)](https://github.com/ethanuppal/dumbname/blob/main/.github/workflows/lint.yaml)
[![cargo-deny badge](https://github.com/ethanuppal/dumbname/actions/workflows/cargo-deny.yaml/badge.svg)](https://github.com/ethanuppal/dumbname/blob/main/.github/workflows/cargo-deny.yaml)
[![Lines of Code Badge](https://tokei.rs/b1/github/ethanuppal/dumbname?category=code)](https://github.com/ethanuppal/dumbname)

> [!IMPORTANT]
Expand Down Expand Up @@ -88,10 +89,15 @@ The TLDR is procedural macros + `dlopen`.
that uses a build script to statically link in verilated bindings, but is
unmaintained for years as of writing this.

## License
## 🔒 License & Legal

dumbname is licensed under the Mozilla Public License 2.0. This license is
similar to the Lesser GNU Public License, except that the copyleft applies only
to the source code of this library, not any library that uses it. That means you
can statically or dynamically link with unfree code (see
<https://www.mozilla.org/en-US/MPL/2.0/FAQ/#virality>).

I use [`cargo-deny`](https://github.com/EmbarkStudios/cargo-deny) (see the
[`deny.toml`](./deny.toml) to ensure no licensing violations occur. I also check
this on CI to prevent merging any new dependencies or dependency updates that
introduce incompatible licenses.
9 changes: 9 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[licenses]
allow = ["MIT", "Apache-2.0", "MPL-2.0", "EUPL-1.2", "ISC", "Unicode-3.0"]
exceptions = [
# we allow colog's LGPL because it is only used in GPL code
{ allow = ["LGPL-3.0"], crate = "colog" },
{ allow = ["GPL-3.0"], crate = "example-verilog-project" },
{ allow = ["GPL-3.0"], crate = "example-spade-project" },
]
confidence-threshold = 1.0
4 changes: 2 additions & 2 deletions examples/spade-project/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ rust-version.workspace = true
description.workspace = true
repository.workspace = true
readme.workspace = true
license.workspace = true
license = "GPL-3.0"

[[bin]]
name = "simple_test"
path = "test/simple_test.rs"

[dependencies]
colog.workspace = true
snafu.workspace = true
colog.workspace = true
spade.workspace = true
2 changes: 1 addition & 1 deletion examples/verilog-project/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rust-version.workspace = true
description.workspace = true
repository.workspace = true
readme.workspace = true
license.workspace = true
license = "GPL-3.0"

[[bin]]
name = "tutorial"
Expand Down